Repository navigation
omarchy-mac-boot: deterministic m1n1 device-tree order, first boot via #528 - #541
Conversation
update-m1n1 concatenates the device trees in the order its unquoted $DTBS glob expands, which follows the locale of whoever runs it; pacman's hook inherits the caller's. On the M2 Max boot.bin was written in en_US order and checks that rebuilt it in C order reported a mismatch. omarchy-mac-boot now ships /etc/default/update-m1n1 exporting LC_ALL=C, so every rebuild is the same image.
An image update-m1n1 wrote before the C locale was pinned carries the same device trees in its caller's collation, and the check only rebuilt C and session order. When the C rebuild differs, the check now reads the device trees from the image's flattened device tree headers, requires exactly the expected ones, each as often, rebuilds in that order and compares again.
#528 queues every hardware step of an image build for the machine's first boot. Mac first boot now runs omarchy-provision-hardware after creating the package keyring instead of sourcing the Limine activation leaf itself, and omarchy-provision-hardware.service waits for first boot. The fresh-image deferred-steps token stays only as the initrd's conversion gate.
omarchy-provision-hardware does nothing without #528's build manifest, so an image from a builder that does not write one would finish first boot with no hardware setup and Limine never activated. A fresh image (its deferred-steps token present) now needs /var/lib/omarchy/image/target, or target.booted once an earlier attempt retired it; a reset root has no token and is unaffected.
A platform first boot that runs omarchy-provision-hardware while the service's start job waits would otherwise turn that job into a failure at the next daemon-reload. With the unit kept, the emptied queue skips it.
The drop-in now also skips omarchy-provision-hardware.service while first boot is pending, so nothing runs the queue before this Mac's keyring exists. A failed step names both logs, and the tests check that the hand-off runs before owner setup is staged.
The queue holds every hardware leaf, and some need the network, so a failed step on an offline first boot left the owner at the failure screen with no way to get online. The step now stays queued for omarchy-provision-hardware.service, which retries it after first boot and on later boots. A runtime without the command still stops first boot.
Also match the exact not-a-fresh-image message in the restored-queue case.
|
Ticket 64 is folded in here rather than opened as a separate PR. I pushed seven commits on top of
Tested at Second review: two independent rounds. They found the offline dead end, the Left open, since they are #528's design: the service has no network ordering, so an Apple step that needs the network may keep failing at early boot. Its non-zero exit also doesn't separate a broken image from a transient failure, so first boot can't tell them apart. |
groups=('omarchy-platform-apple-silicon') is the platform tag the pacman
platform guard reads (omacom/omarchy-mac#539); the package is not published
yet, so it carries the tag from its first build. The pin moves to 3a58abb5,
omacom/omarchy-mac#541 with #527's current head merged in.
… network up omarchy-provision-hardware exited 1 both when a queued step failed and when it refused to run at all (untrusted manifest or queue), so first boot handed off with no hardware setup in the second case. A failed step now exits 75 and first boot tolerates only that; anything else keeps it on its retry screen. What an offline first boot leaves queued is apple/pacman.sh's repository sync, ahead of the Limine activation, and the retry service ran before the network was up, so it could keep failing. The Mac drop-in now orders it after network-online.target.
network-online.target waits for nothing on Omarchy, which masks NetworkManager-wait-online.service, so ordering the retry after it still ran apple/pacman.sh's repository sync before Wi-Fi was up, and everything queued behind it (the Limine activation included) stayed undone. The drop-in now runs nm-online -s first, as first-run's Wi-Fi step does; with nothing to connect it returns at once.
Owner provisioning and its journal test take quattro-upstream's version, which already carries #540 and ticket 32. The dispatch contract keeps both sides; boot-rebuild stays optional until ticket 36, since the update path does not call it.
Ticket 09 of the Apple Silicon convergence plan: the
omarchy-mac-bootsource changes its notes ask for. The recipe is omacom/omarchy-pkgs#637, which pins this branch's head until aquattro-upstreammerge commit exists.Base is now
quattro-upstream, which has #527 and #528.quattro-upstreamis merged into this branch.boot.bin.update-m1n1concatenates device trees through an unquoted glob, soboot.binfollowed the locale of whatever ran the pacman transaction. On the M2 Max it was in en_US order, and checks that rebuilt it in C order reported a mismatch. The package now ships/etc/default/update-m1n1exportingLC_ALL=C.omarchy-provision-hardwareonce the keyring exists, instead of sourcing the Limine leaf itself, andomarchy-provision-hardware.servicewaits for first boot.mac-first-boot/deferred-stepsstays the initrd's conversion token. A fresh image (token present) now also needs Defer image hardware setup to the Mac's first boot #528's build manifest,/var/lib/omarchy/image/target(ortarget.bootedon a retry); without it first boot stops rather than finishing with no hardware setup and GRUB still in charge. The image builder has to write it (tickets 21/23/24). A reset root has no token and is unaffected.Testing
packages/omarchy-mac/boot/test/allin an Arch Linux ARM container as a non-root user: all 97 checks pass. New cases:update-m1n1's own steps under a real en_US.UTF-8 locale (without the file the caller's collation wins; with it C wins underLANGorLC_ALL; the file sets noupdate-m1n1input), the boot check accepting the expected device trees in any order and refusing a duplicate, a missing or foreign device tree or a different tail, the first-boot hand-off and drop-in, and a fresh image without a manifest. Each new check fails against the previous code (mutation runs).test/all) as a non-root user in the same container: 2 of 314 files fail (hermes-remove-test.sh, andsystem-sleep-ownership-migration-test.sh, which is flaky), both in Run the shell suites in CI for quattro-upstream #518's list. Land #503 with the review fixes and the gap-audit merge blockers #527's head fails the same two plusdesktop-entry-launch-test.sh.Follow-up for #528: first boot runs
omarchy-provision-hardwarewhile this drop-in holds the service's own start job queued, and its disarm deletes the unit file and reloads systemd, so the journal logs a failed start job for a unit that no longer exists. Nothing is degraded. Removing only the wants link (keeping the unit, whoseConditionPathExists=then skips it) would avoid it; that is #528's code, so it is not changed here.Second review: an independent review found that first boot would finish a fresh image with no hardware setup when the builder wrote no manifest (fixed, with a test), and the #528 follow-up above. The device-tree walk (truncated, garbage and oversized images, duplicate-content trees, a symlinked m1n1), the locale pin under
shand the unit ordering held up. The second-model review could not run today (usage limit) and still has to run before merge.Update (2026-09-25, Brisbane): merged #527's current head (
a279bffdc) into this branch. The only conflict wasdocs/file-layout.md; both paragraphs are kept, inquattro-upstream's order. Boot package suite: 97 checks pass. Runtimetest/allas a non-root user in an Arch Linux ARM container: onlyhermes-remove-test.shfails (known). The base fails that plus the flakysystem-sleep-ownership-migration-test.sh. The recipe, omacom/omarchy-pkgs#637, now pins3a58abb5. Second review of the merge, from a fresh-context reviewer on a different model, because the usual second-model reviewer was rate-limited: the conflict resolution is correct and no auto-merged file was silently combined. The usual reviewer's re-check is still owed.Update 2 (2026-09-25, Brisbane):
quattro-upstream(418159a3) into the branch. It now has Land #503 with the review fixes and the gap-audit merge blockers #527, Defer image hardware setup to the Mac's first boot #528, Compose mkinitcpio HOOKS from an early per-platform baseline #536 and Runtime settings profile and platform package lists #542. The only conflict wasdocs/file-layout.md. It keepsquattro-upstream's manifest and detector text plus this branch's "disables the service" and Mac hand-off sentences.quattro-upstream) found two first-boot defects, both fixed ind46c1bf0:omarchy-provision-hardwarefailed, including when it refused to run at all (an untrusted manifest or queue). A failed step now exits 75. First boot tolerates only that; any other failure keeps it on the retry screen.apple/pacman.sh's repository sync stays queued ahead of the Limine activation, and the retry service ran before the network was up. The Mac drop-in now orders it afternetwork-online.target.sh, factory-reset scrubbing and unit ordering.image-deferred-hardware-test.shchecks exit 75 for a failed step and 1 for a refused queue entry. Runtimetest/all(non-root, Arch Linux ARM): onlyhermes-remove-test.shfails, andquattro-upstreamfails it too, along with the flaky sleep-migration test.a09ee0ca), which has this branch at3a58abb5, before these fixes. The next pin goes through omarchy-mac-boot 20260925-3: re-pin to quattro-upstream f7ea7ecc omarchy-pkgs#641.