install.sh: don't start Docker on a kernel the install just replaced
If install.sh upgrades the kernel (Arch installed a few days earlier), the running kernel's modules are gone until a reboot, so Docker, which needs overlay, bridge and netfilter modules, fails to start and stops the install. Enable it either way, and start it only if the running kernel's modules are there; otherwise it starts after the reboot the install ends with. The smoketest found this building its installed image on a ten-day-old base image. Also have the smoketest's progress ticker show a log line with binary bytes in it, rather than grep's "binary file matches". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -242,7 +242,15 @@ echo "Configuring Bitwarden SSH agent..."
|
||||
# Group membership takes effect at next login (newgrp would start an interactive shell)
|
||||
sudo usermod -aG docker $USER
|
||||
sudo systemctl enable docker.service
|
||||
# Docker needs kernel modules (overlay, bridge, netfilter). If this install
|
||||
# upgraded the kernel, the running kernel's are gone until a reboot (as in
|
||||
# updates.d/99-reboot-check.sh), so Docker can't start yet: it starts after
|
||||
# the reboot the install ends with.
|
||||
if [ -d "/usr/lib/modules/$(uname -r)" ]; then
|
||||
sudo systemctl start docker.service
|
||||
else
|
||||
echo "Docker will start after you reboot: this install upgraded the kernel."
|
||||
fi
|
||||
|
||||
# Enable and start Tailscale daemon
|
||||
if ! systemctl is-enabled tailscaled &> /dev/null; then
|
||||
|
||||
@@ -163,7 +163,9 @@ run_in_vm() {
|
||||
progress_ticker() {
|
||||
local start=$SECONDS tick="${SMOKETEST_TICK:-60}" last
|
||||
while sleep "$tick" > /dev/null 2>&1 3>&-; do
|
||||
last="$(tail -c 4096 "$2" | tr '\r' '\n' | grep -v '^[[:space:]]*$' | tail -n 1 | cut -c 1-100)"
|
||||
# -a: a log can hold binary bytes (a progress bar's), and grep would
|
||||
# otherwise print "binary file matches" instead of the line
|
||||
last="$(tail -c 4096 "$2" | tr '\r' '\n' | grep -av '^[[:space:]]*$' | tail -n 1 | tr -cd '[:print:]' | cut -c 1-100)"
|
||||
echo " still running $1 ($(( (SECONDS - start) / 60 )) min)${last:+: $last}"
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user