Skip to content

The forge · Stage of the build

Stage 1

The first scales form. A minimal out/rootfs beaten into shape with the Stage 0 compiler and checked by an acceptance suite before it is trusted.

Saphira Linux dragon mascot

A filesystem that runs on musl

Stage 1 builds a minimal root filesystem at out/rootfs using stage1/bootstrap-rootfs.sh. The work happens inside a chroot still hosted by glibc, but everything installed into the rootfs runs against musl only.

The shape is deliberate and strict: bash is the system shell, /bin/sh resolves to bash, /sbin/init resolves to openrc-init. GNU coreutils and standalone utilities are used throughout. There is no BusyBox and no systemd here; those rules were fixed before the first package was compiled.

Sources are pinned in sources.lock, verified by SHA-256 before use, and cross builds are configured so the native compiler that emerges inside the rootfs uses --with-sysroot=/ rather than any path from the build host. Acceptance checks cover C and C++ smoke tests, pthread stacks, the mimalloc policy, OpenRC links and device nodes before Stage 2 may begin.

Continue the chain

Next: Stage 2, back to Stage 0, or the forge overview.