debian-live hook: set safe.directory before the pre-stamp reset

Add `git config --global --add safe.directory /opt/wrolpi` before the
`git reset --hard`, guarding against git's "dubious ownership" refusal.
Set HOME=/root first so the --global write cannot fail (and abort the ISO
build under `set -e`) if the live-build chroot leaves HOME unset -- the
same pattern the pi-gen hook already uses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Roland 2026-07-18 13:38:05 -06:00 • committed by lrnselfreliance
parent 575d2f9744
commit a3a712ead1

View file

@ -62,8 +62,11 @@ npm install
# against the dirty lock can never match on first boot and the box rebuilds the app.
# Reset to HEAD here, exactly as repair.sh does, so the baked stamp represents
# committed source. Only the lock is reverted; build/, node_modules, and the venvs
# are untracked and survive. The repo is cloned and reset as root (same owner),
# so no safe.directory config is needed here.
# are untracked and survive. HOME is set explicitly so `git config --global`
# cannot fail (and abort the build under `set -e`) when the chroot leaves HOME
# unset; safe.directory avoids git's "dubious ownership" refusal.
export HOME=/root
git config --global --add safe.directory /opt/wrolpi
git -C /opt/wrolpi reset --hard HEAD
# Build the React production bundle. Without this, /opt/wrolpi/app/build/