Linux is an Interpreter: Booting a New OS from a Shell Script via kexec
The Concept
A fascinating article on astrid.tech demonstrates that Linux can boot an entirely new operating system using nothing but a shell script piped through kexec.
The Command
curl https://astrid.tech/rkx.gz | gunzip | sudo sh
This 20MB base64-encoded shell script: checks for root, decodes a cpio archive containing a Linux 6.18.18 kernel and initramfs, then uses kexec to replace the running OS — all without a hardware reboot.
What is kexec?
kexec (kernel execution) loads and boots a new kernel directly from the running kernel, bypassing the BIOS/firmware boot process entirely. It's a fast-forward reboot.
Key Insight
The article demonstrates that Linux's architecture makes the boundary between user space and kernel space surprisingly permeable. A kernel is just a file. An initramfs is an archive. And a shell script is a valid mechanism to orchestrate OS transitions.
Security Warning
This is also a cautionary tale: curl | sh can replace your entire operating system without a single hardware reboot. The article is part of a five-part series exploring Linux's user/kernel boundary.