summaryrefslogtreecommitdiff
path: root/sinit/rc.init
diff options
context:
space:
mode:
Diffstat (limited to 'sinit/rc.init')
-rw-r--r--sinit/rc.init72
1 files changed, 72 insertions, 0 deletions
diff --git a/sinit/rc.init b/sinit/rc.init
new file mode 100644
index 0000000..aab0073
--- /dev/null
+++ b/sinit/rc.init
@@ -0,0 +1,72 @@
1#!/bin/sh
2umask 022
3
4. /etc/rc.conf
5
6echo "CRUX booting"
7
8/bin/mount -n -t proc -o nosuid,noexec,nodev proc /proc
9/bin/mount -n -t sysfs -o nosuid,noexec,nodev sysfs /sys
10
11/bin/mount -n -t tmpfs -o nosuid,mode=0755 dev /dev
12/bin/mkdir -p /dev/pts
13/bin/mount -n -t devpts -o gid=5,mode=0620 devpts /dev/pts
14
15/bin/mount -o remount,ro /
16
17echo Running smdev
18/bin/smdev -s
19
20echo Setting smdev as the kernel hotplug
21echo /bin/smdev >/proc/sys/kernel/hotplug
22
23cd /dev
24/bin/ln -sf /proc/self/fd/0 stdin
25/bin/ln -sf /proc/self/fd/1 stdout
26/bin/ln -sf /proc/self/fd/2 stderr
27/bin/ln -sf /proc/self/fd fd
28cd - >/dev/null
29
30echo Checking filesystems
31/bin/fsck -ATa
32if [ $? -eq 1 ]; then
33 echo Filesystems error exist, fix manually.
34 /bin/sh
35 /bin/halt -r
36fi
37
38echo Remounting root as read-write
39/bin/mount -o remount,rw /
40
41echo Mounting filesystems
42/bin/mount -a
43
44/bin/hostname $HOSTNAME
45
46echo Bringing up loopback
47/bin/ip addr add 127.0.0.1/8 dev lo broadcast + scope host
48/bin/ip link set lo up
49
50echo Setting hwclock
51[ -n "$TIMEZONE" ] && export TZ="$TIMEZONE"
52/bin/hwclock -s -u /dev/rtc0
53unset TZ
54
55[ -f /etc/random-seed ] && /bin/cat /etc/random-seed >/dev/urandom
56/bin/dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2>/dev/null
57
58echo Enabling core dumps
59ulimit -c unlimited
60
61if [ -x /etc/rc.local ]; then
62 echo Running rc.local
63 /etc/rc.local
64fi
65
66: >/var/run/utmp
67
68echo
69/bin/sh -c '/bin/respawn /bin/getty /dev/tty1 linux' &>/dev/null &
70/bin/sh -c '/bin/respawn /bin/getty /dev/tty2 linux' &>/dev/null &
71/bin/sh -c '/bin/respawn /bin/getty /dev/tty3 linux' &>/dev/null &
72/bin/sh -c '/bin/respawn /bin/getty /dev/tty4 linux' &>/dev/null &