X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=src%2Finitscripts%2Finit.d%2Ffirstsetup;h=70c30b4e230fb8b9fcff9e4f607394f2f948e8b1;hp=cef0b8a03768975449bd8ae6dc2111653b6a30e4;hb=b47472c1865f1777251a43376286ce884b8a4ba8;hpb=8caf7b64c83ea3641ee66a1e5b35d965ce78f666 diff --git a/src/initscripts/init.d/firstsetup b/src/initscripts/init.d/firstsetup index cef0b8a037..70c30b4e23 100644 --- a/src/initscripts/init.d/firstsetup +++ b/src/initscripts/init.d/firstsetup @@ -1,9 +1,53 @@ #!/bin/bash + +# Exit if firstsetup was already done... +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%%,*} ${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/sbin/setup /dev/tty2 INSTALL +if [ "${?}" == "1" ]; then + echo Setup not finished. Rebooting ... + reboot -f +fi + +# plan install pae kernel at next pakfire update if pae is supported +if [ ! "$(grep "^flags.* pae " /proc/cpuinfo)" == "" ]; then + if [ ! -e /opt/pakfire/db/installed/meta-linux-pae ]; then + echo "Name: linux-pae" > /opt/pakfire/db/installed/meta-linux-pae + echo "ProgVersion: 0" >> /opt/pakfire/db/installed/meta-linux-pae + echo "Release: 0" >> /opt/pakfire/db/installed/meta-linux-pae + fi +fi + echo Restarting udev... killall udevd +/sbin/udevadm hwdb --update /sbin/udevd --daemon /sbin/udevadm trigger /sbin/udevadm settle -rm -f /etc/rc.d/rcsysinit.d/S75firstsetup +/etc/init.d/sysklogd stop +touch /var/ipfire/main/firstsetup_ok