]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/firstsetup
firstsetup: edit serial console device matching to commandline.
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / firstsetup
index c3cf427c4f1f519996b4cbb8bb100ece68a9cba0..b658cfa027936973e4f39f16f9bb88a26b9f8538 100644 (file)
@@ -1,22 +1,36 @@
 #!/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
-/usr/bin/clear
-echo "Reboot ..."
-echo "Sending all processes the TERM signal..."
-/sbin/killall5 -15
-sleep 3
-echo "Sending all processes the KILL signal..."
-/sbin/killall5 -15
-sleep 3
-echo "Unmounting Filesystems..."
-/bin/umount /sys
-/bin/umount /dev/pts
-/bin/umount /proc
-/bin/umount /boot
-/bin/umount /var/log/rrd
-/bin/umount /var/lock
-/bin/umount /var/run
-/bin/umount /var
-rm -f /etc/rc.d/rcsysinit.d/S75firstsetup \
-&& /bin/mount -n -o remount,ro / \
-&& /sbin/reboot -f
+if [ "${?}" == "1" ]; then
+       echo Setup not finished. Rebooting ...
+       reboot -f
+fi
+echo Restarting udev...
+killall udevd
+/sbin/udevd --daemon
+/sbin/udevadm trigger
+/sbin/udevadm settle
+/etc/init.d/sysklogd stop
+rm -f /etc/rc.d/rcsysinit.d/S75firstsetup