repair.sh: refresh the Portable bootstrap script on installed boxes.

Boxes installed from the Live USB run /usr/local/sbin/wrolpi-bootstrap.sh
at every boot, but nothing ever updated it after image build — fixes to
the bootstrap (e.g. Postgres bind-mounts on live boots only) could never
reach installed systems.  Copy the script (and its unit, if installed)
from the repo during repair, which both upgrade.sh and install runs
execute.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-07-05 15:34:40 -06:00
parent f500600025
commit 9d778d25a5
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680

View file

@ -70,6 +70,17 @@ chmod 0440 /etc/sudoers.d/90-wrolpi
# Verify this new file is valid.
visudo -c -f /etc/sudoers.d/90-wrolpi
# Update the Portable bootstrap on boxes installed from the Live USB; it is
# otherwise frozen at image-build time.
LIVE_INCLUDES=/opt/wrolpi/debian-live-config/config/includes.chroot
if [ -f /usr/local/sbin/wrolpi-bootstrap.sh ]; then
cp "${LIVE_INCLUDES}/usr/local/sbin/wrolpi-bootstrap.sh" /usr/local/sbin/wrolpi-bootstrap.sh
chmod 0755 /usr/local/sbin/wrolpi-bootstrap.sh
if [ -f /etc/systemd/system/wrolpi-bootstrap.service ]; then
cp "${LIVE_INCLUDES}/etc/systemd/system/wrolpi-bootstrap.service" /etc/systemd/system/wrolpi-bootstrap.service
fi
fi
# Install the systemd services
cp /opt/wrolpi/etc/raspberrypios/wrolpi*.service /etc/systemd/system/
cp /opt/wrolpi/etc/raspberrypios/wrolpi-*.timer /etc/systemd/system/