diff --git a/iso/builder/auto/config b/iso/builder/auto/config index 1ce5d3e..060b887 100755 --- a/iso/builder/auto/config +++ b/iso/builder/auto/config @@ -34,4 +34,5 @@ lb config noauto \ --iso-application "EASY-BEE" \ --bootappend-live "boot=live components quiet nomodeset video=1920x1080 console=tty0 console=ttyS0,115200n8 loglevel=3 username=bee user-fullname=Bee modprobe.blacklist=nouveau" \ --apt-recommends false \ + --compression zstd \ "${@}" diff --git a/iso/builder/build.sh b/iso/builder/build.sh index a74f425..354125e 100755 --- a/iso/builder/build.sh +++ b/iso/builder/build.sh @@ -200,17 +200,24 @@ else fi echo "=== preparing staged overlay ===" -# Preserve lb package cache across builds so apt packages are not re-downloaded. +# Sync builder config into work dir, preserving lb cache (chroot + packages). +# We do NOT rm -rf BUILD_WORK_DIR so lb can reuse its chroot on repeat builds. +mkdir -p "${BUILD_WORK_DIR}" "${OVERLAY_STAGE_DIR}" +rsync -a --delete \ + --exclude='cache/' \ + --exclude='chroot/' \ + --exclude='.build/' \ + --exclude='*.iso' \ + --exclude='*.packages' \ + --exclude='*.contents' \ + --exclude='*.files' \ + "${BUILDER_DIR}/" "${BUILD_WORK_DIR}/" +# Also persist package cache to CACHE_ROOT so it survives a manual wipe of BUILD_WORK_DIR. LB_PKG_CACHE="${CACHE_ROOT}/lb-packages" mkdir -p "${LB_PKG_CACHE}" if [ -d "${BUILD_WORK_DIR}/cache/packages.chroot" ]; then rsync -a --delete "${BUILD_WORK_DIR}/cache/packages.chroot/" "${LB_PKG_CACHE}/" -fi -rm -rf "${BUILD_WORK_DIR}" "${OVERLAY_STAGE_DIR}" -mkdir -p "${BUILD_WORK_DIR}" "${OVERLAY_STAGE_DIR}" -rsync -a "${BUILDER_DIR}/" "${BUILD_WORK_DIR}/" -# Restore lb package cache -if [ -d "${LB_PKG_CACHE}" ] && [ "$(ls -A "${LB_PKG_CACHE}" 2>/dev/null)" ]; then +elif [ -d "${LB_PKG_CACHE}" ] && [ "$(ls -A "${LB_PKG_CACHE}" 2>/dev/null)" ]; then mkdir -p "${BUILD_WORK_DIR}/cache/packages.chroot" rsync -a "${LB_PKG_CACHE}/" "${BUILD_WORK_DIR}/cache/packages.chroot/" fi