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).