From: Arne Fitzenreiter Date: Tue, 18 Oct 2011 13:55:07 +0000 (+0200) Subject: firstsetup: edit serial console device matching to commandline. X-Git-Tag: v2.9-core54~13^2~27 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=e0b28afe59c5cd0d5af5f2542f1df71045358010 firstsetup: edit serial console device matching to commandline. --- diff --git a/src/initscripts/init.d/firstsetup b/src/initscripts/init.d/firstsetup index 8ea1b5ec97..b658cfa027 100644 --- a/src/initscripts/init.d/firstsetup +++ b/src/initscripts/init.d/firstsetup @@ -1,4 +1,25 @@ #!/bin/bash +# Edit the serial console entry at /etc/inittab matching to console parameter. +ser_console() { + while test x"$1" != x + do + case $1 in + console=*) + scon=${1##console=}; + sed -i -e "s|^7:2345:respawn:/sbin/agetty.*|7:2345:respawn:/sbin/agetty ${scon%%,*} ${scon##*,}|g" /etc/inittab + shift + ;; + *) + shift + ;; + esac + done +} +cmdline=`cat /proc/cmdline` +ser_console $cmdline +# reload inittab +/sbin/init q +# /etc/init.d/sysklogd start export LANG=en_US.utf8 /usr/local/sbin/setup /dev/tty2 INSTALL