Build a failed initramfs again, and don't offer a reboot until it builds

When mkinitcpio fails during an update or install, run it once more. If
that fails too, say why (a full /boot, a hook or module that isn't
installed) and don't offer a reboot. The install now logs its upgrade and
checks the build before finish-install offers one, and nvidia.sh's rebuild
no longer stops the install. A failed build is carried into the next
update's log, so it's rebuilt and checked until it builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 07:34:51 -07:00
co-authored by Claude Opus 5.5
parent 16e5a9c79d
commit d456e31192
8 changed files with 230 additions and 23 deletions
+26
View File
@@ -98,3 +98,29 @@ answer() {
[[ "$output" != *"Reboot now?"* ]]
not_called systemctl
}
@test "finish-install doesn't offer a reboot while the initramfs doesn't build" {
KERNEL=0.0.0-not-installed
mkdir -p "$HOME/.local/state/coredesktop"
printf '%s\n' "(3/4) Updating linux initcpios..." "==> ERROR: module not found: 'nvidia'" \
> "$HOME/.local/state/coredesktop/pacman-update.log"
stub systemctl
answer y
run bash "$REPO/system/finish-install.sh"
[ "$status" -eq 0 ]
[[ "$output" == *"CoreDesktop is installed."*"Don't reboot yet"*"Once it builds"* ]]
[[ "$output" != *"Reboot now?"* ]]
not_called systemctl
}
@test "finish-install still offers configure while the initramfs doesn't build, if the kernel is current" {
needs_modules
ITEMS="to do core Federated Core"
mkdir -p "$HOME/.local/state/coredesktop"
printf '%s\n' "(3/4) Updating linux initcpios..." "==> ERROR: module not found: 'nvidia'" \
> "$HOME/.local/state/coredesktop/pacman-update.log"
run bash "$REPO/system/finish-install.sh"
[ "$status" -eq 0 ]
[[ "$output" == *"Don't reboot yet"*"configure connects"* ]]
[[ "$output" != *"no reboot needed"* ]]
}