aboutsummaryrefslogtreecommitdiff
path: root/initscripts/rc.boot
diff options
context:
space:
mode:
Diffstat (limited to 'initscripts/rc.boot')
-rwxr-xr-x[-rw-r--r--]initscripts/rc.boot38
1 files changed, 33 insertions, 5 deletions
diff --git a/initscripts/rc.boot b/initscripts/rc.boot
index 42c80ceb..c30a73c6 100644..100755
--- a/initscripts/rc.boot
+++ b/initscripts/rc.boot
@@ -2,8 +2,9 @@
PATH=/bin:/usr/bin:/sbin:/usr/sbin
-echo "Alice booting..."
+echo "> Alice booting..."
+echo "> Mounting virtual filesystems..."
mountpoint -q /proc || mount -t proc proc /proc -o nosuid,noexec,nodev
mountpoint -q /sys || mount -t sysfs sys /sys -o nosuid,noexec,nodev
mountpoint -q /run || mount -t tmpfs run /run -o mode=0755,nosuid,nodev
@@ -13,6 +14,7 @@ mountpoint -q /dev/pts || mount /dev/pts >/dev/null 2>&1 || mount -t devpts devp
mountpoint -q /dev/shm || mount /dev/shm >/dev/null 2>&1 || mount -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev
if [ "$(command -v udevd)" ]; then
+ echo "> Starting udevd daemon..."
udevd --daemon
udevadm trigger --action=add --type=subsystems
udevadm trigger --action=add --type=devices
@@ -20,6 +22,7 @@ if [ "$(command -v udevd)" ]; then
else
# In the case the user may preffer mdevd as opposed to busybox mdev
if [ ! -d "/var/service/mdevd" ]; then
+ echo "> Starting mdev..."
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
mdev -s
fi
@@ -30,8 +33,17 @@ else
ln -s fd/2 /dev/stderr
fi
-swapon -a
+echo "> Loading kernel modules..."
+if [ -f /etc/rc.modules ]; then
+ while read -r module; do
+ [ -n "$module" ] && ! echo "$module" | grep -q '^#' && modprobe "$module"
+ done < /etc/rc.modules
+fi
+
+echo "> Bringing up loopback interface..."
ip link set lo up
+
+echo "> Remounting root as read-only..."
mount -o remount,ro /
for arg in $(cat /proc/cmdline); do
@@ -42,6 +54,7 @@ for arg in $(cat /proc/cmdline); do
done
if [ ! "$FASTBOOT" ]; then
+ echo "> Running filesystem check..."
fsck $FORCEFSCK -ATat noopts=_netdev
if [ "$?" -gt 1 ]; then
echo "*******************************************"
@@ -52,36 +65,51 @@ if [ ! "$FASTBOOT" ]; then
fi
fi
+echo "> Enabling swap..."
+swapon -a
+
+echo "> Remounting root as read-write..."
mount -o remount,rw /
+
+echo "> Mounting all filesystems..."
mount -a
if [ ! -f /etc/hostname ]; then
- echo alice > /etc/hostname
+ echo localhost > /etc/hostname
fi
+echo "> Setting hostname..."
hostname -F /etc/hostname
+echo "> Cleaning stale PID files and /tmp..."
find /var/run -name "*.pid" -delete
find /tmp -xdev -mindepth 1 ! -name lost+found -delete
if [ -f "/etc/sysctl.conf" ]; then
+ echo "> Applying sysctl settings..."
sysctl -q -p
fi
-hwclock -s -u
+if [ -e /dev/rtc ] || [ -e /dev/rtc0 ]; then
+ echo "> Restoring hardware clock..."
+ hwclock -s -u
+fi
if [ -f "/var/lib/random-seed" ]; then
+ echo "> Seeding /dev/urandom..."
cat /var/lib/random-seed >/dev/urandom
rm -f /var/lib/random-seed
fi
if [ -d /sys/firmware/efi/efivars ]; then
+ echo "> Mounting efivarfs..."
mount -t efivarfs none /sys/firmware/efi/efivars
fi
dmesg >/var/log/dmesg.log
if [ -x /etc/rc.boot.local ]; then
- /etc/rc.boot.local
+ echo "> Running local boot script..."
+ /etc/rc.boot.local
fi
IFS=. read -r boottime _ < /proc/uptime