Repository navigation
Conversation
scottjones
left a comment
There was a problem hiding this comment.
Looks right to me. The hook now reads /etc/default/update-m1n1 with OMARCHY_DTB_OVERLAYS=0 (omarchy-mac-boot/files/usr/share/libalpm/scripts/omarchy-mac-retire-saved-modules:46), the same way the boot check already reads it (omarchy-mac-boot/bin/omarchy-apple-silicon-boot-check:606). An overlay's DTBS is built from the newest -ARCH tree, so it is still the default and shouldn't stop the hook. After the move, update-m1n1 runs later in the transaction with overlays live and picks the installed kernel's trees. The boot check rebuilds the same image with dtb_overlays_apply, so the two still agree.
On failure paths: an owner's own DTBS or M1N1_UPDATE_DISABLED still stops the hook. A config that turns overlays back on just keeps the old behaviour (modules kept, update-verify refuses the reboot), which is safe. Reading the config with overlays off also stops the hook from writing /run/omarchy-dtb-overlays. No version bump.
One small gap, not blocking: the staged test checks that the hook retires the modules when an overlay applies (omarchy-mac-boot/test/mac-saved-modules-test.sh:231), but it doesn't run update-m1n1 and update-verify afterwards with the overlay live. Only the Mac run covers that. A follow-up case that does would pin the "boot check agrees" part.
What I ran (PR merged onto main 1a865a9, x86_64 host, runtime pinned at 2fca7fe0):
omarchy-mac-boot/test/mac-saved-modules-test.sh: 9 ok.omarchy-mac-boot/test/all: 283 ok, 0 not ok.test/integration/all: 59 ok.check-scope,check-architecture-gates: exit 0.- Mutations, each reverted:
- Dropping
OMARCHY_DTB_OVERLAYS=0fails "a downgrade's saved modules move to .old when only a package-owned overlay sets DTBS". - Ignoring the owner's
DTBSfails "DTBS set in /etc/default/update-m1n1 is left alone". - Ignoring
M1N1_UPDATE_DISABLEDfails "m1n1 left to its owner is left alone".
- Dropping
…ys when retiring saved modules 11-omarchy-mac-saved-modules.hook retires the running kernel's saved modules after a downgrade only when update-m1n1 takes its device trees from the -ARCH default, so it reads /etc/default/update-m1n1 and stops when that sets DTBS. It read the file with the overlay call live. On a Mac with a package-owned overlay that applies, such as omarchy-ane, the call sets DTBS to the overlaid copies and writes them to /run/omarchy-dtb-overlays, so the hook took that for an owner's DTBS and kept the saved modules. update-m1n1 then built boot.bin from the running kernel's device trees, and update-verify refused the reboot. Read the configuration with OMARCHY_DTB_OVERLAYS=0, the switch dtb-overlays.sh offers for reading it without building anything, so only a DTBS the configuration sets itself counts. A configuration that re-enables overlays before their call can override this switch. If that call leaves DTBS set, the hook keeps the modules as before, and update-verify still refuses the reboot. The README says both beside the hook. The test stages the packaged configuration with an overlay that applies, and checks that an owner's DTBS or M1N1_UPDATE_DISABLED still stops the hook, set after the overlays, beside the switch, or in a branch on sourcing the library.
fcaeb5d to
4597f0f
Compare
Problem
After a kernel downgrade,
11-omarchy-mac-saved-modules.hookmoves the running kernel's saved modules to/usr/lib/modules/.oldso m1n1 gets the installed kernel's device trees, unless/etc/default/update-m1n1setsDTBSorM1N1_UPDATE_DISABLED.It read that file with the overlay call live, so a package-owned overlay that applies, such as omarchy-ane's, kept the modules and update-verify refused the reboot.
Change
The hook reads it with
OMARCHY_DTB_OVERLAYS=0, the switchlib/dtb-overlays.shdocuments, so only aDTBSthe configuration sets itself stops it.Verification
An AI agent ran every check; at each cold boot a person states they pressed power and typed the disk password.
Setup. Apple M1 test Mac (
t8103), Omarchy stable, kernel7.2.11.aurora14-1, a test overlay package (details below).Steps. Install the package → downgrade
linux-aurorato7.2.11.aurora13-1→update-verify→ if it passes, power off and cold boot.Before,
28abebe:After,
fcaeb5dmerged with main, then its cold boot:Re-check on main 95b0dd9: main plus the new test fails; 4597f0f (fcaeb5d re-signed, same tree) and its merge pass;
test/integration/all59 ok.Links. regression test, #3, #13.
Not shown
Prior PRs
None make this fix. maralcbr's #3 added the overlays and the switch; joshuaswarren's open #13 keeps it and leaves this hook alone.
Unedited full runs and detail
The Mac run. No shipped overlay applies on the test Mac, so the run installed a test package that ships one overlay through the same
/usr/lib/omarchy-mac-boot/dtb-overlayspath. It differs from a real one in one thing: it adds an inert root property instead of hardware nodes. It is not omarchy-ane. Kernel7.2.11.aurora13-1is an older edge build used only as a downgrade target.omarchy-mac-boot 20261109-1, built from main28abebe. After:20261114-2, built fromfcaeb5dmerged with main28abebe(tree339dd8e). The two packages differ only by this change and the recorded source revision.DTBSthat includes/run/omarchy-dtb-overlays/t8103-*.dtbcopies; reading it withOMARCHY_DTB_OVERLAYS=0gives[]. Both boot checks passed, and a cold boot on kernel 14 came up with the test property..old, then removed, thenupdate-m1n1). The kernel then went back to 14 with both boot checks passing and the sameboot.binas the earlier cold boot. The after run's module state:df02152, the merge offcaeb5dinto28abebe: four green checks, the new test's casesok,test/integration/all59 ok.cf3bff2, the merge of4597f0finto95b0dd9: four green checks.The system will power off now!in the previous boot's journal), after which the person at the Mac states they pressed the power button and typed the disk password. The disk's only unlock is one passphrase keyslot (no token, no network unlock in the initramfs), and each boot's journal shows the passphrase prompt before the unlock. The after run's boot came up on7.2.11-13-1-ARCHwith no failed units, and SSH returned on its own. The Mac then went back to the released package and kernel 14. Its first boot there is not counted (its timing could not be tied to the press); a repeat cold boot passed both boot checks; its kernel started 77–79 s after the previous boot's journal ended.update-verifyblocks start below its coloured heading line,Verify the Apple Silicon boot files.Staged test (fixture root, stubbed tools): regression cover, not a Mac run.
/etc/default/update-m1n1, pointed at the package's reallib/dtb-overlays.sh, and one overlay that applies to the running kernel's t6000 device tree.uname,pacman,rsync,dtc,fdtoverlayandfdtgetare stubs. update-m1n1's pacman hook is a test function that buildsboot.binfrom the newest-ARCHtree. update-verify is the package's own entrypoint, run against the fixture root.DTBSfrom the overlay, so the new cases cannot pass on an overlay that does nothing. It checks that reading the configuration writes nothing to/run/omarchy-dtb-overlays, and that an owner'sDTBSorM1N1_UPDATE_DISABLEDstill stops the hook: set after the overlays, on the line that sets the switch, or in a branch on sourcing the library.OMARCHY_DTB_OVERLAYSitself.omarchy-mac-boot/test/all(runtime at omacom/omarchy 81fd2d2,shas bash, as in CI's Arch container): 266 ok on main 28abebe, 268 on fcaeb5d and 269 on the merged tree, 0 not ok. The candidate's base lacks main'sfail-reason-test.sh. Run from a copy of the package directory alone, with no runtime: 268 ok on fcaeb5d, with 1 skip that needs the runtime.shis dash, each suite file run on its own gives the same result on main 28abebe, fcaeb5d and the merged tree. Onlyupdate-m1n1-locale-test.shfails, on all three, becauseshis dash (omarchy-mac-boot: run the update-m1n1 locale test under bash, as on a Mac #117). Run whole with dashsh,test/allon fcaeb5d stops at that file, exit 1.shellcheck -S warningon fcaeb5d: the hook is clean, and the test has only the three SC2154 warnings main's copy has.check-scope,check-architecture-gatesandcheck-fixture-driftexit 0.check-fixture-driftwarns that upstream's fixture copies of two drop-ins differ; this change touches no drop-in.test/integration/allstill ran (above and below). Not reached:OMARCHY_DISPOSABLE_BOOT_TESTS=1builds initramfs images and loop-device disks, which this change does not touch.shas bash, runtime at main's pin omacom/omarchy 2fca7fe:mac-saved-modules-test.shon main with only the new test added stops at the first new case, exit 1 (same output as on 28abebe); 9 ok on 4597f0f and on its merge with 95b0dd9 (tree09f8096). On the merge,omarchy-mac-boot/test/all284 ok andtest/integration/all59 ok, 0 not ok;check-scope,check-architecture-gates,check-version-bumpandcheck-fixture-driftexit 0 (the same drift warning); shellcheck shows main's three SC2154 warnings only. On 4597f0f with runtime 81fd2d2: 268 ok and 59 ok.omarchy-mac-boot/README.mdwith fcaeb5d's has no conflicts, so either can merge first.Before, main 28abebe with only the new test added:
After, fcaeb5d:
Merged tree, fcaeb5d merged with main 28abebe:
Generated with Claude Opus 5.5 in T3 Code Nightly