]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/initscripts/system/firstsetup
flash-images: merge normal and scon to one image.
[ipfire-2.x.git] / src / initscripts / system / firstsetup
index 857269ee13d9f9f809152b20698c01bfadce65c1..154a066998dea671d2d163ac3bb3af67e8c99d63 100644 (file)
@@ -5,24 +5,16 @@ if [ -e /var/ipfire/main/firstsetup_ok ]; then
        exit 0;
 fi
 
-# 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%%,*}|g" /etc/inittab
-                               shift
-                       ;;
-                       *)
-                               shift
-                       ;;
-               esac
-       done
-}
-cmdline=`cat /proc/cmdline`
-ser_console $cmdline
+# disable consoles if tty2 are not present
+if [ ! -e /dev/tty2 ]; then
+       # Disable console on tty2-6
+       sed -i -e "s|2:2345:respawn:|#2:2345:respawn:|g" /etc/inittab
+       sed -i -e "s|3:2345:respawn:|#3:2345:respawn:|g" /etc/inittab
+       sed -i -e "s|4:2345:respawn:|#4:2345:respawn:|g" etc/inittab
+       sed -i -e "s|5:2345:respawn:|#5:2345:respawn:|g" /etc/inittab
+       sed -i -e "s|6:2345:respawn:|#6:2345:respawn:|g" /etc/inittab
+fi
+
 # reload inittab
 /sbin/init q
 #