mirror of
https://github.com/troglobit/finit.git
synced 2026-11-16 19:20:26 +00:00
ad02b343f2fc977a697d4e2805eb95ed6e807b6f
A failed move of /dev, /proc, /sys or /run is logged at dbg() level and ignored, so the new init boots without its virtual filesystems and falls over much later in some unrelated way. The steps after, chdir/mount/chroot and the final execl(), do return -1 on failure, but by then all services are dead and the API socket is gone, so there is nobody left to report to: the system hangs with a live but useless PID 1. Make a failed move fatal, and try all four moves even if one fails, so a bad /dev does not also skip /proc, /sys and /run. A plain directory is not an error though: /run stays a plain directory on a tmpfs rootfs, so only a path on a different device than / is treated as a mount point and moved. Any failure past the point of no return now drops to sulogin(1) for a maintenance shell that reboots on exit, same as a fatal fsck() at boot. Signals are unblocked before the moves so the shell does not inherit finit's blocked signal mask. Signed-off-by: Paweł Sobczak <github@fixeq.qzz.io>
Finit is a fast, simple alternative to SysV init and systemd, designed for small and embedded Linux systems. It can also run on desktop and server systems, like finix.
Reverse engineered from the EeePC fastinit
"gaps filled with frog DNA …"
— Claudio Matsuoka
For detailed information, explore our extensive documentation
📚 http://finit-project.github.io
For working examples, see the 🚀 contrib/ section or these tutorials:
- 🛠️ Buildroot embedded Linux,
- 📦 Debian GNU/Linux,
- ⛰️ Alpine Linux, and
- 🌌 Void Linux
Note
Finit can run on various Linux distributions, but the bundled install scripts are examples only. They have been tested on amd64 (x86_64) systems with standard configurations.
For embedded systems, see these Buildroot-based examples: myLinux, Infix, or br2-finit-demo.
Languages
C
84.1%
Shell
12%
Makefile
2.1%
M4
1.7%

