omarchy-settings: keep the Mac initramfs hooks on aarch64

Apple Silicon Macs install the aarch64 package too, and an unconditional
HOOKS= line would replace their asahi hooks. Apply Omarchy's HOOKS line only
when the incoming hooks lack asahi, in whichever drop-in carries it, and
rebuild omarchy-settings (4.0.4-3) so existing installs get the fix.
This commit is contained in:
Jim Martin committed 2026-09-27 09:08:49 -05:00
1 parent 9d05b3fb06
commit 21f3c4a8c4
3 files changed
+197 -2

No files matched your search

+16
View File
@@ -220,6 +220,22 @@ package() {
# Thunderbolt module request is x86-specific; ARM kernels lack the module
# and mkinitcpio treats a missing explicit module as an error.
rm -f "$pkgdir/etc/mkinitcpio.conf.d/thunderbolt_module.conf"
# Apple Silicon Macs install this package too. Their initramfs needs the
# asahi hook, which omarchy-mac-boot's 90-94 fragments (Aurora) or
# mkinitcpio.conf (legacy GRUB Macs) set, and an unconditional HOOKS= here
# would replace it. Omarchy's line applies only when the hooks loaded so far
# lack asahi. The check reads configuration, not the running machine, so it
# also holds when the image is built in a chroot.
local hooks_conf guarded=0
for hooks_conf in "$pkgdir"/etc/mkinitcpio.conf.d/{00-omarchy-hooks,omarchy_hooks}.conf; do
[[ -f $hooks_conf ]] && grep -q '^HOOKS=(' "$hooks_conf" || continue
sed -i 's/^\(HOOKS=(.*)\)$/if [[ " ${HOOKS[*]:-} " != *" asahi "* ]]; then\n \1\nfi/' "$hooks_conf"
guarded=1
done
if (( ! guarded )); then
echo "No HOOKS= line to guard for Apple Silicon in etc/mkinitcpio.conf.d" >&2
return 1
fi
# Memory stack: no zram device or zswap on the aarch64 install, and
# systemd-oomd is not enabled there, so the vm.* reclaim tuning written
# for zram would be wrong for it. Keep only the network tuning.