Repository navigation
Defer image hardware setup to the Mac's first boot - #528
Merged
Merged
Conversation
An image is built away from the Mac it will run on, so its hardware leaves would probe the builder. A root-owned manifest at /var/lib/omarchy/image/target now marks the build: hardware setup queues every leaf instead of running it and arms omarchy-provision-hardware.service, which runs the queue on the first boot, resumes after a failed step, rebuilds the initramfs when a step changed it, and disarms itself. Root ignores any environment override of these paths.
maralcbr
changed the base branch from
mac/13-hw-platform
to
quattro-upstream
September 25, 2026 09:44
# Conflicts: # docs/file-layout.md
maralcbr
added a commit
that referenced
this pull request
Sep 25, 2026
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.
This was referenced Sep 25, 2026
# Conflicts: # docs/file-layout.md
maralcbr
added a commit
that referenced
this pull request
Sep 25, 2026
Brings in the runtime profile and composed package lists (#542), the platform mkinitcpio baseline (#536) and deferred first-boot setup (#528). The Apple package list is #542's with omarchy-mac-boot after omarchy-mac. The boot package's 90-94 drop-ins now sort after 00-omarchy-hooks.conf; a new test composes the real baseline with them on an Apple Silicon fixture: the encrypted systemd image gets asahi, omarchy-vendorfw, omarchy-mac-encrypt and sd-encrypt once, a non-Latin layout stays out, and a legacy busybox encrypt line is left as its owner set it up.
maralcbr
added a commit
that referenced
this pull request
Sep 25, 2026
omarchy-mac-boot: deterministic m1n1 device-tree order, first boot via #528
This was referenced Sep 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket 41 (deferred first-session setup). Stacked on #514 (
mac/13-hw-platform).An image is built in a chroot away from the Mac it will run on, so running
install/hardware/all.shthere probes the builder (and, since #514, root ignoresOMARCHY_PROC_ROOT, so Apple leaves no-op in a build). This moves hardware setup of a prebuilt image to the machine's first boot, triggered by a root-owned image-target manifest instead of mx-mac'sOMARCHY_MAC_IMAGE_BUILD/OMARCHY_MAC_TARGETenvironment./var/lib/omarchy/image/target(format=1,platform=<omarchy-hw-platform value>, root:root, dir 0755, file 0644) beforeomarchy-apply-system. While it exists,omarchy-apply-hardwareruns no leaf: it queues everyrun_loggedleaf ofall.sh, in order, in/var/lib/omarchy/image/deferred-steps(oneinstall/hardware/...path per line, the mx-mac/omarchy-mac-boot format) and armsomarchy-provision-hardware.service.omarchy-provision-hardware: it renames the manifest totarget.booted, runs the queue with live platform detection, drops each step that succeeds, stops at a failed step (retried on the next boot), rebuilds the initramfs once if any step changed mkinitcpio inputs (baseline kept until the rebuild lands), then disarms itself. Rerunning does nothing.OMARCHY_IMAGE_ROOTis a non-root test fixture only.Interface for the other tickets
omarchy-mac-first-boot'sattempt, aftermake_keyring, replace the hard-codedsource install/hardware/apple/limine-boot.shwith/usr/bin/omarchy-provision-hardware(no arguments, root). Exit 0: nothing left. Non-zero: a step failed and stays queued; the next call resumes. Calls are serialised with the service. Also shipomarchy-provision-hardware.service.d/20-mac-first-boot.confwithAfter=omarchy-mac-first-boot.service, so the generic service never runs before the Mac keyring exists; it is then skipped because first boot drained the queue. Keepmac-first-boot/deferred-stepsonly as the initrd's fresh-image conversion token: do not switch the encrypt gate to/var/lib/omarchy/image/deferred-steps, because@factoryrestores that queue after a reset and would re-authorise conversion.omarchy-apply-systemand drop theOMARCHY_PROC_ROOTprobe for hardware setup. Keep/var/lib/omarchy/image/and the armed unit in@factory, so a factory-reset root reruns hardware setup on its first boot. Image inspection can requiretarget, a non-emptydeferred-stepsand the enabled unit; an installed machine showstarget.bootedand no queue. 24 owns the detector and config side:install/config/enable-services.shstill asks the detector during the build, and the detector should read the manifest only while it istarget, since first boot retires it before any step runs.Testing
test/shell.d/image-deferred-hardware-test.sh(22 checks, fixtures): the realall.shis queued in order with no leaf run and the unit armed; no manifest runs leaves as before; bad manifests (format, platform, malformed, writable, writable dir, symlink) refuse; fixture first boot runs each leaf once, retires the manifest, rebuilds once, disarms; rerun is a no-op; failure resumes at the failed step; a failed step that changed the initramfs still gets it rebuilt; a removed leaf is skipped; unsafe queue entries refuse; a waiting hardware setup decides only under the lock; namespaced root ignores the fixture root. Mutations of the root check, queue drain, manifest retire and lock each fail it.test/clias a non-root user in an Arch Linux ARM container: base (Add omarchy-hw-platform and gate Apple setup on it #514 head) and branch have the same 10 environment failures (missing ffmpeg, xkbcli, omarchy-pkgs checkout and similar); the new file passes;test/cliand the omarchy-mac package tests pass.Second review: three rounds. It found a rebuild lost when the changing step itself failed, a manifest check before the lock, a root-unsafe test and a missing flush before disarm; all fixed, final round clean.