Repository navigation
test-kernel: run an upstream PR's kernel beside linux-aurora, once - #5
Conversation
…ot it once For testing upstream PRs on this machine, starting with omacom/linux-aurora #274's CI build (patch 1 on an M1). test-kernel install/boot/remove/list: - modules into /usr/lib/modules/<release>, refused if it exists; without the package's pkgbase (mkinitcpio's hook would treat the tree as linux-aurora and could copy it over /boot/vmlinuz-linux-aurora) and without its dtbs (boot.bin takes linux-aurora's); - /boot/vmlinuz-aurora-<name> and initramfs-aurora-<name>.img, and a GRUB entry from /etc/grub.d/43_aurora_test_<name>, never the default; - grub.cfg is rewritten only if the regenerated one differs by that entry's section alone, else left as it is with the difference shown; - boot uses grub-reboot (one restart only); remove refuses while running it and never deletes a module tree a package owns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
GRUB auto-discovery makes installation reject its own kernel, and a failed config write can silently damage the regular boot menu. Both issues need addressing before this is used on the laptop.
Reviewed changes Reviewed all four changed files with Bash syntax checks, ShellCheck, and isolated GRUB-regeneration tests; no live installation or boot was performed.
- Side-by-side installation: Adds named kernel installations with separate modules, kernel images, and initramfs files, excluding package metadata and device trees.
- Boot lifecycle: Generates custom GRUB entries, restricts config changes to one section, schedules one-shot boots, and removes kernels with running-release and package-ownership checks.
- Tool integration: Installs and uninstalls the helper and documents it in the repository layout.
gpt-6.1-sol | 𝕏
…safely Review on #5: - GRUB's 10_linux scans /boot/vmlinuz-* (and vmlinux-*, kernel-*, Image) on aarch64, so /boot/vmlinuz-aurora-<name> got a second, automatic entry and the section-only check rejected the tool's own install. Images now live in /boot/aurora-test/<name>/{vmlinuz,initramfs.img}, which nothing scans. - regen_grub runs in conditionals, where set -e doesn't apply, and copied straight over the live grub.cfg. Every step is now checked: grub-mkconfig writes a staged grub.cfg.test-kernel.new (and checks it itself), the current one is backed up, and the staged one is synced and renamed into place; any failure returns 1 with the live config untouched. - Install checks /boot (vfat, ~500 MB) has room for the kernel, an initramfs the size of the regular one and 32 MiB, before writing anything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Re-reviewed 0aa09a7 against the previous review at 1ded704, focusing on the GRUB safety fixes and new space check.
- Moved test images: Placed kernels and initramfs files under
/boot/aurora-test/<name>/, outside standard GRUB discovery paths, with matching menu and cleanup paths. - Staged GRUB updates: Replaced direct overwrites with checked generation, backup, sync, and rename operations that preserve the live config on failure.
- Added capacity preflight: Checked
/bootfree space against the kernel size, regular initramfs size, and a 32 MiB margin before installation writes.
Bash syntax checks, ShellCheck, and eight isolated GRUB-regeneration tests passed, including injected generation, backup, sync, and rename failures. No live installation or boot was performed.
gpt-6.1-sol | 𝕏

Why
We've committed to testing upstream aurora work on this MacBook. The first one: omacom/linux-aurora #274 asks for "an M1/M2 suspend for patch 1", and its CI built a ready package (
linux-aurora 7.2.11.aurora10-1.382, kernel release7.2.11-10-1.382-ARCH).Installing that with pacman would replace the regular kernel and fire the m1n1 hook, which rebuilds
boot.binwith the package's device trees.test-kernelinstalls it beside the regular kernel instead and boots it once.What
test-kernel install <pkg> <name> | boot <name> | remove <name> | list(run as root):/usr/lib/modules/<release>, refused if that release exists, so the installed linux-aurora can't be overwritten.pkgbaseis left out. mkinitcpio's pacman hook treats every module tree whose pkgbase islinux-auroraas linux-aurora, and could copy the test kernel over/boot/vmlinuz-linux-aurora.boot.bintakes linux-aurora's (/etc/default/update-m1n1). For #274's build,t6000-j314s.dtbis byte-identical to the installed one anyway./boot/aurora-test/<name>/, outside the names GRUB's10_linuxscans (/boot/vmlinuz-*,vmlinux-*,kernel-*,Image). So the only menu entry is the one from/etc/grub.d/43_aurora_test_<name>. It copies the regular entry's command line and is never the default. Install first checks that the ~500 MB vfat/boothas room.grub.cfgis replaced only if the regenerated one differs from the current one by that entry's section alone. Otherwise it's left untouched and the difference shown. The new config is staged beside it (grub.cfg.test-kernel.new), the current one is backed up (grub.cfg.test-kernel.bak), and then the staged one is synced and renamed into place. Every step is checked, so a failed write leaves the live config intact.bootusesgrub-reboot, so only the next restart takes the test kernel and every later one gets the regular kernel, including after a hard power-off.removerefuses while the test kernel is running, clears a pendingnext_entry, and never deletes a module tree a package owns.Tested (non-root parts)
Refuses to run unprivileged.
Release detection on #274's package gives
7.2.11-10-1.382-ARCH, with a clean exit under pipefail (an earlier| head -1was dropped for that reason).The command line copied from the live
grub.cfgmatches the regular entry.without_sectioncomparison on copies of the livegrub.cfg: a change only in the test section is accepted, and an extra change elsewhere (timeout) is refused.Failure injection on the real
regen_grub(throwaway files): a partial write with an error, an extra change, and a failed rename each return 1 with the live config byte-identical. A section-only change replaces it.Not run yet: an actual install (root),
grub-mkconfig, or a boot. That happens after review and merge.After merging
pkexec bash install.sh. Then:pkexec test-kernel install <#274 package> pr274, and when readypkexec test-kernel boot pr274and restart.🤖 Generated with Claude Code