From 6dfd62610a7ef0296ae7ec79cd2ce0d6b83bd00e Mon Sep 17 00:00:00 2001 From: David Young Date: Thu, 26 Nov 2026 17:26:56 -0700 Subject: [PATCH] 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 --- install.sh | 10 +++++++++- smoketest/lib/scenario.sh | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index d992616..8657b7f 100755 --- a/install.sh +++ b/install.sh @@ -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 -sudo systemctl start 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 diff --git a/smoketest/lib/scenario.sh b/smoketest/lib/scenario.sh index 85ef55d..ab327e9 100644 --- a/smoketest/lib/scenario.sh +++ b/smoketest/lib/scenario.sh @@ -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 }