]> git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/init.d/firstsetup
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next
[ipfire-2.x.git] / src / initscripts / init.d / firstsetup
1 #!/bin/bash
2
3 # Exit if firstsetup was already done...
4 if [ -e /var/ipfire/main/firstsetup_ok ]; then
5 exit 0;
6 fi
7
8 # Edit the serial console entry at /etc/inittab matching to console parameter.
9 ser_console() {
10 while test x"$1" != x
11 do
12 case $1 in
13 console=*)
14 scon=${1##console=};
15 sed -i -e "s|^7:2345:respawn:/sbin/agetty.*|7:2345:respawn:/sbin/agetty ${scon%%,*} ${scon##*,}|g" /etc/inittab
16 shift
17 ;;
18 *)
19 shift
20 ;;
21 esac
22 done
23 }
24 cmdline=`cat /proc/cmdline`
25 ser_console $cmdline
26 # reload inittab
27 /sbin/init q
28 #
29 /etc/init.d/sysklogd start
30 export LANG=en_US.utf8
31 /usr/sbin/setup /dev/tty2 INSTALL
32 if [ "${?}" == "1" ]; then
33 echo Setup not finished. Rebooting ...
34 reboot -f
35 fi
36
37 # plan install pae kernel at next pakfire update if pae is supported
38 if [ ! "$(grep "^flags.* pae " /proc/cpuinfo)" == "" ]; then
39 if [ ! -e /opt/pakfire/db/installed/meta-linux-pae ]; then
40 echo "Name: linux-pae" > /opt/pakfire/db/installed/meta-linux-pae
41 echo "ProgVersion: 0" >> /opt/pakfire/db/installed/meta-linux-pae
42 echo "Release: 0" >> /opt/pakfire/db/installed/meta-linux-pae
43 fi
44 fi
45
46 echo Restarting udev...
47 killall udevd
48 /sbin/udevadm hwdb --update
49 /sbin/udevd --daemon
50 /sbin/udevadm trigger
51 /sbin/udevadm settle
52 /etc/init.d/sysklogd stop
53 touch /var/ipfire/main/firstsetup_ok