From 76aafc5da95f16d8613962a1650befdeded3b48e Mon Sep 17 00:00:00 2001 From: Roland Date: Mon, 20 Jul 2026 18:36:58 -0600 Subject: [PATCH] repair: copy wrolpi/blobs into /opt/wrolpi-blobs on install and upgrade The image builds (pi-gen, debian-live, Docker) already ship wrolpi/blobs, but a fresh install on existing Debian and an in-place upgrade did not pick up the default Zim. repair.sh runs on both paths (both install scripts and upgrade.sh call it) and already manages /opt/wrolpi-blobs immutability, so copy the committed blobs there -- after the immutable flag is cleared and before it is re-applied. Local copy only, preserving repair.sh's no-internet guarantee. Co-Authored-By: Claude Opus 4.8 (1M context) --- repair.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/repair.sh b/repair.sh index f3f82292..607044a7 100755 --- a/repair.sh +++ b/repair.sh @@ -169,6 +169,16 @@ chown wrolpi:wrolpi /media/wrolpi 2>/dev/null || echo "Ignoring failure to chang # Remove immutable flag from blob files before chown (may not exist or may not be set). chattr -i /opt/wrolpi-blobs/* 2>/dev/null || : +# Ship committed blobs (e.g. the default Zim served by Kiwix when the media dir +# has no working zims) into /opt/wrolpi-blobs. repair.sh runs on every install +# and upgrade, so this keeps the blobs current there just like the image builds +# do. It runs after the immutable flag is cleared above (so existing blobs can +# be overwritten) and before immutability is re-applied below. +mkdir -p /opt/wrolpi-blobs +if [ -d /opt/wrolpi/wrolpi/blobs ] && ls /opt/wrolpi/wrolpi/blobs/* >/dev/null 2>&1; then + cp /opt/wrolpi/wrolpi/blobs/* /opt/wrolpi-blobs/ +fi + chown -R wrolpi:wrolpi /home/wrolpi /opt/wrolpi* # Protect blob files from accidental modification or deletion.