Skip to content

Compose mkinitcpio HOOKS from an early per-platform baseline - #536

Merged
maralcbr merged 2 commits into
quattro-upstreamfrom
mac/15-mkinitcpio-hooks
Sep 25, 2026
Merged

maralcbr merged 2 commits into
quattro-upstreamfrom
mac/15-mkinitcpio-hooks

Conversation

@maralcbr

Copy link
Copy Markdown
Member

Ticket 15 of the Apple Silicon convergence plan. Stacked on #514 (mac/13-hw-platform), which adds omarchy-hw-platform.

omarchy_hooks.conf began with an unconditional HOOKS=(...). mkinitcpio sources drop-ins in name order, so it ran after numbered platform fragments (omarchy-mac-boot's 90- to 94-) and threw their hooks away. HOOKS now comes from a new 00-omarchy-hooks.conf, which sorts first and picks the platform's baseline with omarchy-hw-platform:

  • Apple Silicon gets the stock systemd line plus plymouth. omarchy-mac-boot's fragments already build on that line and add the Apple hooks (ticket 16).
  • x86, Qualcomm, generic aarch64, and machines without the detector (omarchy-settings without the runtime, as in the aarch64 ISO live environment) keep the same busybox line as before.
  • If the detector fails (contradictory identity), the build stops and no image is written.

omarchy_hooks.conf keeps the NVIDIA kms filter and the vconsole handling unchanged, and still sorts after nvidia.conf. Migration 1786605598 now sources the baseline first; without it, the migration would also have rebuilt hybrid systems.

Testing

  • New test/shell.d/mkinitcpio-hooks-test.sh composes the shipped drop-ins the way mkinitcpio does: mkinitcpio.conf plus the drop-ins in LC_ALL=C.UTF-8 sort -zVu order, sourced once. It covers:
    • the baseline on the apple-silicon, qualcomm, generic-aarch64 and x86 fixtures, and with no detector
    • a stopped build when the detector cannot place the machine
    • a 90- fragment's hooks surviving on every platform, also with the NVIDIA filter active
    • exact HOOKS/MODULES/FILES for existing x86 configurations: plain, NVIDIA-only, hybrid, NVIDIA without early nvidia_drm, NVIDIA with hibernation and a provisioning key, T2, SPI MacBook and Surface
  • nvidia-kms-hook-test.sh now starts from the baseline and covers the migration: it rebuilds an NVIDIA-only system and leaves a hybrid one alone. The hybrid case fails against the unfixed migration.
  • Old against new drop-ins on x86, outside the suite:
    • 588 configurations (2 mkinitcpio.conf lines × 7 drop-in sets × 6 PCI layouts × 7 vconsole.conf variants) gave identical HOOKS, MODULES and FILES.
    • Real mkinitcpio 42 images (-k none -S autodetect, detector in /usr/bin) for the plain, NVIDIA-only-with-resume and hybrid cases have identical contents apart from /buildconfig.
  • Apple: the new baseline plus omarchy-mac-boot's current 90- to 94- fragments gives the HOOKS mx-mac builds today: base systemd plymouth autodetect microcode modconf kms keyboard sd-vconsole block asahi omarchy-vendorfw omarchy-mac-encrypt sd-encrypt filesystems fsck.
  • ./test/all as a normal user in CI's Arch image (x86_64, emulated): 289 of 292 shell files pass.
    • hermes-remove is on CI's known-failure list.
    • config-test (a plocate PKGBUILD check against the local omarchy-pkgs checkout) and sleep-lock (a timing budget under emulation) fail the same way on the base commit.

Second review: the second-model review could not run (reviewer quota exhausted until 30 Sep) and must be rerun before merge. An independent review of the diff found no x86 regression for configurations Omarchy writes. Its fixes are in: a stricter contradiction test and a stale comment.

Known gaps and follow-ups

  • Hand-edited setups can change. A user who deleted the HOOKS= line from their own omarchy_hooks.conf (pacman keeps it as a backup file) now gets the baseline instead of mkinitcpio.conf's line. A user drop-in that sets HOOKS and sorts between 00- and omarchy_hooks.conf now takes effect instead of being overwritten.
  • Packaging: omarchy-settings should add etc/mkinitcpio.conf.d/00-omarchy-hooks.conf to backup. On aarch64 the package still strips mkinitcpio.conf.d until ticket 14, so the Apple branch does nothing there yet.
  • Apple images built on non-Apple hosts detect generic-aarch64 and get the busybox baseline until the image target manifest (ticket 24) feeds the detector.
  • Legacy quattro Macs unlocked by busybox encrypt and cryptdevice= must not get this settings package before their boot chain is switched (ticket 45). On Apple the baseline has no busybox encrypt.
  • Not run yet: the x86 encrypted-install VM on the x86 worker.

omarchy_hooks.conf assigned HOOKS outright and sorted after numbered
platform drop-ins, so their hooks were lost. 00-omarchy-hooks.conf now
sets the platform's baseline first and later drop-ins add to it. The
NVIDIA kms filter and vconsole handling stay in omarchy_hooks.conf, and
x86 keeps the same HOOKS, MODULES and FILES.
@maralcbr
maralcbr changed the base branch from mac/13-hw-platform to quattro-upstream September 25, 2026 10:49
@maralcbr
maralcbr merged commit 424cc20 into quattro-upstream Sep 25, 2026
5 checks passed
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.
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