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 e0dc0a47..503990a7 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 @@ -175,15 +175,16 @@ if [ "$MODE" = "direct" ]; then # script (first boot) or live-boot's initramfs (subsequent boots). 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 + # newer ISO would leave unwritable; re-own an existing library once. + if [ -d /mnt/persistence/wrolpi ] \ + && [ "$(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 + mkdir -p /mnt/persistence/wrolpi chown wrolpi:wrolpi /mnt/persistence/wrolpi # persistence.conf: live-boot reads this on boot and applies the bind