| inittab | added files | |
| LICENSE | Initial commit | |
| Makefile | updates | |
| rc.boot | updates | |
| rc.boot.local | added files | |
| rc.modules | added files | |
| rc.shutdown | updates | |
| rc.shutdown.local | added files | |
| README.md | updates | |
initscripts
Minimal init scripts for a Linux system using busybox init and runit for service supervision.
Install
make install
Use DESTDIR to stage into a rootfs tree without touching the host system:
make install DESTDIR=/path/to/rootfs
Likewise for uninstall:
make uninstall [DESTDIR=/path/to/rootfs]
How it works
Busybox init reads /etc/inittab, which defines four actions:
| Action | Trigger |
|---|---|
::sysinit:/etc/rc.boot |
Runs once at boot |
::respawn:/usr/bin/runsvdir /var/service |
Keeps the runit supervisor alive |
::ctrlaltdel:/sbin/reboot |
Ctrl+Alt+Del handler |
::shutdown:/etc/rc.shutdown |
Runs once at shutdown |
rc.boot mounts virtual filesystems, sets up device management (udevd or mdev fallback), loads kernel modules, checks and mounts filesystems, sets the hostname, seeds the RNG, applies sysctl settings, and more.
rc.shutdown stops runit services, saves the random seed, syncs the hardware clock, terminates all processes, disables swap, brings down network interfaces, and unmounts filesystems.
Customization
Three files are provided as empty hooks for site-specific configuration:
rc.modules— kernel module names to load at boot (one per line,#comments and blank lines ignored).rc.boot.local— sourced at the end ofrc.bootfor custom boot logic.rc.shutdown.local— sourced at the start ofrc.shutdownfor custom shutdown logic.
Kernel command line
rc.boot recognizes two kernel cmdline parameters:
fastboot— skip the filesystem check.forcefsck— force a full filesystem check (fsck -f).
License
MIT