mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-04 13:49:57 -05:00
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) <noreply@anthropic.com>
This commit is contained in:
parent
dcfad8b4af
commit
5625f17b5b
2 changed files with 5 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue