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 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 16:20:07 +03:00
parent ec1a96976b
commit bb4ceab452

View File

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