Browse Source

add runtime option for inittab configuration

Waldemar Brodkorb 13 years ago
parent
commit
8eb8b85f89

+ 21 - 0
Config.in

@@ -215,6 +215,27 @@ config ADK_RUNTIME_KBD_LAYOUT
 	help
 	  Predefine the keyboard layout for the embedded system.
 
+choice
+prompt "Console output on embedded system"
+default ADK_RUNTIME_CONSOLE_VGA if ADK_HARDWARE_IBMX40
+default ADK_RUNTIME_CONSOLE_SERIAL
+
+config ADK_RUNTIME_CONSOLE_VGA
+	bool "console output on VGA"
+	help
+          Start getty on VGA console. (tty1-tty6)
+
+config ADK_RUNTIME_CONSOLE_SERIAL
+	bool "console output on serial"
+	help
+	  Start getty on serial console. (ttyS0)
+
+config ADK_RUNTIME_CONSOLE_BOTH
+	bool "console output on console and serial"
+	help
+	  Start getty on VGA console and serial device.
+
+endchoice
 endmenu
 
 menu "Package selection"

+ 9 - 1
package/base-files/Makefile

@@ -6,7 +6,7 @@ include $(TOPDIR)/mk/rootfs.mk
 
 PKG_NAME:=		base-files
 PKG_VERSION:=		1.0
-PKG_RELEASE:=		32
+PKG_RELEASE:=		33
 PKG_SECTION:=		base
 PKG_DESCR:=		basic files and scripts
 
@@ -62,6 +62,14 @@ endif
 	ln -sf ../proc/mounts $(IDIR_BASE_FILES)/etc/mtab
 	rm -rf $(IDIR_BASE_FILES)/var
 	ln -sf tmp $(IDIR_BASE_FILES)/var
+	test -z $(ADK_RUNTIME_CONSOLE_VGA) || \
+	    cat ./files/inittab.vga >> $(IDIR_BASE_FILES)/etc/inittab
+	test -z $(ADK_RUNTIME_CONSOLE_SERIAL) || \
+	    cat ./files/inittab.serial >> $(IDIR_BASE_FILES)/etc/inittab
+	test -z $(ADK_RUNTIME_CONSOLE_BOTH) || \
+	    cat ./files/inittab.serial >> $(IDIR_BASE_FILES)/etc/inittab
+	test -z $(ADK_RUNTIME_CONSOLE_BOTH) || \
+	    cat ./files/inittab.vga >> $(IDIR_BASE_FILES)/etc/inittab
 	test -z $(ADK_RUNTIME_HOSTNAME) || \
 	    echo $(ADK_RUNTIME_HOSTNAME) > \
 	    $(IDIR_BASE_FILES)/etc/hostname

+ 1 - 0
package/base-files/files/inittab.serial

@@ -0,0 +1 @@
+ttyS0::respawn:/sbin/getty -i -L ttyS0 115200 vt100

+ 7 - 0
package/base-files/files/inittab.vga

@@ -0,0 +1,7 @@
+tty1::respawn:/sbin/getty -i -L tty1 115200 vt100
+tty2::respawn:/sbin/getty -i -L tty2 115200 vt100
+tty3::respawn:/sbin/getty -i -L tty3 115200 vt100
+tty4::respawn:/sbin/getty -i -L tty4 115200 vt100
+tty5::respawn:/sbin/getty -i -L tty5 115200 vt100
+tty6::respawn:/sbin/getty -i -L tty6 115200 vt100
+tty11::respawn:/sbin/logread -f

+ 0 - 2
package/base-files/src/etc/inittab

@@ -1,4 +1,2 @@
 ::sysinit:/etc/init.d/rcS
 ::shutdown:/etc/init.d/rcK
-ttyS0::respawn:/sbin/getty -i -L ttyS0 115200 vt100
-

+ 0 - 4
target/x86/files/etc/inittab

@@ -1,4 +0,0 @@
-::sysinit:/etc/init.d/rcS
-::shutdown:/etc/init.d/rcK
-ttyS0::respawn:/sbin/getty -i -L ttyS0 115200 vt100
-tty1::askfirst:/sbin/getty -i -L tty1 115200 vt100

+ 0 - 4
target/x86_64/files/etc/inittab

@@ -1,4 +0,0 @@
-::sysinit:/etc/init.d/rcS
-::shutdown:/etc/init.d/rcK
-ttyS0::respawn:/sbin/getty -i -L ttyS0 115200 vt100
-tty1::askfirst:/sbin/getty -i -L tty1 115200 vt100