diff --git a/debian-live-config/build.sh b/debian-live-config/build.sh index aff11ce2..44f0dad9 100755 --- a/debian-live-config/build.sh +++ b/debian-live-config/build.sh @@ -44,6 +44,8 @@ else fi # Clear out old builds. +# Remove immutable attribute from protected files before cleanup +chattr -i "${BUILD_DIR}"/chroot/opt/wrolpi-blobs/* 2>/dev/null || : [ -d "${BUILD_DIR}" ] && rm -rf "${BUILD_DIR}" mkdir "${BUILD_DIR}" cd "${BUILD_DIR}" || (echo "Work directory must exist" && exit 1) diff --git a/pi-gen/build.sh b/pi-gen/build.sh index 43b3fa8c..5721edee 100755 --- a/pi-gen/build.sh +++ b/pi-gen/build.sh @@ -62,6 +62,9 @@ cleanup() { fi done + # Remove immutable attribute from protected files before cleanup + chattr -i "${BUILD_DIR}"/work/*/stage*/rootfs/opt/wrolpi-blobs/* 2>/dev/null || : + # Final safety net – remove the whole build tree rm -rf "${BUILD_DIR}" }