Guard: bail out for reboot when -Syu replaced the running kernel's modules

This commit is contained in:
Gavin Nugent 2026-06-06 11:00:02 +01:00
parent 6578b1e4b8
commit 18e97e75ff

View file

@ -94,6 +94,18 @@ fi
step "1/8 · System updates & essential packages" step "1/8 · System updates & essential packages"
pacman -Syu --noconfirm pacman -Syu --noconfirm
# If -Syu upgraded the kernel, the running kernel's modules are gone and
# Docker can't load overlay/netfilter — reboot and re-run (script is
# safe to re-run; completed steps skip themselves)
if [ ! -d "/usr/lib/modules/$(uname -r)" ]; then
warn "Kernel was upgraded — running kernel $(uname -r) has no modules on disk."
warn "Reboot, then re-run this script:"
warn " reboot"
warn " bash arch-setup.sh"
exit 1
fi
# Minimal host package set — omaterm installs everything else it needs # Minimal host package set — omaterm installs everything else it needs
# (git, tmux, agents, tailscale all live inside its container) # (git, tmux, agents, tailscale all live inside its container)
pacman -S --noconfirm --needed \ pacman -S --noconfirm --needed \