mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Fixing build.sh cleanup of prior build's immutable files.
The chroot hook applies chattr +i to /opt/wrolpi-blobs/*, which then prevents rm -rf from wiping BUILD_DIR on subsequent runs. lb's chroot_includes_after_packages rsync then fails with "Operation not permitted" trying to overwrite the leftovers. Strip +i before rm. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1271ce1743
commit
144968a003
1 changed files with 10 additions and 3 deletions
|
|
@ -46,9 +46,16 @@ if [ $EUID != 0 ]; then
|
|||
exit $?
|
||||
fi
|
||||
|
||||
# Clear out old builds.
|
||||
[ -d "${BUILD_DIR}" ] && rm -rf "${BUILD_DIR}"
|
||||
mkdir "${BUILD_DIR}"
|
||||
# Clear out old builds. Strip immutable flag from blob files first — the
|
||||
# chroot hook applies chattr +i to /opt/wrolpi-blobs/*; without removing
|
||||
# that here, rm -rf leaves them behind and the next lb build's
|
||||
# chroot_includes_after_packages rsync fails with "Operation not permitted"
|
||||
# trying to overwrite them.
|
||||
if [ -d "${BUILD_DIR}" ]; then
|
||||
find "${BUILD_DIR}" -path '*/opt/wrolpi-blobs/*' -type f -exec chattr -i {} + 2>/dev/null || true
|
||||
rm -rf "${BUILD_DIR}"
|
||||
fi
|
||||
mkdir -p "${BUILD_DIR}"
|
||||
cd "${BUILD_DIR}" || (echo "Work directory must exist" && exit 1)
|
||||
set -e
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue