-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path1
executable file
·37 lines (29 loc) · 1.08 KB
/
1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
#
# Runit stage 1: one time bootup system tasks
# based on VOID Linux (https://www.voidlinux.org)
PATH=/usr/sbin:/usr/bin:/sbin:/bin
BOOTSTART=$(date +%s.%N)
# copy /dev/console messages to a logfile
BOOTLOGD=$(command -v bootlogd)
if [ -x "$BOOTLOGD" ] && [ ! -f /etc/sv/bootlogd/down ]; then
mountpoint -q /dev || mount -o mode=0755,nosuid -t devtmpfs dev /dev
[ -e /dev/console ] || mknod -m 600 /dev/console c 5 1
[ -d /dev/pts ] || mkdir -m0755 /dev/pts
mountpoint -q /dev/pts || mount -o mode=0620,gid=5,nosuid,noexec -n -t devpts devpts /dev/pts
$BOOTLOGD -l /var/log/boot.log
fi
printf '=> Entering Runit stage 1 (%s)\n' "$0"
[ -r /etc/rc.conf ] && . /etc/rc.conf
# Run bootup scripts
for f in /etc/runit/bootup/*.sh; do
[ -r "$f" ] && . "$f"
done
dmesg >/var/log/dmesg.log
if [ "$(sysctl -n kernel.dmesg_restrict 2>/dev/null)" = "1" ]; then
chmod 0600 /var/log/dmesg.log
else
chmod 0644 /var/log/dmesg.log
fi
BOOTTIME=$(printf 'scale=3; (%s - %s)/1\n' "$(date +%s.%N)" "$BOOTSTART" | bc)
printf '=> Runit stage 1 completed in %s sec, running stage 2...\n' "$BOOTTIME"