Files
omarchy-pkgs/pkgbuilds/linux-aarch64-pkgbase-shim
bf0af463ef Add linux-aarch64 kernel compatibility shim (#222)
* Add linux-aarch64-pkgbase-shim

Arch Linux ARM's kernel packages install the kernel as /boot/Image and ship
no usr/lib/modules/<ver>/{pkgbase,vmlinuz}, which is how mkinitcpio and
limine-entry-tool find kernels. One pacman hook, ordered 85- so it runs
before 90-mkinitcpio-install, writes both files into every package-owned
modules directory that lacks pkgbase; the usual hook then builds the UKI and
writes the Limine entry. It also covers kernels already present when the
shim itself is installed, cleans up the leftover directories of removed
kernels, and never touches a directory that has pkgbase, so it retires by
removal once archlinuxarm/PKGBUILDs#2215 (or its successor) lands.

Added to the aarch64 workflow's ISO package set.

* linux-aarch64-pkgbase-shim: leave the rebuild to limine-update when the 90 hook is masked

omarchy-iso's installer points 90-mkinitcpio-install.hook at /dev/null in
the target during the chroot phase and runs limine-update itself afterwards.
When the shim is installed in that phase it writes pkgbase and vmlinuz and
would otherwise start a UKI build that finalize_limine_boot throws away.

* linux-aarch64-pkgbase-shim: pkgrel 2

The aarch64 repo build only rebuilds packages whose version moved, so the
previous script fix never reached the repository.

* Trim aarch64 kernel shim comments

* Refresh shim kernel images safely on reinstall

* Run package regression suites in existing CI

* Cover shim ownership and failed-copy handling

* Handle shared kernel-directory ownership in the ARM boot shim

* Limit the CI change to the package test scripts

* Warn when a kernel directory's pkgbase names another package

---------

Co-authored-by: Jimmy Van Veen <jimmy.van.veen@gmail.com>
Co-authored-by: Jim Martin <jimmartin@gmail.com>
2026-10-09 10:21:04 -04:00
..

linux-aarch64-pkgbase-shim

Arch Linux ARM installs its kernel as /boot/Image instead of usr/lib/modules/<ver>/vmlinuz. Limine discovers the kernel through modules.builtin, but needs vmlinuz beside it to build a boot entry.

This package is one pacman hook. After a kernel package is installed or upgraded (usr/lib/modules/*/), and when the shim itself is installed, it writes into each package-owned modules directory without native kernel metadata:

  • pkgbase: compatibility metadata naming the package that owns the directory
  • vmlinuz: a copy of /boot/Image (the owner must own that too)

Reinstalling a kernel refreshes the shim's copy when the image changes, even if the module-directory version is unchanged. Package-owned files are preserved. When the kernel and its headers share ownership of the module directory, the shim uses the owner of /boot/Image, after confirming that it also owns the directory. Headers-package ownership alone does not qualify a directory.

It runs as 85-, before 90-mkinitcpio-install, so the usual hook then builds the initramfs/UKI and the Limine entry. If that hook would not run in the same transaction (the shim installed after the kernel, or a kernel package that does not touch usr/lib/initcpio/), the script runs limine-mkinitcpio-install itself. Leftover directories of removed kernels that hold nothing but these two files are cleaned up.

Retirement

Delete this package when linux-aarch64 ships vmlinuz in its kernel module directory. Package-owned metadata is never modified, so both approaches can coexist during the transition.