From baa86b4ad1038fc3b4b797746c887b4fe55c8e9b Mon Sep 17 00:00:00 2001 From: lrnselfreliance <33263708+lrnselfreliance@users.noreply.github.com> Date: Wed, 14 Oct 2026 18:23:53 -0600 Subject: [PATCH] Upgraded Live USBs keep a writable library (#835) ISOs before wrolpi became a system account wrote the Live USB's library on the persistence partition as UID 1000. Upgrading such a USB with a newer ISO (wrolpi-usb.sh upgrade) keeps the persistence partition, so the library would belong to the live session's "user" and the services could not write to it. Bootstrap now re-owns the library once when its owner is not this image's wrolpi. Live USBs only: installed systems' drives are left alone. Co-authored-by: Claude Opus 5.5 --- .../includes.chroot/usr/local/sbin/wrolpi-bootstrap.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian-live-config/config/includes.chroot/usr/local/sbin/wrolpi-bootstrap.sh b/debian-live-config/config/includes.chroot/usr/local/sbin/wrolpi-bootstrap.sh index 98ba6de7..e0dc0a47 100644 --- a/debian-live-config/config/includes.chroot/usr/local/sbin/wrolpi-bootstrap.sh +++ b/debian-live-config/config/includes.chroot/usr/local/sbin/wrolpi-bootstrap.sh @@ -176,6 +176,14 @@ if [ "$MODE" = "direct" ]; then mkdir -p /mnt/persistence mountpoint -q /mnt/persistence || mount "$PERSIST_PART" /mnt/persistence mkdir -p /mnt/persistence/wrolpi + # The library must be owned by this image's wrolpi. ISOs before wrolpi + # became a system account wrote it as UID 1000, which a USB upgraded with a + # newer ISO would leave unwritable; re-own it once. + if [ "$(stat -c %u /mnt/persistence/wrolpi)" != "$(id -u wrolpi)" ]; then + progress "Updating library ownership for this WROLPi version..." + chown -R wrolpi:wrolpi /mnt/persistence/wrolpi + note_action "Updated the library's ownership for this WROLPi version" + fi chown wrolpi:wrolpi /mnt/persistence/wrolpi # persistence.conf: live-boot reads this on boot and applies the bind