// chapter 02a

build

makefile targets for building kernel, userspace, rootfs, and iso. all targets are .PHONY (always rebuild).

build pipeline (in order)

make kernel              # build kernel/bzImage (reads kernel/config.fragment)
make userspace           # build static busybox (userspace/busybox)
make rootfs              # stage rootfs tree to build/rootfs/
make initramfs           # pack build/rootfs → build/praxis-initramfs.cpio.gz
make iso                 # build build/praxis.iso (limine bootable)

validation

make check               # shell syntax + rootfs staging sanity
make check-owned         # verify no host tools in default rootfs
make check-pax           # validate PAX language specs
make v1-check            # full release check (check-owned + sanity + smoke)

cleanup

make clean               # rm -rf build/

build artifacts

Makefile variableDefault pathPurpose
BUILD_DIRbuild/root build directory
KERNEL_IMAGEkernel/bzImagecompiled kernel
BUSYBOXuserspace/busyboxstatic busybox binary
ROOTFS_STAGEbuild/rootfsstaged filesystem tree
INITRAMFSbuild/praxis-initramfs.cpio.gzcompressed cpio archive
ISO_STAGEbuild/isoiso build staging
ISO_FILEbuild/praxis.isofinal iso image

build control flags

PRAXIS_ALLOW_HOST_TOOLS=1   # vendor host tools into rootfs
PRAXIS_ALLOW_HOST_KERNEL=1  # use host kernel fallback
PRAXIS_SKIP_BOOTCTL=1       # skip bootctl install

rootfs staging (build-rootfs.sh)

the most complex build step. it:

  • creates complete directory tree from scratch
  • copies rootfs skeleton
  • installs static busybox and symlinks all applets
  • copies 20+ installer tools from installer/
  • copies all Documentation/ and pax/ docs
  • copies kernel to /usr/share/praxis/vmlinuz
  • installs limine uefi stub
  • writes /etc/praxis/build-info with build metadata
  • optionally vendors host tools and pacman (with PRAXIS_ALLOW_HOST_TOOLS=1)

initramfs packing (build-initramfs.sh)

# pack rootfs to newc cpio format, gzip -9 compression
cpio -H newc -R 0:0 -o < file-list | gzip -n -9 > praxis-initramfs.cpio.gz

iso construction (build-iso.sh)

builds iso stage with:

  • vmlinuz, initramfs.cpio.gz
  • limine bios/uefi stubs
  • limine.conf in all 4 search paths
  • uses xorriso -as mkisofs with limine bios-install

next: qemu - makefile targets for testing.