Keep the running kernel's modules after a kernel upgrade
shellcheck / shellcheck (push) Successful in 48s

install.sh failed whenever its upgrade replaced the kernel (Arch installed
a few days earlier): pacman deletes the running kernel's modules, so Docker
and then the firewall couldn't load theirs. The smoketest found it.

kernel-modules-hook keeps them until the next reboot, and its cleanup
service removes them after. install.sh installs it with archlinux-keyring,
in a transaction of its own so its hooks run for the upgrade; packages.conf
lists it and the service, so update adds them to existing machines.

With the modules kept, a missing modules folder no longer means a newer
kernel was installed, so newer_kernel_installed (utils.sh) also counts a
folder no package owns, and the reboot check, version and finish-install
use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-26 18:41:50 -07:00
co-authored by Claude Opus 5.5
parent 6dfd62610a
commit 1e2581dcc5
9 changed files with 75 additions and 12 deletions
+10
View File
@@ -51,6 +51,16 @@ answer() {
not_called configure
}
@test "finish-install asks for a reboot when the running kernel's modules are only kernel-modules-hook's copy" {
export COREDESKTOP_MODULES_DIR="$BATS_TEST_TMPDIR/modules"
KERNEL=0.0.0-kept-by-hook
mkdir -p "$COREDESKTOP_MODULES_DIR/$KERNEL"
run bash "$REPO/system/finish-install.sh"
[ "$status" -eq 0 ]
[[ "$output" == *"A newer kernel has been installed. Reboot, then run: configure"* ]]
not_called configure
}
@test "finish-install says the install worked before offering configure" {
needs_modules
ITEMS="to do core Federated Core"