fix: incremental rootfs builds so stale archives are never deployed

The deploy failed with "grub-install: command not found" in the chroot —
the installed rootfs archive was built BEFORE the BOOT/grub injection, so
it had no bootloader at all. build-iso.sh / build-image.sh only rebuilt
the rootfs when the archive was missing, never when sources changed, so
development fixes were silently absent from deployed images.

- build-rootfs.sh: incremental staleness check — skips a rebuild only when
  no input (scripts/, btrfs/, overlays/, editions/<e>/, versions.mk,
  toolchain debs) is newer than the artifact; FORCE=1 rebuilds anyway.
- build-iso.sh / build-image.sh: always delegate freshness to
  build-rootfs.sh instead of gating on file existence.
- deploy-disk.sh: defensive check that grub-install exists in the deployed
  rootfs, with a clear "stale archive — rebuild" message instead of a bare
  "command not found".
- docs/building.md: incremental-build note (FORCE=1 / make clean).
This commit is contained in:
Blake Ridgway
2026-08-22 02:46:03 -05:00
parent f879bcf219
commit 9952f89783
5 changed files with 39 additions and 13 deletions

View File

@@ -49,11 +49,8 @@ ARTIFACT="$ARTIFACT_DIR/arcline-$EDITION-$VERSION-$ARCH.$EXT"
mkdir -p "$IMAGE_DIR/$EDITION" "$ARTIFACT_DIR"
rm -f "$RAW" "$ARTIFACT" "$ARTIFACT.sha256"
# ── 1. rootfs ──────────────────────────────────────────────────────────────
if [[ ! -d "$ROOTFS" ]]; then
log "rootfs missing — building it first"
"$ROOT/scripts/build-rootfs.sh" "$EDITION"
fi
# ── 1. rootfs (incremental: build-rootfs skips when inputs are unchanged)
"$ROOT/scripts/build-rootfs.sh" "$EDITION"
# ── 2. sparse raw file + loop device ────────────────────────────────────────
log "creating ${SIZE} sparse image (edition $EDITION, $BOOT boot)"