]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
firstsetup: edit serial console device matching to commandline.
authorArne Fitzenreiter <arne_f@ipfire.org>
Tue, 18 Oct 2011 13:55:07 +0000 (15:55 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 18 Oct 2011 13:55:07 +0000 (15:55 +0200)
src/initscripts/init.d/firstsetup

index 8ea1b5ec97f5fa0b3738634ef7fe5e962edfd383..b658cfa027936973e4f39f16f9bb88a26b9f8538 100644 (file)
@@ -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