aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Schieli <cschieli@gmail.com>2010-03-22 15:45:09 +0000
committerCedric Schieli <cschieli@gmail.com>2010-06-01 12:30:27 +0000
commita715c8dc0f98de4aeacc96d477948c7b28a41921 (patch)
tree582645cc37df461bbcef88fad059b5f485c3a0a6
parent50dfc13e86b0ac9445847604208c3d3a8729018f (diff)
downloadmkinitfs-a715c8dc0f98de4aeacc96d477948c7b28a41921.tar.bz2
mkinitfs-a715c8dc0f98de4aeacc96d477948c7b28a41921.tar.xz
init: generalize console=* handling
-rwxr-xr-xinitramfs-init.in29
1 files changed, 19 insertions, 10 deletions
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/