Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Images and Boot

A PureDarwin image is a raw disk file with partitions. It holds a small FAT partition that the firmware reads, called the EFI system partition, and a root filesystem with the system on it. Some images have more.

image.nix builds the image, and nix/image-contents.nix decides what goes into each kind of image.

A typical x86_64 image looks like this:

GPT
+-- p1  EFI system partition (FAT)
|     \EFI\BOOT\BOOTX64.EFI      xnu-loader, the bootloader
|     \EFI\BOOT\boot-args.txt    boot arguments, read by the loader
|     the kernel collection
+-- p2  root filesystem (ext4, or HFS+ or APFS on some images)
      the base system, plus the extra software the flavour includes

On arm64 the loader is BOOTAA64.EFI. Some arm64 images have no root partition and load the whole system into a RAM disk instead.

image.nix writes almost all of /etc when it builds the image. That includes passwd, master.passwd, group, hosts, fstab, resolv.conf, ttys and the shell start-up files. If an edit to one of those files in a running system doesn’t survive a rebuild, this is why. Change image.nix instead, and rebuild the image.