From a3a712ead100459a875d8e9636474b8f59b1483b Mon Sep 17 00:00:00 2001 From: Roland Date: Sat, 18 Jul 2026 13:38:05 -0600 Subject: [PATCH] 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) --- .../config/hooks/normal/9999-wrolpi.hook.chroot | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot b/debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot index 2920f0a7..8518c4fc 100644 --- a/debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot +++ b/debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot @@ -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/