mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-16 22:13:01 +02:00
Move all initscripts for the system to src/initscripts/system
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
This commit is contained in:
53
src/initscripts/system/firstsetup
Normal file
53
src/initscripts/system/firstsetup
Normal file
@@ -0,0 +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/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
|
||||
/etc/init.d/sysklogd stop
|
||||
touch /var/ipfire/main/firstsetup_ok
|
||||
Reference in New Issue
Block a user