From 03418e5d268238f7f7588968a020f945de0d4170 Mon Sep 17 00:00:00 2001 From: archipelago Date: Tue, 14 Jul 2026 05:28:32 -0400 Subject: [PATCH] fix(iso): installer always installs the canonical archipelago.service (B17 regression) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ISO's rootfs tar is a cached build artifact (currently 2026-04-20) and its baked-in archipelago.service predates the B17 fix — no RequiresMountsFor=/var/lib/archipelago — while auto-install.sh only copied the configs/ unit when the rootfs had none. Every fresh install therefore raced the LUKS data mount on cold boot and looped '[FAILED] Failed to start archipelago.service' for minutes (seen on the 1.7.99-alpha ISO). Ship configs/archipelago.service on the ISO at archipelago/configs/ and make the installer overwrite the rootfs copy unconditionally. Also add RequiresMountsFor to the legacy install-to-disk.sh inline unit. Co-Authored-By: Claude Fable 5 --- .../_archived/build-auto-installer-iso.sh | 23 +++++++++++++++---- .../archipelago-scripts/install-to-disk.sh | 3 +++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/image-recipe/_archived/build-auto-installer-iso.sh b/image-recipe/_archived/build-auto-installer-iso.sh index 9e88e2bf..abe90baa 100755 --- a/image-recipe/_archived/build-auto-installer-iso.sh +++ b/image-recipe/_archived/build-auto-installer-iso.sh @@ -1064,6 +1064,14 @@ echo " netavark + aardvark-dns: included in rootfs (Debian 13 packages)" echo " Including root filesystem..." cp "$ROOTFS_TAR" "$ARCH_DIR/rootfs.tar" +# Ship the canonical systemd unit on the ISO. The rootfs tar is a cached +# artifact that can predate unit fixes (B17: RequiresMountsFor on the data +# volume — without it fresh installs boot-loop "[FAILED]" until the LUKS +# mount lands), so the installer overwrites the rootfs copy with this one. +mkdir -p "$ARCH_DIR/configs" +cp "$SCRIPT_DIR/../configs/archipelago.service" "$ARCH_DIR/configs/archipelago.service" +echo " Using archipelago.service from configs/ (installer overrides rootfs copy)" + # Capture backend binary from live server if [ "$BUILD_FROM_SOURCE" = "1" ]; then echo " Building backend binary from source..." @@ -2662,11 +2670,16 @@ alias poweroff='sudo systemctl poweroff' ALIASES fi -# Systemd service: use the production version from rootfs (configs/archipelago.service) -# Do NOT overwrite — the rootfs already has the correct User=archipelago, no DEV_MODE version -if [ ! -f /mnt/target/etc/systemd/system/archipelago.service ]; then - echo " WARNING: archipelago.service missing from rootfs — copying from ISO" - cp "$BOOT_MEDIA/archipelago/../configs/archipelago.service" /mnt/target/etc/systemd/system/archipelago.service 2>/dev/null || true +# Systemd service: the canonical unit shipped on the ISO (archipelago/configs/) +# ALWAYS wins over the rootfs copy — the rootfs tar is a cached build artifact +# that can predate unit fixes (B17: without RequiresMountsFor=/var/lib/archipelago +# the service races the LUKS data mount on cold boot and "[FAILED]"-loops for +# minutes on every fresh install). +if [ -f "$BOOT_MEDIA/archipelago/configs/archipelago.service" ]; then + cp "$BOOT_MEDIA/archipelago/configs/archipelago.service" /mnt/target/etc/systemd/system/archipelago.service + echo " Installed archipelago.service from ISO configs (overrides rootfs copy)" +elif [ ! -f /mnt/target/etc/systemd/system/archipelago.service ]; then + echo " WARNING: archipelago.service missing from rootfs and ISO configs" fi # Claude API proxy — middleware that injects max_tokens, strips invalid fields diff --git a/image-recipe/archipelago-scripts/install-to-disk.sh b/image-recipe/archipelago-scripts/install-to-disk.sh index 25b13901..073f5eb4 100755 --- a/image-recipe/archipelago-scripts/install-to-disk.sh +++ b/image-recipe/archipelago-scripts/install-to-disk.sh @@ -325,6 +325,9 @@ PROFILE_EOF Description=Archipelago Backend Server After=network-online.target Wants=network-online.target +# Never start before the data volume (if one exists) is mounted — without this +# the service races the mount on cold boot and "[FAILED]"-loops until it lands (B17) +RequiresMountsFor=/var/lib/archipelago [Service] Type=simple