diff --git a/iso/builder/build-debug.sh b/iso/builder/build-debug.sh index 59abaea..d68a1d4 100644 --- a/iso/builder/build-debug.sh +++ b/iso/builder/build-debug.sh @@ -98,8 +98,12 @@ cp "${BUILDER_DIR}/genapkovl-bee_debug.sh" "${HOME}/.mkimage/" # Export overlay dir so the profile script can find it regardless of SRCDIR. export BEE_OVERLAY_DIR="${OVERLAY_DIR}" -# Clean workdir so apkovl changes are always picked up (kernel/apks sections are re-cached). -rm -rf /var/tmp/bee-iso-work +# Clean workdir selectively: remove everything except apks cache so packages aren't re-downloaded. +# mkimage stores each section in a hash-named subdir; apks_* dirs contain downloaded packages. +if [ -d /var/tmp/bee-iso-work ]; then + find /var/tmp/bee-iso-work -maxdepth 1 -mindepth 1 \ + -not -name 'apks_*' -exec rm -rf {} + 2>/dev/null || true +fi # Run from /var/tmp to avoid git repo context conflicts and to ensure enough scratch space. # mkinitfs/update-kernel use TMPDIR for initramfs build; tmpfs /tmp is only ~1GB.