Post #4367202
2026-08-03 05:16 UTC
I've found a solution to the "init is not PID 1" problem on Alpine Linux. Now I can use a normal Alpine Linux as a bootloader! It turns out that "userspace-only reboot" is also supported by BusyBox init, after all. When you send SIGQUIT to PID 1, BusyBox shuts down all services, and relaunches a new init according to /etc/inittab's ::reboot:/target.
So, to chainload your next system from an Alpine Live CD/USB. You just need to do these steps. First, get your networking, VPN (kernel-mode only) and NFS ready. Use IPv6 SLAAC for network, so the network survives in multiple userspaces even without a running DHCP client.
/etc/init.d/networking start
wg-quick up wg0
mount -t nfs4 -o vers=4.2,sec=sys 10.10.20.1:/client1/debian_root /mnt/
Then,
echo "::restart:/sbin/switch_root /mnt /sbin/init" >> /etc/inittab
# reload inittab
kill -s SIGHUP 1
# disable sanity check
# warning: switch_root will delete everything in rootfs
touch /init
# the king is dead, long live the king
kill -s SIGQUIT 1
OpenRC shuts down the Alpine Linux, and BusyBox init replaces itself with systemd, and starts Debian in /mnt via NFS + VPN! The kernels don't match, new Debian kernel modules WILL NOT work, so you need a "double jump" with a kexec step to reload the kernels. This is currently in development, I'll write a blog post soon.
Replies (2)
-
@niconiconi@mk.absturztau.be 2026-08-03 06:05
Some progress on the "Linux userspace as bootloader" hack. CC @drwho@masto.hackers.town
-
@lanodan@queer.hacktivis.me 2026-08-03 05:20
@niconiconi@mk.absturztau.be Couldn't you put the kexec into the Alpine side of things so it's a single-jump?