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
+3 -2
View File
@@ -58,10 +58,11 @@ install_packages "${PACKAGES[@]}"
sudo install -d -m 755 /etc/mkinitcpio.conf.d
echo 'MODULES+=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)' \
| sudo tee /etc/mkinitcpio.conf.d/nvidia.conf > /dev/null
sudo mkinitcpio -P
# Logged, so install.sh's check_initramfs tries again and explains if it fails
rebuild_initramfs || true
# GDM only offers Wayland on NVIDIA when these are enabled, since without them
# the GPU loses its memory contents across suspend
sudo systemctl enable nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service
echo "NVIDIA driver installed. Reboot to start using it."
initramfs_build_failed || echo "NVIDIA driver installed. Reboot to start using it."