runit fast boot and init scripts
Since I moved away from Debian and systemd again I've been trying new options for my init system, like s6, openbox init and suckless init (sinit). After trying out Void Linux, runit, which provides service supervision, seemed like a fine option so I installed it on my Gentoo machine.
Turns out it's pretty simple and it works, but I wanted a fast boot.
By default once you install runit, even if you use runit-init you'll end up using the same old SysV init scripts in one way or another. To get a fast boot you have to write your own. So that's what I did.
With my init scripts I could get a ~3 second boot; that's including the kernel which takes up most of the boot time; the userspace itself gets up to an usable state in around 500ms. This machine started with systemd in ~7 seconds, so I'm pretty sure people with faster machines will get an ever faster boot.
For those who don't know, runit works with 3 stages. Stage 1, which runs at boot; stage 2, which starts up services in parallel and keeps running until shutdown, and stage 3 which does the actual shutdown process. I'll share my scripts for each one.