Repository navigation
Add the package platform tag and a pacman platform guard - #539
Merged
Merged
Conversation
…latform
A package names its hardware platform with groups=('omarchy-platform-<platform>'),
readable from the repository databases. omarchy-settings ships a pre-transaction
hook that reads those tags for the transaction's packages and aborts when one
does not suit this machine. Image builds take the platform from a root-owned
manifest in the chroot; a booted system always asks its hardware.
A hook arriving in the same transaction as a package does not check it, so hardware setup first requires the guard from omarchy-settings and checks the packages an installer already placed. Nothing in system setup before it installs packages.
Every command asks the Apple predicate before acting and every unit carries an ExecCondition; a package test now keeps it that way. The setup contract installs the add-on after the settings package on a fresh install, so the platform guard checks it.
Hooks inherit pacman's environment. An exported awk function, a bad TAR_READER_OPTIONS or a tiny TMOUT made the guard read no tags and let a tagged package through, so root now runs it in privileged mode and restarts it in an empty environment. A PID 1 whose root cannot be compared no longer counts as an image build, and --platform lets the root probe check that the platform ignores fixtures too.
The guard asks omarchy-hw-platform, which only omarchy shipped, so a transaction installing omarchy with a tagged package after the settings package would refuse it for want of a detector. omarchy-settings now ships the detector too, and a refusal in a chroot without a manifest points the builder at it. The contract doc now states builder and VM requirements as requirements, and the tests require a real refusal rather than any failure.
Moving omarchy-hw-platform into omarchy-settings loses the file when the dev pair installs in separate transactions, since omarchy-dev does not pin omarchy-settings-dev's version. The settings package now ships a copy beside the guard script and omarchy keeps its detector, so no file changes owner. The builder hint no longer claims the hardware decided, and the install-order check also catches pacman options that take a value.
maralcbr
changed the base branch from
mac/13-hw-platform
to
quattro-upstream
September 25, 2026 10:46
…ly where platform packages exist The guard now reads /var/lib/omarchy/image/target by the rules of install/helpers/image-target.sh (format=1, platform=, trusted directory and file) instead of a manifest of its own. Hardware setup without a resident guard fails only on Apple Silicon and Qualcomm; elsewhere it logs and goes on, so an older unversioned settings-dev cannot stop an x86 install. The Mac setup contract states the two-transaction rule, and the package test covers the commands and helpers that ask omarchy-hw-platform directly.
maralcbr
added a commit
to omacom/omarchy-pkgs
that referenced
this pull request
Sep 25, 2026
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.
This was referenced Sep 25, 2026
…atform-guard # Conflicts: # packages/omarchy-mac/README.md
Since the detector takes the manifest whenever systemd is not PID 1 or the root has no /run/systemd/system, the guard's own booted check follows the same root, and the fixtures model a booted machine the way the detector reads one.
…pawn container asks the host
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 17 of the Apple Silicon convergence plan. Base
quattro-upstream. The recipe half, omacom/omarchy-pkgs#636, is merged: the settings recipes install the guard files when their source has them. The published omarchy-settings 4.0.4-2 is built from the pinned v4.0.4 source, so it carries no guard yet; builds from a quattro-upstream commit after this PR will.What changed
docs/platform-guard.md): a platform package declaresgroups=('omarchy-platform-<platform>'),<platform>being whatomarchy-hw-platformprints. Only platform-only names are tagged. On omarchy-pkgs master onlyomarchy-mac-bootcarries the tag so far;linux-aurora,m1n1-aurora,uboot-asahiandomarchy-macmerged without it and each needs the one-linegroups=addition.00-omarchy-platform-guard.hook(PreTransaction, Install/Upgrade,AbortOnFail) runsomarchy-platform-guard, which reads tags from/var/lib/pacman/sync/*.dband refuses tagged packages for another platform. Untagged transactions pass without asking the platform; unreadable databases are skipped. As root it restarts in an empty environment. omarchy-settings ships the hook, the guard and its own copy of the detector./proc, or PID 1 not systemd) takes the root-owned image manifest from Defer image hardware setup to the Mac's first boot #528 (/var/lib/omarchy/image/target).install/hardware/platform-guard.shis hardware setup's first step. On Apple Silicon and Qualcomm it fails when the guard isn't resident; elsewhere it logs and continues. With the guard present it audits installed packages. The omarchy-mac README keeps the two-transaction rule (settings first, thenomarchy-pkg-defaults apple-silicon).Refresh (2026-09-26)
omarchy-pkg-defaultswording)./, so the guard suite failed after the merge. The guard now compares with the transaction root too (no change as root, where that root is/), and the fixtures model a booted machine as the detector reads one. New cases cover a non-systemd PID 1 and a missing/run/systemd/system.tools/acceptance/mac-imageneeds no mask, since its guest device tree carries an Apple root compatible.Rollout and skew
omarchy-provision-hardwareexits 75, whichomarchy-mac-first-boottreats as "retry later". It does hold every later hardware step (including the Limine step) until it passes. The candidate lane is ready: maralcbr/omarchy-pkgslab/22-candidate-set92e2f4f7 builds settings from Ship the Mac's app hooks and update takeover check for the step 6 seam #636's recipe (83f85a40). Itslab/buildnow refuses a set whoseomarchyships the guard step whileomarchy-settingslacks the hook, script or detector copy. The lane build passed (run 36216406464).omarchydepends onomarchy-settings=${pkgver}, so the pair moves together. Test images pin both with IgnorePkg, and removing the pin moves both to the stock 4.0.4 pair, which has neither the step nor the hook. The legacy conversion installs both in one transaction and runs no hardware setup. Snapdragons rundragon, which doesn't consume quattro-upstream. Only an unversioned dev pair built from different trees could hit it, and on a Mac that stops hardware setup by design.Testing
archlinux:base-develcontainer on an x86_64 host:test/allfails only the two files in.github/known-test-failures, so the check passes.config-test.shnow passes against omarchy-pkgs master with Ship the Mac's app hooks and update takeover check for the step 6 seam #636. The omarchy-mac package and boot package suites pass.platform-guard-test.shin an aarch64 Arch container: passes as a normal user and as root (root probes). Before the fix, the same file failed on "a booted system ignores an image manifest" in both the aarch64 and x86 runs.pacman -Uof a tagged file; untagged packages install.pacman -rchroot: refuses without a manifest, allows withplatform=apple-silicon, and refuses Qualcomm packages there.Second review: earlier rounds found an environment bypass, the detector missing before the runtime installs, a dev-pair file move, the manifest diverging from ticket 41, and x86 installs aborting without the guard; all were fixed. This round confirmed the guard change is behaviour-neutral as root and that the tests still prove their names. It found the candidate lane's stale settings recipe pin (documented above; the lane belongs to ticket 22) and one dropped doc caveat (restored). A later round on the 2026-09-26 head (after #568 and #571-#577) confirmed the rollout analysis: no new path runs hardware setup on existing installs, and the #571 mx-mac migration installs the pair together. Fable re-check owed on that last round.