Skip to content
archix is being rescoped. Don't install it yet.The released archix-git is the old model, which replaced packages and boot entries itself and broke a real install. The new design leaves packages to pacman and libalpm and rollback to snapper, and adds a diff that shows exactly what a switch will change. These docs describe the old model until the new one ships.Read the new scope.

Secure Boot

archix’s boot entries start unified kernel images (UKIs) on the ESP, in EFI/archix: one per distinct kernel and initramfs, shared by every entry that boots the same, the current system’s and each snapshot’s. With Secure Boot, the firmware only starts images signed by a key it trusts. archix signs every image it builds, the rescue entry’s, and systemd-boot itself, with your own keys through sbctl, and it won’t point the boot menu at an image the firmware would refuse.

Signing the loader needs boot.loader = "systemd-boot". With "grub", archix signs the images GRUB chainloads, but not GRUB; with "limine", it builds no images at all.

archix secure-boot setup creates sbctl keys if you don’t have any, and enrolls them in the firmware. What it can do depends on the firmware’s state.

Enrolling keys needs the firmware in setup mode, where it has no platform key of its own. Most firmware settings have an option to reset or clear the Secure Boot keys, which puts it there. Then:

Terminal window
$ sudo archix secure-boot setup
enrolled your Secure Boot keys; the next `archix switch` signs its boot entries with them
then turn Secure Boot on in the firmware settings

Your keys go into the firmware’s own db, together with Microsoft’s, with sbctl enroll-keys --microsoft. Run sudo archix switch to build signed boot images, then reboot into the firmware settings and turn Secure Boot on.

Setup still creates the keys, but can’t enroll them, and tells you what to do:

Terminal window
$ sudo archix secure-boot setup
the keys exist, but the firmware isn't in setup mode, so they can't be enrolled
reboot into the firmware settings, reset or clear the Secure Boot keys (setup mode), then run `sudo archix secure-boot setup` again

On a machine that didn’t boot through UEFI, it stops with this machine didn't boot through UEFI, so it has no Secure Boot. sbctl has to be installed: boot.secure_boot = true declares it, or install it with pacman -S sbctl.

--no-microsoft enrolls only your own keys:

Terminal window
$ sudo archix secure-boot setup --no-microsoft
warning: without Microsoft's keys, GPU option ROMs and Windows may fail to start, and some boards won't boot at all

Many graphics cards and network cards carry firmware (option ROMs) signed by Microsoft, which the firmware runs before any boot loader. Without Microsoft’s keys in db, those don’t load, and on some boards that leaves no display or no way to boot. Leave Microsoft’s keys in unless you know your hardware doesn’t need them.

archix also signs systemd-boot’s own file in /usr into systemd-bootx64.efi.signed beside it, which bootctl install, bootctl update and systemd-boot-update.service copy to the ESP, so a systemd update reaches the ESP signed. It signs a loader on the ESP in place only when Secure Boot is first set up and for Limine’s loader.

boot.secure_boot decides whether archix signs. With the default, null, it signs whenever sbctl has keys; true always signs and declares sbctl; false never signs. Every image archix builds is signed with sbctl sign, one per installed kernel and distinct initramfs, and so is systemd-boot’s own binary, EFI/systemd/systemd-bootx64.efi and EFI/BOOT/BOOTX64.EFI. A snapshot whose kernel and initramfs match the current system’s boots the same signed image, so most snapshot entries cost nothing on the ESP; one that differs keeps its own, built and signed when the snapshot was current.

archix enrolls your keys directly in the firmware. It doesn’t use shim or a Machine Owner Key (MOK). Booting through shim needs a kernel signed by a distribution key that Microsoft’s shim trusts, and Arch doesn’t ship one, so there’s nothing for shim to chain to; with your own keys in db, archix’s signed entries boot directly.

The menu never points at an unsigned image

Section titled “The menu never points at an unsigned image”

With Secure Boot enforcing, which means on and not in setup mode, a boot image that isn’t signed would be refused by the firmware. So a switch or revert whose images wouldn’t be signed at all, with boot.secure_boot = false or with sbctl holding no keys, refuses before it applies anything:

Terminal window
error: Secure Boot is on, but this switch's boot images wouldn't be signed (sbctl has no keys), so the firmware would refuse them; nothing was changed. Run `sudo archix secure-boot setup`, or set boot.secure_boot = true if sbctl already has keys

Inside a chroot, where the firmware is the host’s, it only warns. A switch applies in place before it builds the boot images, since they’re built from the kernel and initramfs it just installed; the same goes for the step after a plain pacman transaction that changed them. So archix also checks each new image, and the systemd-boot loader on the ESP, for a signature before it writes the boot menu, and leaves the menu starting the old images when one comes out unsigned anyway:

Terminal window
failed: the boot images weren't built, so the boot menu still starts the old ones: Secure Boot is on, but 7.2.9-arch1-1-aedff12d49d2.efi isn't signed, so the firmware would refuse it; the menu still starts the old images. Run `sudo archix secure-boot setup` (or set boot.secure_boot = true if sbctl already has keys)
error: generation 45 is applied and current, but 1 step failed (listed above)

The system is applied; only the boot menu stays behind, booting the images from before the switch. Fix the keys and switch again, which builds and signs them. After a plain pacman transaction, the same line appears in pacman’s output as archix: warning: the boot images weren't built, .... See Safety.

Inside a chroot, such as arch-chroot from a live USB, the firmware belongs to the machine running the live system, not to the system you’re setting up. So the check only warns: warning: not checking the new boot entry's signature against this host's Secure Boot, since this runs in a chroot.

boot.extra_entries adds systemd-boot entries archix doesn’t build, such as memtest86+. archix writes the entry file but doesn’t sign what it starts, and the firmware refuses an unsigned image like any other. The image has to be on the ESP. Sign it with sbctl; -s also adds it to the files sbctl re-signs:

Terminal window
$ sudo sbctl sign -s /efi/memtest86+/memtest.efi

archix secure-boot check reports on the boot you’re running, one line per requirement, and exits non-zero if any isn’t met. It doesn’t need root or a config.

Terminal window
$ archix secure-boot check
ok Secure Boot is on
ok the firmware isn't in setup mode (keys are enrolled)

archix status has a line for it too, Secure Boot: on, Secure Boot: off, or Secure Boot: setup mode (no keys enrolled; `sudo archix secure-boot setup` enrolls them). On a machine that didn’t boot through UEFI, status leaves the line out, and the check reports no the machine didn't boot through UEFI.

Some games’ anti-cheat, Easy Anti-Cheat’s Linux v2 among them, only runs on a boot it can trust. --anticheat checks what it asks for:

Terminal window
$ archix secure-boot check --anticheat
ok Secure Boot is on
ok the firmware isn't in setup mode (keys are enrolled)
no the kernel is signed with a well-known key (archix signs with your own key, and Arch has no well-known-signed kernel)
ok kernel lockdown is in integrity mode
ok kexec is disabled
ok the BPF LSM is active
ok the IOMMU is on, without passthrough
ok a TPM 2.0 is present
ok the boot was measured into the TPM
no no out-of-tree or unsigned kernel modules are loaded (NVIDIA and DKMS modules count)
Easy Anti-Cheat Linux v2 would refuse this boot: 2 requirements aren't met
Requirement What it reads
the kernel is signed with a well-known key A kernel signed by a key the anti-cheat vendor trusts. archix entries are signed with your own key, and Arch has no well-known-signed kernel, so this is never met on an archix entry. Booted another way, it says (not booted from an archix entry, so archix can't tell).
kernel lockdown is in integrity mode /sys/kernel/security/lockdown shows [integrity].
kexec is disabled kernel.kexec_load_disabled is 1.
the BPF LSM is active bpf is in /sys/kernel/security/lsm.
the IOMMU is on, without passthrough An IOMMU is present and no IOMMU group is in identity (passthrough) mode.
a TPM 2.0 is present The first TPM reports major version 2.
the boot was measured into the TPM The firmware’s measurement log exists.
no out-of-tree or unsigned kernel modules are loaded The kernel isn’t tainted by an out-of-tree or unsigned module. NVIDIA’s driver and DKMS modules count.

The summary only appears with --anticheat, and says 1 requirement isn't met for a single one.

Most of those requirements are kernel command line settings you don’t want on every boot. boot.protected_entry = true adds a separate entry for them:

lua/hosts/desktop/init.lua
return {
boot = { loader = "systemd-boot", secure_boot = true, protected_entry = true },
}

Next to its normal entry, the current system then gets archix-current-protected.conf, titled “Arch Linux (archix protected)”, with an image of its own, signed like the others. Snapshots don’t get one. Its command line adds:

lockdown=integrity sysctl.kernel.kexec_load_disabled=1 lsm=landlock,lockdown,yama,integrity,bpf iommu.passthrough=0

Pick it in the boot menu when you want it. It covers lockdown, kexec, the BPF LSM and the IOMMU. It can’t make the kernel well-known-signed, so the first anti-cheat requirement stays unmet, and loaded NVIDIA or DKMS modules still count against the last one. archix secure-boot check --anticheat shows what’s still missing.

Every UKI archix signed boots wherever it’s put, including ones gc deleted, with the older kernel and initramfs they carry, unless the firmware’s dbx lists them. There’s no shim to enforce SBAT (why not SBAT), so dbx is what revokes: archix secure-boot revoke adds the hashes of the UKIs archix signed and no longer uses, and boot.revoke_unused = true does that after every switch.

It only ever appends: the update is signed with your KEK and written with the firmware’s append flag, so the entries Windows and Microsoft’s own dbx updates put there stay. archix’s entries carry its own owner GUID, and it caps them at 128, since dbx lives in the same small NVRAM store Windows needs room in for its updates. It never revokes a hash any .efi file on the ESP has, and once it has revoked anything, every UKI it builds gets a random .archix section, so a rebuild can never come out identical to a revoked one.

It needs the KEK as a file, as sbctl creates it by default, and efitools for the signed write. The dbx from before is saved in /var/lib/archix/boot/dbx-before-<time>.

Each revoked hash takes 48 bytes, plus a 28-byte header per write, so archix’s 128 entries take about 6 KiB: a year or two of weekly kernel updates. It writes only while 64 KiB of variable space would be left over, since firmware often keeps the old copy of a variable until it reclaims space, usually at a reboot. On QEMU’s firmware, free space went from 99,524 to 74,248 bytes while archix went from 0 to 128 entries. A per-variable size limit can bite first, and Linux doesn’t show it.

revoke warns from 96 entries. At the cap, or short of space, it refuses and changes nothing, and a switch with revoke_unused still commits. archix never drops an entry to make room, since that would make any kept copy of that image bootable again. Past the cap, images archix stops using stay bootable for anyone who kept a copy; only a new db key retires them all, and archix doesn’t rotate the db key for you yet. If you rotate keys by hand, sbctl rotate-keys doesn’t re-sign archix’s files: sign every .efi under EFI/archix, EFI/archix-rescue and EFI/systemd, and EFI/BOOT/BOOTX64.EFI, before rebooting with Secure Boot on.

SBAT revokes by generation number instead of hash, without a size ceiling, but only shim enforces it: the SbatLevel variable is boot-services-only and written by shim from levels built into it, and systemd-boot and systemd-stub declare .sbat sections without ever checking one. archix’s chain is firmware → systemd-boot → UKI, signed with your own keys and no shim, so bumping a generation there would revoke nothing. The UKIs still carry the .sbat section ukify adds.

A disk key or other secret sealed to PCR 11 breaks whenever the UKI changes, since a new kernel, initramfs or command line measures differently. systemd’s answer is a signed PCR policy: the UKI carries a policy for its own PCR 11 values, signed with your key, and the secret is bound to the key instead of the values. archix signs one into every UKI it builds once systemd’s PCR signing key exists, at /etc/systemd/tpm2-pcr-private-key.pem with its public half at /etc/systemd/tpm2-pcr-public-key.pem, where systemd-cryptenroll looks for the public key. Create the key yourself; ukify genkey needs python-cryptography:

Terminal window
$ sudo ukify genkey --pcr-private-key=/etc/systemd/tpm2-pcr-private-key.pem --pcr-public-key=/etc/systemd/tpm2-pcr-public-key.pem

From the next switch that builds boot images on, UKIs carry .pcrsig and .pcrpkey sections, since the key is part of what a UKI’s name hashes; a switch with nothing to do builds none. Then bind the secret to the key, for a LUKS volume:

Terminal window
$ sudo systemd-cryptenroll --tpm2-device=auto --tpm2-public-key=/etc/systemd/tpm2-pcr-public-key.pem --tpm2-public-key-pcrs=11 /dev/nvme0n1p2

Every later switch signs the new UKI’s policy with the same key, so the secret keeps unlocking. Anyone who can read the private key can sign a policy for any UKI, so it’s as sensitive as your Secure Boot keys. Package install scriptlets and hooks run as root on the running system, so they can read it, like any root process.

Every UKI signed with the key carries a valid policy for as long as the volume is bound to it, older ones included. To retire them, or a key that may have leaked, replace the key and bind the volume to the new one:

Terminal window
$ sudo archix secure-boot rotate-pcr-key /dev/nvme0n1p2
wrote a new PCR policy signing key to /etc/systemd
bound /dev/nvme0n1p2's TPM2 slot to the new key
run `archix switch` before the next restart: until a UKI built with the new key boots, TPM2-bound volumes unlock only with a passphrase or recovery key, and UKIs built with the old key no longer unlock them
$ sudo archix switch

systemd-cryptenroll asks for each volume’s passphrase or recovery key, and replaces its TPM2 slot. The key’s fingerprint is part of the boot settings, so the next archix switch builds new boot images and signs their policies with the new key, even with nothing else to do. Until you boot one of them, the volume asks for its passphrase. See secure-boot rotate-pcr-key.