From 5918185a3a417baa1062b775016b01e4d7f8fc22 Mon Sep 17 00:00:00 2001 From: Dorian Date: Wed, 25 Mar 2026 16:51:14 +0000 Subject: [PATCH] fix: use Debian 12 (Bookworm) live ISO base, remove squashfs boot artifacts The ISO build was using Debian 13 (Trixie) as the live installer base while the rootfs was built from Debian 12 (Bookworm). This caused: - Debian 13 kernel/hostname/user in the live environment - Squashfs errors on reboot from live-boot initramfs hooks Fixes: - Pin live ISO to Debian 12.10.0 (archive URL) - Remove live-boot/live-config packages before initramfs regeneration - Clean out any live-boot initramfs hooks/scripts from installed rootfs Co-Authored-By: Claude Opus 4.6 (1M context) --- image-recipe/build-auto-installer-iso.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/image-recipe/build-auto-installer-iso.sh b/image-recipe/build-auto-installer-iso.sh index 42a5a376..d8f88989 100755 --- a/image-recipe/build-auto-installer-iso.sh +++ b/image-recipe/build-auto-installer-iso.sh @@ -391,7 +391,7 @@ echo "📦 Step 2: Creating installer environment..." # Download Debian Live as our installer base BASE_ISO="$WORK_DIR/debian-live-installer.iso" -EXPECTED_SIZE=1500000000 # ~1.5GB min (Debian 13 Live standard ~1.9GB) +EXPECTED_SIZE=350000000 # ~350MB min (Debian 12 Live standard ~600MB) # Check if file exists and is complete if [ -f "$BASE_ISO" ]; then @@ -410,7 +410,8 @@ if [ ! -f "$BASE_ISO" ]; then # Use wget without -O so --continue actually works # Download with the ugly SourceForge filename, then rename - ISO_URL="https://cdimage.debian.org/debian-cd/current-live/${DEB_ARCH}/iso-hybrid/debian-live-13.3.0-${DEB_ARCH}-standard.iso" + # Use Debian 12 (Bookworm) to match the rootfs — NOT Debian 13 (Trixie) + ISO_URL="https://cdimage.debian.org/cdimage/archive/12.10.0-live/${DEB_ARCH}/iso-hybrid/debian-live-12.10.0-${DEB_ARCH}-standard.iso" if command -v wget >/dev/null 2>&1; then cd "$WORK_DIR" @@ -425,8 +426,8 @@ if [ ! -f "$BASE_ISO" ]; then # Find the downloaded file (wget creates it with a name like "download" or the actual filename) if [ -f "download" ]; then mv "download" "$BASE_ISO" - elif [ -f "debian-live-13.3.0-${DEB_ARCH}-standard.iso" ]; then - mv "debian-live-13.3.0-${DEB_ARCH}-standard.iso" "$BASE_ISO" + elif [ -f "debian-live-12.10.0-${DEB_ARCH}-standard.iso" ]; then + mv "debian-live-12.10.0-${DEB_ARCH}-standard.iso" "$BASE_ISO" else echo " ❌ Downloaded file not found" exit 1 @@ -1494,6 +1495,14 @@ elif [ -n "${GRUB_BIOS_TARGET}" ]; then echo " Skipping Legacy BIOS bootloader (machine supports UEFI)" fi +# Remove any live-boot artifacts that could cause squashfs errors on boot +# These can sneak in from Docker base image or package dependencies +echo " Cleaning live-boot artifacts..." +chroot /mnt/target apt-get remove -y --purge live-boot live-boot-initramfs-tools live-config 2>/dev/null || true +rm -f /mnt/target/etc/initramfs-tools/conf.d/live-boot* 2>/dev/null || true +rm -f /mnt/target/usr/share/initramfs-tools/scripts/live* 2>/dev/null || true +rm -f /mnt/target/usr/share/initramfs-tools/hooks/live* 2>/dev/null || true + # Regenerate initramfs — the one from Docker export is corrupt/incomplete # (Docker builds have limited /proc, /sys, /dev so initramfs generation fails silently) echo " Regenerating initramfs..."