From bb4ceab4520705ee389f85a96050d8ae62b8b627 Mon Sep 17 00:00:00 2001 From: Michael Chus Date: Thu, 5 Mar 2026 16:20:07 +0300 Subject: [PATCH] perf: cache apk packages between ISO builds Keep apks_* workdir sections so packages aren't re-downloaded on each build. Only non-apks sections (kernel, apkovl, final image) are cleaned to pick up changes. Co-Authored-By: Claude Sonnet 4.6 --- iso/builder/build-debug.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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.