Repository navigation
Install UEFI machines with systemd-boot - #489
Conversation
The image keeps Limine's stack, which BIOS installs boot with. A UEFI install swaps it for omarchy-boot-systemd, puts systemd-boot on the ESP with an "Omarchy Boot" entry first in the boot order, writes the command line to /etc/kernel/cmdline and /etc/cmdline.d, and has omarchy-boot-switch install build and verify the boot images once every boot drop-in is written, the way a factory reset of this install will. validate_boot checks the loader, its config, a boot image carrying the install's command line, the boot store's fstab line and a route to the loader; an encrypted provisioning install's unlock rides in the command line drop-in. The ISO builds omarchy-boot and omarchy-boot-systemd from a pkgs checkout that has them, keeps omarchy-boot-systemd in the mirror next to the Limine stack it conflicts with, and ships it. An ISO without it, or OMARCHY_ISO_BOOT_LOADER=limine, installs Limine as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
aarch64 images carry Limine's packages by name rather than through omarchy-boot, so only omarchy-boot-systemd is built and swapped in there. An N1x's boot images are checked for the console parameters its Limine entries had to carry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
[High impact] The PR changes the boot path for eligible new UEFI installations. Changes are needed before merging: replace loader files safely, fix the older-rehearsal failure, and update the rehearsal documentation. Findings
Fix with agent prompt### Issue 1
configs/airootfs/usr/share/omarchy-iso/orchestrator/phases_impl.py:1836
On a protected install that reuses an ESP with systemd-boot, `_copy_required` overwrites the existing loader through `shutil.copy2`. A failed or interrupted copy can leave another installed system's loader incomplete.
The boot-safety rule requires staging boot binaries, checking them, and publishing with a same-filesystem atomic rename. Use that approach here and for the removable loader copy at line 1834.
### Issue 2
bin/omarchy-iso-make:181
`--rehearsal` now also builds `omarchy-boot-systemd` from the supplied checkout when its recipe exists. But `README.md:519` still says every package besides `omarchy` and `omarchy-settings` comes from edge as published. Maintainers are therefore told they are testing a published boot package when they are testing a local build.
The documentation rule requires updates in the same PR when documented operator behavior changes. Update the rehearsal section to include the local boot package.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
### Issue 3
bin/omarchy-iso-make:180-182
If the Omarchy checkout lacks `omarchy-boot-switch`, the rehearsal still adds `omarchy-boot-systemd` whenever its recipe exists. The local-package branch in `build-iso.sh` runs before the missing-command check, so the package ships anyway. The installer then selects systemd-boot and stops when it calls the missing command, after preparing the target disk.
Check for `omarchy-boot-switch` before adding the local swap package, and exclude that package from the mirror otherwise.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryUEFI installs use systemd-boot when the ISO bundles its stack. BIOS, Intel Macs, and explicit Limine overrides keep Limine.
|
Install test passed
Boots are loader, kernel and userspace, without the VM's firmware. Install phases, x86_64
Install phases, aarch64
|
From a Codex review: an unencrypted install into free space mounts its ESP at /efi, where omarchy-boot-switch install did not look. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CY6YBjgjqqbJnZaM3wihLS
From Greptile's review: a boot image whose command line cannot be read was skipped, so a damaged one could pass next to a good one; it now fails validation. The firmware scenario checks the loader the install actually got, so an install that stayed on Limine (no omarchy-boot-systemd on the ISO, or OMARCHY_ISO_BOOT_LOADER=limine) still passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@dhh can we theme this like GRUB? |
On an encrypted install the boot stops at the disk passphrase, which the desktop scenario never typed, so it timed out waiting for SSH. It waits with wait_for_ssh, which types it, as every other scenario's boot does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
phases_impl.py conflicted where quattro's stale-entry pruning (replaced_guids) met the branch's labelled boot entries, where finalize_boot_and_user now buffers the user finalizer's log, and where validate_boot now joins the deferred LUKS keyslot. replaced_guids now reaches the systemd-boot loader too, and pruning also takes a wiped disk's dead "Omarchy Boot" entries; systemd-boot gets the complete /etc/kernel/cmdline value, since quattro may leave the console parameter to a Limine drop-in systemd-boot never reads; the deferred keyslot join moved into the shared validate_boot tail; and finalize_systemd_boot disables btrfs quotas from the host as Limine now does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI builds the ISO from published edge packages, which don't carry the systemd-boot stack yet, so its installs use Limine and their Omarchy has no omarchy-boot-backend. The factory-reset and firmware-boot scenarios called it directly and died on the missing command before checking anything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omarchy-boot-switch refuses to move an Intel Mac (an Apple DMI vendor, or linux-t2 installed) to systemd-boot: their firmware needs testing with it first. The installer gave them systemd-boot anyway on every UEFI install. _boot_loader now keeps them on Limine the same way: Apple hardware, or linux-t2 among the selected kernels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omarchy-boot-systemd's pacman hooks rebuild the boot images into the boot store, and fail when it isn't mounted while pacman still exits 0. omarchy-boot-switch install unmounts the store at the end of finalize_systemd_boot, so an OEM script that installed firmware, a kernel or a DKMS module left the machine with boot images that lack it. On systemd-boot each OEM script now runs in a mount namespace of its own with the store mounted from the target's fstab. During system setup the store does not exist yet, so the stack's 60-mkinitcpio-remove.hook (n1x.sh drops the stock kernels) could only fail; it is deferred with 90-mkinitcpio-install.hook there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- validate_boot accepted a missing systemd-boot when EFI/BOOT/BOOT*.EFI was there, which on a shared ESP can be another system's loader. The "Omarchy Boot" entry starts EFI/systemd's copy, and omarchy-boot-switch install always writes it, so that copy is what it requires now. - A boot image whose file ends inside its .cmdline read back as the part before the cut, which can name the root while missing what follows. It reads as no cmdline now, as embed_cmdline already treats it. - finalize_systemd_boot and the checks after it took the ESP from omarchy_install.boot alone, where Limine follows the mount the installer actually used (ESP_PATH). They follow it too now. - A Limine install pruned stale "Limine" entries of the disk it wiped but not an earlier systemd-boot install's "Omarchy Boot" ones. Both go now, whichever loader is installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A build from an Omarchy checkout without omarchy-boot-switch shipped the channel's omarchy-boot-systemd all the same, and the install failed after wiping the disk when it came to run it. Such a build keeps Limine. - pacman's resolution of the channel's omarchy-boot-systemd ran in a process substitution whose failure the build never saw. It stops now. - A local omarchy-boot-systemd shipped with systemd-ukify, named by hand; it ships with every dependency its .PKGINFO names now. - A release rehearsal built omarchy and omarchy-settings from the pinned checkout and took omarchy-boot-systemd, released in lockstep with them, from edge. It builds it too where the pkgs checkout has it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI's ISOs boot Limine only because no channel offers omarchy-boot-systemd yet. Once one does, every UEFI install is on systemd-boot, and these scripts still read Limine's files: arm64-install looked for omarchy_*.efi, vm-seal copied omarchy_<kernel>.efi and edited limine.conf, vm-verify rebuilt with limine-mkinitcpio and read limine.conf, and upgrade-test counted limine.conf's groups. Each asks omarchy-boot-backend now (Limine where it's missing) and checks systemd-boot's own: the machine's boot images, the default loader.conf names, and omarchy-boot-rebuild and omarchy-boot-sync verify on a clone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The desktop scenario polled wait_for_ssh, itself a wait of BOOT_TIMEOUT, through wait_for_guest_state, which hid what it said and, with the VM gone, called it again every second for the whole timeout. It is called once, with its own ok or not ok. The factory reset's fresh-store check passed when btrfs could not show /var/lib/omarchy/boot at all: an empty UUID differs from the old one. It wants a UUID now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| rehearsal_packages="omarchy-settings omarchy" | ||
| [[ ! -d $LOCAL_PKGS_PATH/pkgbuilds/omarchy-boot-systemd ]] || rehearsal_packages+=" omarchy-boot-systemd" | ||
| : "${OMARCHY_LOCAL_PACKAGES:=$rehearsal_packages}" |
There was a problem hiding this comment.
Older rehearsals fail during installation
If the Omarchy checkout lacks omarchy-boot-switch, the rehearsal still adds omarchy-boot-systemd whenever its recipe exists. The local-package branch in build-iso.sh runs before the missing-command check, so the package ships anyway. The installer then selects systemd-boot and stops when it calls the missing command, after preparing the target disk.
Check for omarchy-boot-switch before adding the local swap package, and exclude that package from the mirror otherwise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # configs/airootfs/usr/share/omarchy-iso/orchestrator/phases_impl.py
Brings in the hardware layers (#530), the library read before the first pacman transaction (#531), systemd-boot installs (#489, #529) and the setup form's XKB layouts (#528). Two conflicts. In builder/build-root-image.sh both steps stay: the hardware layers first, which write into the image tree, then the Try layer against the finished image. In phases_impl.py the hardware layer paths join the squashfs ROOT_IMAGE and its mount paths.
The nightly fails on every x86 channel since ad57b15 (omacom#489), the stable release ISO included: cat: /etc/machine-id: No such file or directory vm-seal passed its main guest script to root() as one single-quoted string. omacom#489 added a comment in it with an apostrophe ("a clone's"). That apostrophe ended the string on the runner. The runner then ran the rest of the script itself, and the test container has no machine ID. bash -n accepts the result, because the broken quoting still parses. A quoted here-document ends only at its delimiter line, so no quote in the script can end it. The guest runs the same commands as before.
| if removable: | ||
| _copy_required(source, ctx.target / esp_mount.lstrip("/") / "EFI" / "BOOT" / f"BOOT{_efi_arch_suffix()}.EFI") | ||
| return | ||
| _copy_required(source, ctx.target / esp_mount.lstrip("/") / "EFI" / "systemd" / f"systemd-boot{arch_name}.efi") |
There was a problem hiding this comment.
Existing boot loader overwritten
On a protected install that reuses an ESP with systemd-boot, _copy_required overwrites the existing loader through shutil.copy2. A failed or interrupted copy can leave another installed system's loader incomplete.
The boot-safety rule requires staging boot binaries, checking them, and publishing with a same-filesystem atomic rename. Use that approach here and for the removable loader copy at line 1834.
Rule Used: Never modify a published discoverable boot binary (such as EFI/Linux/*.efi on a live or target ESP) in place: write to a non-discoverable staging path, finish all mutations and PE/size checks, publish with a same-filesystem atomic rename (os.replace ... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: configs/airootfs/usr/share/omarchy-iso/orchestrator/phases_impl.py
Line: 1836
Comment:
**Existing boot loader overwritten**
On a protected install that reuses an ESP with systemd-boot, `_copy_required` overwrites the existing loader through `shutil.copy2`. A failed or interrupted copy can leave another installed system's loader incomplete.
The boot-safety rule requires staging boot binaries, checking them, and publishing with a same-filesystem atomic rename. Use that approach here and for the removable loader copy at line 1834.
**Rule Used:** Never modify a published discoverable boot binary (such as EFI/Linux/*.efi on a live or target ESP) in place: write to a non-discoverable staging path, finish all mutations and PE/size checks, publish with a same-filesystem atomic rename (os.replace ... ([source](https://github.com/omacom/omarchy-iso/blob/667d29757d62f84d1db10ae61e4b94cc8464813f/.greptile/config.json))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| # omarchy-boot-systemd is released in lockstep with them, where the pkgs | ||
| # checkout has it. | ||
| rehearsal_packages="omarchy-settings omarchy" | ||
| [[ ! -d $LOCAL_PKGS_PATH/pkgbuilds/omarchy-boot-systemd ]] || rehearsal_packages+=" omarchy-boot-systemd" |
There was a problem hiding this comment.
Rehearsal package sources misdescribed
--rehearsal now also builds omarchy-boot-systemd from the supplied checkout when its recipe exists. But README.md:519 still says every package besides omarchy and omarchy-settings comes from edge as published. Maintainers are therefore told they are testing a published boot package when they are testing a local build.
The documentation rule requires updates in the same PR when documented operator behavior changes. Update the rehearsal section to include the local boot package.
Rule Used: When a PR changes user-visible or operator-visible behavior documented in README.md, docs//*.md, builder/qualcomm/README.md, or test/fake-pci.md, update the doc in the same PR. When README.md or a file under docs//*.md is added, moved, or removed... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: bin/omarchy-iso-make
Line: 181
Comment:
**Rehearsal package sources misdescribed**
`--rehearsal` now also builds `omarchy-boot-systemd` from the supplied checkout when its recipe exists. But `README.md:519` still says every package besides `omarchy` and `omarchy-settings` comes from edge as published. Maintainers are therefore told they are testing a published boot package when they are testing a local build.
The documentation rule requires updates in the same PR when documented operator behavior changes. Update the rehearsal section to include the local boot package.
**Rule Used:** When a PR changes user-visible or operator-visible behavior documented in README.md, docs/**/*.md, builder/qualcomm/README.md, or test/fake-pci.md, update the doc in the same PR. When README.md or a file under docs/**/*.md is added, moved, or removed... ([source](https://github.com/omacom/omarchy-iso/blob/667d29757d62f84d1db10ae61e4b94cc8464813f/.greptile/config.json))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
UEFI installs now boot systemd-boot, the boot loader Secure Boot needs. BIOS installs keep Limine, because systemd-boot can't start on BIOS firmware. This builds on omacom/omarchy#19667 (
omarchy-boot-switch install, factory reset of such an install) and omacom/omarchy-pkgs#3202 (omarchy-boot-systemd).How an install boots
The root image is unchanged: it still carries Limine's stack (
omarchy-booton x86_64, Limine's packages by name on aarch64). On UEFI the installer:omarchy-boot-systemdfrom the offline mirror while the deferred boot hooks are masked. It runspacman --root … --ask=4so pacman removes the conflicting packages, then removeslimineitself.EFI/systemd/and registers an "Omarchy Boot" entry first inBootOrder, withBootNext. This is the same registration code Limine uses, with the label passed in. A removable install writes onlyEFI/BOOT/BOOT*.EFI./etc/kernel/cmdlineafter the usual normalisation (rd.luks.*, console). The aarch64 console parameters go to/etc/cmdline.d/. Nothing is written to/etc/default/limineorlimine.conf.omarchy-boot-switch install --no-efi-registerin the target. It is called with--no-fallbackon a shared ESP the install doesn't own, and--preferfor a selected kernel. It builds and verifies the boot images exactly as a factory reset of this install will.validate_bootchecks:loader.confare on the ESP;root=(andcryptdevice=when encrypted);An encrypted deferred-provisioning install's unlock goes in
/etc/cmdline.d/99-omarchy-provisioning-unlock.conf, which the factory snapshot scrubs.OMARCHY_ISO_BOOT_LOADER=liminekeeps a UEFI install on Limine. So does an ISO whose mirror has noomarchy-boot-systemd.The pre-built UKI is Limine's fast path and isn't used on systemd-boot. The boot images carry Omarchy's snapshot and restore hooks, so they are built on the machine.
Building the ISO
--local-sourcealso buildsomarchy-bootandomarchy-boot-systemd(aarch64: only the latter) from a pkgs checkout that has them.omarchy-boot-systemdconflicts with the image's stack, so it is resolved in a transaction of its own. It is kept in the mirror and shipped, along with what it adds to the image (systemd-ukify).Tested
An ISO built with
--local-sourcefrom both branches, run throughtest/integration:firmware-boot. systemd-boot on the ESP, "Omarchy Boot" first inBootOrder, systemd-boot started the boot, and the boot store is mounted with the switch active.hibernate. Hibernate and resume work.full-nvram. The firmware refuses the entry, and the install boots from the fallback loader.factory-reset, now with a systemd-boot branch. Windows' payload and other systems' UKIs survive, and the old owner's boot images are gone. First-boot provisioning completes with a new machine identity that owns fresh boot images and a fresh boot store, and systemd-boot starts it./runand pinned the next root, and an active recreated swapfile.firmware-boot. Limine's BIOS stage and MBR boot code, as before../test/all. The Python tests (470) and every shell unit test pass, apart fromnightly-test.sh, which fails the same way onquattro. There's a newtest_systemd_boot_install.py.Not tested: aarch64 installs on hardware (Snapdragon, N1x, GB10). They take the same path with the aa64 loader, but none has been booted.
Screenshots
From an encrypted UEFI install of an ISO built from these branches:
Codex review (xhigh)
A Codex review found that an unencrypted install into free space mounts its ESP at
/efi, whereomarchy-boot-switch installdidn't look. The installer now passes the ESP it mounted, and the runtime finds/efion its own after that (omarchy#19667).🤖 Generated with Claude Code