From 8466cd14f08340441c648e307c85f2324265add6 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 19 Apr 2026 13:23:20 -0400 Subject: [PATCH] fix(iso): patch debootstrap for Trixie apt 3.0.3 tar dup-entry bug Debian Trixie apt 3.0.3's data.tar has duplicate entries for the same path (regular file + symlink at e.g. libapt-private.so.0.0), and tar bails on the second entry with "Cannot create symlink: File exists", failing debootstrap on the very first package. Patch debootstrap's tar invocation to use --skip-old-files so the duplicate is ignored. Was blocking every unbundled ISO rebuild since the Trixie apt bump. Co-Authored-By: Claude Opus 4.7 (1M context) --- image-recipe/build-auto-installer-iso.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/image-recipe/build-auto-installer-iso.sh b/image-recipe/build-auto-installer-iso.sh index becd3b5d..98844a15 100755 --- a/image-recipe/build-auto-installer-iso.sh +++ b/image-recipe/build-auto-installer-iso.sh @@ -667,6 +667,15 @@ apt-get update -qq apt-get install -y -qq debootstrap squashfs-tools initramfs-tools dosfstools mtools \ grub-efi-amd64-bin grub-pc-bin grub-common isolinux syslinux-common +# Patch debootstrap to tolerate duplicate tar entries. +# Debian Trixie apt 3.0.3 ships a data.tar with both a regular file +# and a symlink at the same path (e.g. libapt-private.so.0.0) which +# makes tar bail with "Cannot create symlink: File exists" on the +# very first package. --skip-old-files silently keeps the earlier +# entry, which is functionally equivalent. +sed -i "s|tar \\\$EXTRACT_DEB_TAR_OPTIONS -xf -|tar --skip-old-files \\\$EXTRACT_DEB_TAR_OPTIONS -xf -|g" /usr/share/debootstrap/functions +grep -q "skip-old-files" /usr/share/debootstrap/functions || { echo "FATAL: debootstrap patch did not take"; exit 1; } + echo " [container] Running debootstrap --variant=minbase..." # ifupdown + isc-dhcp-client added because live-boot's /init writes # /etc/network/interfaces on the target — without ifupdown, /etc/network/