diff --git a/export-iso/01-set-sources/01-run.sh b/export-iso/01-set-sources/01-run.sh index cf783c5..9387751 100755 --- a/export-iso/01-set-sources/01-run.sh +++ b/export-iso/01-set-sources/01-run.sh @@ -1,6 +1,7 @@ #!/bin/bash -e rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" +rm -f "${ROOTFS_DIR}/etc/apt/sources.list.d/00-temp.list" find "${ROOTFS_DIR}/var/lib/apt/lists/" -type f -delete on_chroot << EOF apt-get update diff --git a/export-iso/03-finalise/01-run.sh b/export-iso/03-finalise/01-run.sh index 74a53b5..7710a4d 100755 --- a/export-iso/03-finalise/01-run.sh +++ b/export-iso/03-finalise/01-run.sh @@ -8,9 +8,20 @@ fi ISO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.iso" ISO_TEMP_DIR="${STAGE_WORK_DIR}/iso_temp" -# Step 1: 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" +FINAL_ISO_FILE="${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.iso" + +# Step 1: Rewrite fstab for the live environment. +# live-boot manages the root overlay via overlayfs — fstab root entry is unused at boot. +# Replace build-time placeholders so initramfs-tools fsck hook doesn't warn about unknown fs types. +cat > "${ROOTFS_DIR}/etc/fstab" << 'FSTABEOF' +# Live system fstab — root is managed by live-boot via overlayfs, not this file. +tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0 +FSTABEOF + +if [ -f "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" ]; then + sed -i 's/^update_initramfs=.*/update_initramfs=yes/' "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" + sed -i 's/^MODULES=.*/MODULES=dep/' "${ROOTFS_DIR}/etc/initramfs-tools/initramfs.conf" +fi # Step 2: Generate initramfs inside the chroot. # live-boot-initramfs-tools is installed so the initrd will include live-boot hooks. @@ -21,11 +32,6 @@ if [ -x /etc/init.d/fake-hwclock ]; then fi EOF -if [ -f "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" ]; then - sed -i 's/^update_initramfs=.*/update_initramfs=yes/' "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" - sed -i 's/^MODULES=.*/MODULES=dep/' "${ROOTFS_DIR}/etc/initramfs-tools/initramfs.conf" -fi - # Step 3: Assemble ISO directory structure mkdir -p "${ISO_TEMP_DIR}/boot/grub" mkdir -p "${ISO_TEMP_DIR}/live" @@ -80,6 +86,11 @@ mksquashfs "${ROOTFS_DIR}" "${ISO_TEMP_DIR}/live/filesystem.squashfs" \ -e tmp \ -e run +# Write filesystem metadata used by installers and live tools +du -sx --block-size=1 "${ROOTFS_DIR}" | cut -f1 > "${ISO_TEMP_DIR}/live/filesystem.size" +mkdir -p "${ISO_TEMP_DIR}/.disk" +echo "ChillcraftOS Trixie - $(date +%Y-%m-%d)" > "${ISO_TEMP_DIR}/.disk/info" + # Step 6: Build the ISO with grub-mkrescue (handles BIOS + UEFI automatically) grub-mkrescue \ --output="${ISO_FILE}" \ @@ -89,9 +100,8 @@ grub-mkrescue \ rm -rf "${ISO_TEMP_DIR}" -echo "Live ISO created at ${ISO_FILE}" - # Step 7: Deploy mkdir -p "${DEPLOY_DIR}" -rm -f "${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.iso" -cp "${ISO_FILE}" "${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.iso" +rm -f "${FINAL_ISO_FILE}" +cp "${ISO_FILE}" "${FINAL_ISO_FILE}" +echo "Live ISO created at ${FINAL_ISO_FILE}" \ No newline at end of file