From d2d9121392319c4e544ca114d4eae271cc176a89 Mon Sep 17 00:00:00 2001 From: oxmc7769 Date: Thu, 5 Mar 2026 05:04:08 -0800 Subject: [PATCH] Confused... --- export-iso/03-finalise/01-run.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/export-iso/03-finalise/01-run.sh b/export-iso/03-finalise/01-run.sh index 683079e..52d1394 100644 --- a/export-iso/03-finalise/01-run.sh +++ b/export-iso/03-finalise/01-run.sh @@ -11,6 +11,11 @@ ISO_TEMP_DIR="${STAGE_WORK_DIR}/iso_temp" # Step 1: Generate initramfs. # Because live-boot-initramfs-tools is installed, the generated initrd will # include live-boot hooks that can find and mount the squashfs from the ISO. + +# Replace fstab placeholders so initramfs-tools doesn't warn about unknown fs type. +sed -i 's/ROOTDEV/LABEL=live-rootfs/g; s/BOOTDEV/LABEL=live-boot/g; s/EFIDEV/LABEL=live-efi/g' \ + "${ROOTFS_DIR}/etc/fstab" + on_chroot << EOF update-initramfs -k all -c if [ -x /etc/init.d/fake-hwclock ]; then @@ -42,9 +47,9 @@ mkdir -p "${ISO_TEMP_DIR}/boot/grub" mkdir -p "${ISO_TEMP_DIR}/live" mkdir -p "${ISO_TEMP_DIR}/EFI/boot" -# Copy kernel and initrd — prefer the vmlinuz symlink, fall back to the versioned file -VMLINUZ=$(readlink -f "${ROOTFS_DIR}/boot/vmlinuz" 2>/dev/null || ls "${ROOTFS_DIR}/boot/vmlinuz-"* 2>/dev/null | sort -V | tail -1) -INITRD=$(readlink -f "${ROOTFS_DIR}/boot/initrd.img" 2>/dev/null || ls "${ROOTFS_DIR}/boot/initrd.img-"* 2>/dev/null | sort -V | tail -1) +# Copy kernel and initrd — find the latest versioned files in /boot +VMLINUZ=$(find "${ROOTFS_DIR}/boot" -maxdepth 1 -name "vmlinuz-*" -type f | sort -V | tail -1) +INITRD=$(find "${ROOTFS_DIR}/boot" -maxdepth 1 -name "initrd.img-*" -type f | sort -V | tail -1) if [ -z "${VMLINUZ}" ] || [ ! -f "${VMLINUZ}" ]; then echo "ERROR: Could not find kernel in ${ROOTFS_DIR}/boot/"