From 5625f17b5b7a1dd747439b25a982033914182d1b Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 31 May 2026 12:15:32 -0600 Subject: [PATCH] pi-gen: set HOME before `git config --global` in the chroot (systemd fix) When the release runs under the wrolpi-release systemd service, HOME is unset, so `git config --global --add safe.directory /opt/wrolpi` in the pi-gen chroot aborts with "fatal: $HOME not set" and the build fails at stage 3. Manual shell builds worked only because the shell provided HOME. Export HOME=/root in the chroot hook (self-contained), and also set Environment=HOME=/root in the service unit template. Co-Authored-By: Claude Opus 4.8 (1M context) --- pi-gen/stage2/04-wrolpi/03-run-chroot.sh | 3 +++ release/wrolpi-release.service | 2 ++ 2 files changed, 5 insertions(+) diff --git a/pi-gen/stage2/04-wrolpi/03-run-chroot.sh b/pi-gen/stage2/04-wrolpi/03-run-chroot.sh index b20965c8..3bbd8504 100755 --- a/pi-gen/stage2/04-wrolpi/03-run-chroot.sh +++ b/pi-gen/stage2/04-wrolpi/03-run-chroot.sh @@ -37,6 +37,9 @@ deno --version # Put the latest WROLPi in /opt/wrolpi. git clone -b "${WROLPI_BRANCH:-release}" https://github.com/lrnselfreliance/wrolpi.git /opt/wrolpi +# `git config --global` needs HOME, which is empty when the build runs under +# systemd (the release poller service has no HOME); set it to root's home. +export HOME=/root git config --global --add safe.directory /opt/wrolpi # Install Python requirements. Try multiple times because pypi may stop responding. diff --git a/release/wrolpi-release.service b/release/wrolpi-release.service index f640f2bf..e2f3e4ca 100644 --- a/release/wrolpi-release.service +++ b/release/wrolpi-release.service @@ -26,6 +26,8 @@ ExecStart=/opt/wrolpi/release/release-watch.sh # Persistent state (failure markers, build lock): /var/lib/wrolpi-release StateDirectory=wrolpi-release Environment=STATE_DIR=/var/lib/wrolpi-release +# systemd leaves HOME unset; the pi-gen chroot's `git config --global` needs it. +Environment=HOME=/root # Uncomment if the s3cmd config is not at /root/.s3cfg: #Environment=S3CFG=/home/wrolpi/.s3cfg # Optional: command to notify on release success/failure (gets one message arg).