Skip to content

Apply package-owned device tree overlays to m1n1 stage 2 - #3

Merged
maralcbr merged 4 commits into
mainfrom
port/677-dtb-overlays
Oct 4, 2026
Merged

maralcbr merged 4 commits into
mainfrom
port/677-dtb-overlays

Conversation

@maralcbr

@maralcbr maralcbr commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Port of omacom/omarchy-mac#677 by @joshuaswarren (5 commits squashed), with packages/omarchy-mac/boot mapped to omarchy-mac-boot/. Co-authored commit; CI installs dtc.

A package can ship /usr/lib/omarchy-mac-boot/dtb-overlays/PREFIX/NAME.dtbo; update-m1n1 builds boot.bin from overlaid copies and the boot check rebuilds the same way, so update-verify no longer stops omarchy update (needed by the ANE driver). The boot check also accepts depmod-rewritten modules.* maps only when depmod reproduces them. See #677 for the full design.

Overlay location (owner decision): not the platform root, which omarchy-mac alone owns. omarchy-mac-boot ships /usr/lib/omarchy-mac-boot/dtb-overlays/ empty for any package to drop into (/usr/lib: architecture-specific binary data a tool reads, like /usr/lib/modules/*/dtbs and /usr/lib/firmware). The opt-in list is /etc/omarchy-mac-boot/dtb-overlays.opt-in. The pacman hook targets */*.dtbo there, so it fires on an overlay and not on this package's own directory. The README notes that the hook doesn't run in the transaction that first installs it.

Tested: in an ALARM aarch64 container (dtc 1.8.1) against runtime bf659459a, omarchy-mac-boot/test/all (222), omarchy-mac/test/all (86) and test/integration/all (50) pass. With real pacman: a dir-only upgrade of the owning package doesn't fire the hook; installing and removing an overlay package does; the directory stays owned. No overlays still leaves boot.bin byte-identical. The original PR was tested on an M1 MacBook Pro.

Recipe note: omarchy-mac-boot needs dtc in checkdepends. omarchy-ane-dkms (omacom/omarchy-pkgs#745) must install its overlays and opt-in key at the new paths.

A package can add a device tree node the kernel's device trees lack (the
ANE driver needs an apple,t*-ane node) without update-verify stopping
omarchy update. Overlays ship as
/usr/share/omarchy-platform/dtb-overlays/PREFIX/NAME.dtbo;
/etc/default/update-m1n1 sources lib/dtb-overlays.sh so DTBS names overlaid
copies in /run, leaving the kernel's files and its mtree intact. An overlay
can skip a tree that already has the node, or wait for the owner's opt-in.
The boot check applies the same overlays when it rebuilds boot.bin, and
accepts depmod-rewritten modules.* maps only when depmod reproduces them.
A pacman hook reruns update-m1n1 when an overlay changes. CI installs dtc.

Ported from omacom/omarchy-mac#677 (5 commits) with paths mapped to this
repository.

Co-authored-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@maralcbr
maralcbr requested a review from scottjones as a code owner October 4, 2026 02:07
The platform root /usr/share/omarchy-platform belongs to the single
platform package and holds only what Omarchy reads, so overlays move to
/usr/lib/omarchy-mac-boot/dtb-overlays/PREFIX/NAME.dtbo, which
omarchy-mac-boot ships empty for any package to drop into. /usr/lib
because an overlay is architecture-specific binary data a tool reads, like
the kernel's device trees and firmware. The opt-in list moves with it to
/etc/omarchy-mac-boot/dtb-overlays.opt-in.

The pacman hook targets */*.dtbo under that directory, so it fires on an
overlay and never on the package's own directory. The README notes that
the hook does not run in the transaction that first installs it.
update-m1n1 builds an administrator's DTBS as given, without the
overlays, so the check now rebuilds it the same way and warns instead of
failing a boot.bin that matches. The locale test reads the defaults file
with OMARCHY_DTB_OVERLAYS=0, as the boot check does, so a host's own
overlays stay out of it.
@maralcbr

maralcbr commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

Second review: no blockers. Fixed two verified findings in 7d6fec8: the boot check now leaves overlays out when the administrator sets DTBS (as update-m1n1 does), and the locale test no longer reads a host's own overlays. Suites green in CI and in an ALARM container (boot 221 ok, integration 50).

@maralcbr
maralcbr merged commit 2a3ed89 into main Oct 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant