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) <noreply@anthropic.com>
This commit is contained in:
Dorian 2026-04-19 13:23:20 -04:00
parent 036db76773
commit 8466cd14f0

View File

@ -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/