From ef4b65f1dd9fe0ff0df8035d9ef39df18c184c88 Mon Sep 17 00:00:00 2001 From: Ben Copeland Date: Thu, 21 May 2026 11:24:34 +0100 Subject: [PATCH] rootfs: strip: don't let apt cascade-purge the Python stack on trixie In Debian trixie python3.13 and libpython3.13-stdlib Depends: tzdata, so the existing `apt-get remove --purge --yes tzdata` cascades and removes the whole Python stack (python3-tap, python3-yaml, asyncio stdlib...) from the crushed rootfs.cpio.gz. trixie-kselftest is the visible casualty: parse-output.py fails with `No module named 'tap'`. Use `dpkg --purge --force-depends` so only tzdata is removed. Size saving is unchanged; dpkg-state warnings are cleared when crush.sh purges dpkg itself. Signed-off-by: Ben Copeland --- config/rootfs/debos/scripts/strip.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/rootfs/debos/scripts/strip.sh b/config/rootfs/debos/scripts/strip.sh index b2486797df..5fcd1113ee 100755 --- a/config/rootfs/debos/scripts/strip.sh +++ b/config/rootfs/debos/scripts/strip.sh @@ -16,11 +16,15 @@ export DEBIAN_FRONTEND=noninteractive exec 3>&- exec 4>&- -# Removing unused packages +# Removing unused packages. +# Use dpkg --purge --force-depends rather than apt-get remove --purge: +# in Debian trixie, python3.13 and libpython3.13-stdlib Depend: tzdata, +# so apt cascades the purge and drops the entire Python stack, which +# breaks rootfses that need python3-tap / python3-yaml / asyncio etc. for PACKAGE in ${PACKAGES_TO_REMOVE} do echo ${PACKAGE} - if ! apt-get remove --purge --yes "${PACKAGE}" + if ! dpkg --purge --force-depends "${PACKAGE}" then echo "WARNING: ${PACKAGE} isn't installed" fi