# FILE FORMAT:
# <id>:<runlevels>:<action>:<command>
# id: 2-4 characters, unique.
# runlevels: 0:shutdown 1:single 2:offline 3:ethernet 4:wifi 5:public-wifi abc:ondemand 6:reboot
# action: off, sysinit, boot, bootwait, initdefault, once, wait, respawn, ondemand, powerfail, powerwait, powerokwait, powerfailnow, ctrlaltdel, kbrequest
# command: command to be executed. Does not support ; or || or && as separation of multiple commands. Use instead: sh -c "command ; command"
# command: @ executes command as is (no path search). + does not record utmp/wtmp (for processes which do that themselves).
# MAX LINE LENGTH ----------------------------------------------------------------------------------------------------------->|
# INIT STARTS: Sets umask and path, hooks ctrl-alt-del and kbdrequest, truncates wtmp, executes emergency if requested, then sysinit list.
00:12345:ctrlaltdel:/sbin/shutdown -r 10
#01:12345:kbrequest:wall "Test: KBREQUEST"
# SYSINIT: each process has the console as input and output
a0::sysinit:/bin/busybox mount -nvt proc none /proc -o nodev,noexec,nosuid
a1::sysinit:/bin/busybox mount -nvt sysfs none /sys -o nodev,noexec,nosuid
a2::sysinit:/bin/busybox echo 5000 > /sys/module/block/parameters/events_dfl_poll_msecs
a3::sysinit:/bin/busybox mount -nvt devtmpfs none /dev -o remount,noexec,nosuid,mode=0755,size=1M
a4::sysinit:/bin/busybox mkdir -m 0755 /dev/pts
a5::sysinit:/bin/busybox mount -nvt devpts none /dev/pts -o noexec,nosuid,mode=0620
a6::sysinit:/bin/busybox mkdir -m 1777 /dev/mqueue
a7::sysinit:/bin/busybox mount -nvt mqueue none /dev/mqueue -o noexec,nosuid,nodev
#a8::sysinit:/bin/busybox mdev -sf
a9::sysinit:/bin/busybox hwclock -l --systz
aa::sysinit:/bin/busybox mount -nvt tmpfs none /run -o mode=1777,size=4M
ab::sysinit:/bin/busybox mount -nvt tmpfs none /tmp -o mode=1777,size=64M
ac::sysinit:/bin/busybox mkdir -m 1755 /run/udev
ad::sysinit:/bin/busybox mkdir -m 1777 /run/lock
# SINGLE: Writes utmp/wtmp boot time, executes single if requested, then boot list.
03:s:wait:/bin/busybox su
# BOOT: Each wait process has console as input and output. The rest have only console output with no controlling input.
b0::bootwait:/sbin/udevd -d
b1::boot:/sbin/udevadm trigger --type=subsystems --action=add
b2::boot:/sbin/udevadm trigger --type=devices --action=add
b3::boot:/bin/busybox klogd -c 8
b4::boot:/usr/sbin/acpid
b5::boot:/usr/bin/kbdrate -r 20 -d 250
b6::boot:@/bin/busybox sh -c 'for i in 1 2 3 4 \; do /usr/bin/setleds -D +num < /dev/tty$i \; done'
b7::boot:ifconfig lo add 127.0.0.1 netmask 255.0.0.0 up
b8::boot:/bin/busybox mount -v / -o remount,rw,noatime
b9::bootwait:/usr/sbin/dmraid -ay
ba::bootwait:/sbin/btrfs device scan -d
bb::bootwait:/bin/busybox echo "Waiting for udev... (max. 10s)"
bc::boot:/bin/busybox timeout 10 ash -c 'while ! /bin/mount -at nonfs ; do sleep 1 ; done'
bd::boot:/etc/init.d/m95d-tmp-dirs
be::boot:/etc/init.d/m95d-hw-profile
# RUNLEVEL: Enters requested runlevel (1-5) or the default one.
04:3:initdefault:
# RUNLEVELS: Execute the list of the requested runlevel.
c0:2345:respawn:/usr/sbin/gpm -m /dev/input/mice -t imps2
c1:2345:once:/usr/sbin/alsactl restore --pedantic
c2:2:wait:/bin/busybox umount -aft nfs
c3:234:wait:/bin/busybox sh -c '[ -e /sys/class/net/wg0 ] && ifconfig wg0 down'
c4:23:wait:/bin/busybox sh -c '[ -e /sys/class/net/wlan0 ] && ifconfig wlan0 down'
c5:245:wait:/bin/busybox ifconfig eth0 down
c6:3:wait:/bin/busybox ifconfig eth0 add 172.27.143.10 netmask 255.255.255.0 mtu 9000 up
c7:3:wait:/bin/busybox ip route add default via 172.27.143.1
c8:45:wait:echo "DO WLAN"
c9:45:wait:echo "DO DHCP"
ca:5:wait:/usr/bin/wg-quick up wg0
cb:345:once:/bin/busybox ntpd -q -N -S "hwclock -l -w"
cc:345:respawn:/sbin/rpcbind
cd:345:once:/bin/busybox mount -at nfs
ce:345:respawn:+/usr/sbin/dropbear -v -R -p 10022
# HALT & REBOOT
z0:0:wait:/sbin/poweroff -w
z1:6:wait:/sbin/reboot -w
z2:06:wait:/sbin/telinit u
z3:06:wait:/usr/sbin/alsactl store
z4:06:wait:/bin/busybox kill $(cat /run/acpid.pid) $(cat /run/klogd.pid)
z5:06:wait:/bin/busybox dmesg >> /var/log/syslog.$(date -I)
z6:06:wait:/bin/busybox mount / -o ro,remount
z7:0:wait:/sbin/poweroff -dhn
z8:6:wait:/sbin/reboot -dkn
# CONSOLES
#x1:12345:respawn:/sbin/agetty 38400 console linux
t1:12345:respawn:/sbin/agetty 38400 tty1 linux --noclear --autologin root
t2:2345:respawn:/sbin/agetty 38400 tty2 linux
t3:2345:respawn:/sbin/agetty 38400 tty3 linux
t4:2345:respawn:/sbin/agetty 38400 tty4 linux --autologin marius95
#s0:12345:respawn:/sbin/agetty -L 115200 ttyS0 vt100
#s1:12345:respawn:/sbin/agetty -L 115200 ttyS1 vt100