Linux is an Interpreter: Booting a New OS from a Shell Script via kexec

Available in: 中文
2026-03-29T11:29:18.775Z·1 min read
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 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.

↗ Original source · 2026-03-29T00:00:00.000Z
← Previous: OpenCiv1: Open Source Rewrite of Civilization 1 (1991) Hits 430 Stars on GitHubNext: Middle East Escalation: Houthi Involvement and the Bab el-Mandeb Strait Under Threat →
Comments0