From 69c62eb47a42d0f503448a217321165c7465873b Mon Sep 17 00:00:00 2001 From: Dorian Date: Fri, 27 Mar 2026 19:08:00 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20boot=20chain=20=E2=80=94=20add=20live-bo?= =?UTF-8?q?ot,=20mount=20proc/sys/dev,=20fix=20kernel=20params?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first ISO build didn't boot. Three root causes: 1. No squashfs-as-root mechanism — the custom initramfs hook mounted boot media but had no way to use the squashfs as the root filesystem. Fix: add live-boot + live-boot-initramfs-tools to debootstrap includes. This is ~100KB and provides proven squashfs-as-root with overlayfs. 2. Broken initramfs — update-initramfs needs /proc, /sys, /dev mounted in the chroot to detect modules and generate a working initrd. Fix: bind-mount virtual filesystems before update-initramfs. 3. Missing kernel parameters — GRUB and ISOLINUX configs lacked boot=live components, so live-boot never activated. Fix: add boot=live components to all kernel command lines. Also: add all_video/efi_gop/efi_uga modules to GRUB EFI image for display output on real hardware, and update installer wrapper to check /run/live/medium first (where live-boot mounts the ISO). Co-Authored-By: Claude Opus 4.6 (1M context) --- image-recipe/build-auto-installer-iso.sh | 28 +++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/image-recipe/build-auto-installer-iso.sh b/image-recipe/build-auto-installer-iso.sh index 0b186e42..2b152717 100755 --- a/image-recipe/build-auto-installer-iso.sh +++ b/image-recipe/build-auto-installer-iso.sh @@ -461,6 +461,7 @@ debootstrap --variant=minbase --arch=${DEB_ARCH} \ kmod,procps,iproute2,ca-certificates,gdisk,\ cryptsetup,cryptsetup-initramfs,parted,dosfstools,e2fsprogs,\ linux-image-${DEB_ARCH},grub-efi-${DEB_ARCH},grub-pc-bin,\ +live-boot,live-boot-initramfs-tools,\ pciutils,usbutils,less,nano \ bookworm /installer http://deb.debian.org/debian @@ -514,7 +515,7 @@ echo " Automatic Installer" echo "" BOOT_MEDIA="" -for dev in /run/archiso /cdrom /media/cdrom /mnt/iso; do +for dev in /run/live/medium /lib/live/mount/medium /run/archiso /cdrom /media/cdrom /mnt/iso; do if [ -f "\$dev/archipelago/auto-install.sh" ]; then BOOT_MEDIA="\$dev" break @@ -529,7 +530,7 @@ if [ -n "\$BOOT_MEDIA" ]; then exec bash "\$BOOT_MEDIA/archipelago/auto-install.sh" else echo " Installer not found on boot media." - echo " Checked: /run/archiso, /cdrom, /media/cdrom, /mnt/iso" + echo " Checked: /run/live/medium, /run/archiso, /cdrom, /media/cdrom" echo "" echo " Dropping to shell for manual recovery..." exec /bin/bash @@ -594,10 +595,20 @@ KVER=$(ls /installer/lib/modules/ | sort -V | tail -1) echo " [container] Kernel version: $KVER" cp /installer/boot/vmlinuz-$KVER /output/vmlinuz -# Build initramfs with our custom hooks +# Mount virtual filesystems for proper initramfs generation +mount --bind /proc /installer/proc +mount --bind /sys /installer/sys +mount --bind /dev /installer/dev + +# Build initramfs with live-boot hooks + our custom hooks chroot /installer update-initramfs -c -k $KVER cp /installer/boot/initrd.img-$KVER /output/initrd.img +# Cleanup mounts +umount /installer/dev 2>/dev/null || true +umount /installer/sys 2>/dev/null || true +umount /installer/proc 2>/dev/null || true + # Create squashfs echo " [container] Creating installer squashfs..." mksquashfs /installer /output/filesystem.squashfs -comp xz -Xbcj x86 -noappend -quiet @@ -607,7 +618,8 @@ echo " [container] Building GRUB EFI image..." grub-mkimage -O x86_64-efi -o /output/BOOTX64.EFI -p /boot/grub \ part_gpt part_msdos fat iso9660 udf normal boot linux search \ search_fs_uuid search_fs_file search_label configfile echo cat \ - ls test true loopback gfxterm gfxmenu font png + ls test true loopback gfxterm gfxmenu font png all_video video \ + video_bochs video_cirrus efi_gop efi_uga # Create EFI FAT image (4MB) dd if=/dev/zero of=/output/efi.img bs=1M count=4 2>/dev/null @@ -2455,12 +2467,12 @@ else fi menuentry "Install Archipelago" --hotkey=i { - linux /live/vmlinuz quiet + linux /live/vmlinuz boot=live components quiet initrd /live/initrd.img } menuentry "Install Archipelago (verbose)" --hotkey=v { - linux /live/vmlinuz + linux /live/vmlinuz boot=live components initrd /live/initrd.img } @@ -2488,13 +2500,13 @@ DEFAULT install LABEL install MENU LABEL Install Archipelago KERNEL /live/vmlinuz - APPEND initrd=/live/initrd.img quiet + APPEND initrd=/live/initrd.img boot=live components quiet MENU DEFAULT LABEL install-verbose MENU LABEL Install Archipelago (verbose) KERNEL /live/vmlinuz - APPEND initrd=/live/initrd.img + APPEND initrd=/live/initrd.img boot=live components LABEL local MENU LABEL Boot from local disk