Merge pull request #637 from omacom/mac/09-omarchy-mac-boot

Add omarchy-mac-boot for aarch64 edge
This commit is contained in:
Marcelo Alcantara authored and GitHub committed 2026-09-25 23:23:59 +10:00
commit cd1ffe0f7e
4 files changed
+127

No files matched your search

@@ -0,0 +1 @@
{ "source": "local", "channels": ["edge"] }
+53
View File
@@ -0,0 +1,53 @@
# Maintainer: Marcelo Alcantara <maralc@gmail.com>
# Recipe from maralcbr/omarchy-pkgs asahi-quattro pkgbuilds/omarchy-mac-boot
# (20260921-10 at 0a55baeddecf59687c32b4bd4e1dee743605c183); the payload now
# builds from packages/omarchy-mac/boot in omacom/omarchy-mac.
pkgname=omarchy-mac-boot
# pkgver is the UTC commit date of _commit, so it sorts above the fork's
# 20260921-N. Reset pkgrel to 1 when pkgver changes; bump it to re-pin or
# rebuild on the same day.
pkgver=20260925
pkgrel=2
pkgdesc='Apple Silicon boot support for Omarchy: initramfs, in-place encryption, first boot and Limine activation'
arch=('aarch64')
groups=('omarchy-platform-apple-silicon')
url='https://github.com/omacom/omarchy-mac'
license=('MIT')
makedepends=('git')
provides=('omarchy-apple-boot' 'omarchy-first-boot')
conflicts=('omarchy-apple-boot' 'omarchy-first-boot')
replaces=('omarchy-apple-boot' 'omarchy-first-boot')
install=omarchy-mac-boot.install
# An exact omarchy-mac commit, never a branch.
_commit=a09ee0cadd8a78a774dab06eae2d6faa6a395255
source=("omarchy-mac::git+https://github.com/omacom/omarchy-mac.git#commit=${_commit}")
sha256sums=('45da7d2039a3196150fc4f7798210c5717dc9a0e9c0526de988759948f6f536f')
prepare() {
# Tests and staging must not be able to read the surrounding desktop source.
rm -rf "$srcdir/boot"
cp -a "$srcdir/omarchy-mac/packages/omarchy-mac/boot" "$srcdir/boot"
[[ $(git -C "$srcdir/omarchy-mac" rev-parse HEAD) == "$_commit" ]]
[[ $(TZ=UTC0 git -C "$srcdir/omarchy-mac" show -s --format=%cd --date=format-local:%Y%m%d HEAD) == "$pkgver" ]]
}
check() {
"$srcdir/boot/test/all"
}
package() {
# Runtime-only, so the builder stages and tests the payload without the
# desktop or a boot chain. 1.39.0-2 is the first limine-mkinitcpio-hook that
# leaves a Mac's /boot to mkinitcpio until Limine is activated.
depends=('omarchy' 'limine' 'limine-mkinitcpio-hook>=1.39.0-2' 'limine-snapper-sync' 'asahi-scripts'
'bash' 'btrfs-progs' 'coreutils' 'cpio' 'cryptsetup' 'diffutils' 'gawk' 'gnupg' 'grep' 'gum'
'gzip' 'kbd' 'mkinitcpio' 'sed' 'systemd' 'util-linux')
"$srcdir/boot/install" "$pkgdir"
printf '%s\n' "$_commit" | install -Dm644 /dev/stdin "$pkgdir/usr/share/omarchy-mac/boot-source-revision"
# Administrator-editable: every /etc path and the initramfs helpers an image
# may rewrite.
mapfile -t backup < <(cd "$pkgdir" && find etc usr/lib/omarchy/initcpio -type f | sort)
}
+25
View File
@@ -0,0 +1,25 @@
# omarchy-mac-boot
Apple Silicon boot support for Omarchy: the Mac mkinitcpio drop-ins and initcpio hooks, in-place LUKS conversion in the initramfs, vendor firmware in early boot, first boot of a Mac image, the Limine activation gate and the boot check. The source is `packages/omarchy-mac/boot/` in omacom/omarchy-mac, with its own tests. The recipe pins an exact omarchy-mac commit, copies that directory away from the surrounding desktop tree in `prepare()`, runs its `test/all` in `check()` and stages the package with its `install` script. The recipe itself holds only metadata, `backup=` and the pacman scriptlet.
It follows the fork recipe in maralcbr/omarchy-pkgs (`asahi-quattro`, `pkgbuilds/omarchy-mac-boot` at 20260921-10), which carried the payload as files in the recipe.
## Scope
The package is aarch64-only and published to edge only. It widens to rc and stable only after M1 and M2 cold-boot qualification. It carries the Apple platform tag, `groups=('omarchy-platform-apple-silicon')`, which omarchy-settings' pacman platform guard uses to keep it off other machines once that guard ships (omacom/omarchy-mac#539, `docs/platform-guard.md`). Its only provides are the retired Apple-only names, and nothing generic depends on it or on them, so nothing generic can pull it onto non-Apple aarch64 machines. Its one Apple-only dependency, `asahi-scripts`, comes from the asahi-alarm repository that only the Apple profile configures.
It requires `limine-mkinitcpio-hook` 1.39.0-2 or newer: that is the first build whose hooks leave a Mac's `/boot` to mkinitcpio until Limine is activated. With an older hook, Limine's kernel hook replaces mkinitcpio's by name, and this package's `limine-ready` gate stops it on a Mac that still boots GRUB, so a kernel update would never reach `/boot`.
## Transition
- It provides, conflicts with and replaces `omarchy-apple-boot` and `omarchy-first-boot`. The scriptlet moves a pending `omarchy-first-boot` marker to `omarchy-mac-first-boot`, drops the replaced unit's dangling enable link and points at a customised `90-omarchy-asahi.conf.pacsave`.
- `pkgver` is the UTC commit date of the pin, so any pin from `20260925` on upgrades the fork's `20260921-10` on mx-mac Macs. The files the fork shipped that the source no longer does (the image finalize tools, the upstream ARM repository key and the GRUB snapshot-menu hook) are removed by that upgrade.
- `backup=` covers every `/etc` path and `/usr/lib/omarchy/initcpio`. It includes `/etc/default/update-m1n1`, which pins update-m1n1's device-tree order to the C locale. On a Mac that already has its own unowned copy, pacman keeps it and installs the shipped one as `.pacnew`.
## Updates
Updates are reviewed pins, never a branch:
1. Set `_commit` to the full omarchy-mac SHA and `pkgver` to its UTC commit date (`TZ=UTC0 git show -s --format=%cd --date=format-local:%Y%m%d <sha>`); `prepare()` checks both.
2. Reset `pkgrel` to 1 when `pkgver` changes; bump it for a second pin on the same date or a rebuild.
3. Refresh `sha256sums` with `makepkg -g`.
@@ -0,0 +1,48 @@
_omarchy_mac_boot_asahi_pacsave_notice() {
local pacsave=/etc/mkinitcpio.conf.d/90-omarchy-asahi.conf.pacsave
local shipped=/etc/mkinitcpio.conf.d/90-omarchy-mac.conf
[[ -f $pacsave && -f $shipped ]] || return 0
cmp -s "$pacsave" "$shipped" && return 0
cat <<EOF
==> omarchy-mac-boot: a customized 90-omarchy-asahi.conf was preserved as:
$pacsave
The active mkinitcpio drop-in is now:
$shipped
Merge any remaining local changes into the new file.
EOF
}
_omarchy_mac_boot_migrate_legacy_first_boot() {
local legacy=/var/lib/omarchy/first-boot/pending
local successor=/var/lib/omarchy/mac-first-boot/pending
[[ -e $legacy ]] || return 0
install -Dm644 /dev/null "$successor"
rm -f "$legacy"
systemctl --no-reload enable omarchy-mac-first-boot.service 2>/dev/null || {
install -d /etc/systemd/system/multi-user.target.wants
ln -sfr /usr/lib/systemd/system/omarchy-mac-first-boot.service \
/etc/systemd/system/multi-user.target.wants/omarchy-mac-first-boot.service
}
}
post_install() {
_omarchy_mac_boot_asahi_pacsave_notice
_omarchy_mac_boot_migrate_legacy_first_boot
_omarchy_mac_boot_drop_legacy_wants
}
_omarchy_mac_boot_drop_legacy_wants() {
# The replaced omarchy-first-boot left its preset-enabled link behind.
local link=/etc/systemd/system/multi-user.target.wants/omarchy-first-boot.service
[[ -L $link && ! -e $link ]] && rm -f "$link"
return 0
}
post_upgrade() {
_omarchy_mac_boot_asahi_pacsave_notice
_omarchy_mac_boot_migrate_legacy_first_boot
_omarchy_mac_boot_drop_legacy_wants
}