build-local: make WORK dir overridable (avoid /tmp tmpfs exhaustion)

On hermes /tmp is a 16 GB tmpfs; a full xz build can exhaust it mid-run. WORK now
honours an env override (matching OUT) so it can be pointed at the NVMe.
This commit is contained in:
Breadway 2026-06-17 09:03:45 +08:00
parent aadda08797
commit 82fb48cffa

View file

@ -14,7 +14,10 @@
set -euo pipefail set -euo pipefail
REPO="$(cd "$(dirname "$0")" && pwd)" REPO="$(cd "$(dirname "$0")" && pwd)"
WORK=/tmp/bos-work # WORK defaults to /tmp, but on hermes /tmp is a 16 GB tmpfs — a full xz build
# (uncompressed rootfs + squashfs + work copies) can exhaust it mid-build. Allow
# pointing it at the NVMe instead: WORK=/home/.../bos-work sudo ./build-local.sh
WORK="${WORK:-/tmp/bos-work}"
OUT="${OUT:-$REPO/out}" OUT="${OUT:-$REPO/out}"
# Build against a throwaway copy of the profile so the working tree stays clean # Build against a throwaway copy of the profile so the working tree stays clean