diff --git a/Makefile b/Makefile index 3789a3860c..7118effcee 100644 --- a/Makefile +++ b/Makefile @@ -99,6 +99,15 @@ iso: # install-image runs no `make obj': without its object directory nbmake builds # in src/distrib//installimage, and those untracked files changed the # build stamp ("sources changed", 2026-11-18). The directory is made here. +# The work files of the image (work/, work.rootfs, imgroot.fs, work.img and the +# image itself, about 34 GB) are removed with NetBSD's own `clean' target of +# distrib/common/bootimage/Makefile.bootimage (CLEANFILES, WORKDIR) before the +# build, so a killed run leaves nothing behind, and after it, once install(1) +# has copied the image to RELEASEDIR/images. The temporary files install(1) +# leaves there when it is killed (`*.img.inst.XXXXXX', 6.3 GB on 2026-11-18) +# go too. Konrad, 2026-11-18: "verhinder das so ne scheisse uebrig bleibt". +INSTIMG_CLEAN = (cd $(SRC)/distrib/$(MACHINE)/installimage && \ + $(OBJ)/tooldir.*/bin/nbmake-$(MACHINE) clean >/dev/null) usb: @tools/build-lock.sh 'if ! tools/build-stamp.sh -c; then exit 1; fi; \ if [ ! -d $(OBJ)/releasedir/source/sets ]; then \ @@ -106,8 +115,11 @@ usb: echo "make usb: run make sourcesets after make release so the stick carries /source." >&2; \ exit 1; \ fi; \ + rm -f $(OBJ)/releasedir/images/*.img.inst.*; \ mkdir -p $(OBJ)/distrib/$(MACHINE)/installimage; \ - $(BUILD_SH) -V INSTIMG_RAW=yes -V INSTIMG_BIOS=no install-image' + $(INSTIMG_CLEAN) && \ + $(BUILD_SH) -V INSTIMG_RAW=yes -V INSTIMG_BIOS=no install-image && \ + $(INSTIMG_CLEAN)' # pack the install images for a download (tools/images.sh): nothing is # compressed by the other steps diff --git a/tools/AGENTS.md b/tools/AGENTS.md index 3593c1f49f..ec6777ada3 100644 --- a/tools/AGENTS.md +++ b/tools/AGENTS.md @@ -57,7 +57,7 @@ Build and release (called by `make`): `ext/src/mcde/pkgsrc/PLIST`. - `keep-images.sh [-n N] NAME` -- copies the install images to `build/keep-NAME/` before the next `make release` removes the release directory; keeps NAME and the newest N - (by time, default 2) `build/keep-*`, removes the older ones. + (by time, default 1: one 10 GB medium is enough) `build/keep-*`, removes the older ones. - `pkg-binaries.sh` -- fetch the NetBSD project's binary packages. - `images.sh` -- `unpack|pack|sums` of the install images (`make usb`, `make compress`); images stay raw unless packing is asked for. diff --git a/tools/keep-images.sh b/tools/keep-images.sh index 6b75a5975a..f93dfce557 100644 --- a/tools/keep-images.sh +++ b/tools/keep-images.sh @@ -15,10 +15,10 @@ set -eu TOP=$(cd "$(dirname "$0")/.." && pwd) -N=2 +N=1 while [ $# -gt 0 ]; do case "$1" in - -n) shift; N=${1:-2}; shift ;; + -n) shift; N=${1:-1}; shift ;; *) break ;; esac done