From a715c8dc0f98de4aeacc96d477948c7b28a41921 Mon Sep 17 00:00:00 2001 From: Cedric Schieli Date: Mon, 22 Mar 2010 15:45:09 +0000 Subject: init: generalize console=* handling --- initramfs-init.in | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'initramfs-init.in') diff --git a/initramfs-init.in b/initramfs-init.in index a306971..0bc1efb 100755 --- a/initramfs-init.in +++ b/initramfs-init.in @@ -149,19 +149,28 @@ find_ovl_dev() { done } -setup_inittab_serial(){ +setup_inittab_console(){ while [ $# -gt 0 ]; do local tty=${1%,*} local speed=${1#*,} - if [ "$speed" = "$1" ]; then - speed= - fi + local line= + local term= + case "$tty" in + ttyS*) + [ "$speed" = "$1" ] && speed=9600 + term=vt100 + line=-L + ;; + *) + [ "$speed" = "$1" ] && speed=38400 + ;; + esac shift # do nothing if inittab already have the tty set up grep -q "^$tty:" $sysroot/etc/inittab && continue - echo "# enable login on serial console" >> $sysroot/etc/inittab - echo "$tty::respawn:/sbin/getty -L $tty $speed vt100" \ + echo "# enable login on alternative console" >> $sysroot/etc/inittab + echo "$tty::respawn:/sbin/getty $line $speed $tty $term" \ >> $sysroot/etc/inittab done } @@ -177,8 +186,8 @@ while [ $# -gt 0 ]; do case "$1" in s|single|1) SINGLEMODE=yes ;; - console=ttyS*) - SERIAL="$SERIAL ${1#console=}";; + console=*) + CONSOLE="$CONSOLE ${1#console=}";; *=*) eval "KOPT_${1%%=*}='${1#*=}'" ;; no*) eval "KOPT_$(echo ${1#no} | sed 's: :_:g')=no" ;; *) eval "KOPT_$(echo $1 | sed 's: :_:g')=yes" ;; @@ -391,8 +400,8 @@ else fi eend $? -# fix inittab if serial console -setup_inittab_serial $SERIAL +# fix inittab if alternative console +setup_inittab_console $CONSOLE # copy alpine release info cp $ALPINE_MNT/.alpine-release $sysroot/ -- cgit v1.2.3