home: hub: mkinitfs

Download patch

ref: a715c8dc0f98de4aeacc96d477948c7b28a41921
parent: 50dfc13e86b0ac9445847604208c3d3a8729018f
author: Cedric Schieli <cschieli@gmail.com>
date: Mon Mar 22 10:45:09 CDT 2010

init: generalize console=* handling

--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -149,19 +149,28 @@
 	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 @@
 	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 @@
 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/