Commit 6e08de14 authored by Tails developers's avatar Tails developers
Browse files

Remount persistence devices read-only at shutdown/reboot time (Closes: #6228).

The upstream live-boot initscript (shipped by live-config) doesn't know about
our persistent mounts (/live/persistence/*), since they are performed from GDM,
and not further moved to the same place as mounts done during initramfs are

Therefore, it can't remount them read-only at shutdown/reboot time. So, let's
patch the upstream file at build time for now, to let it know about
our mountpoints.

A possibly better long-term solution would be to have this change merged
upstream, but it's likely not to please them so much.

An even better long-term solution would be to have the live-boot code we use in
live-persist also move the mounts to the expected place. This could be part of
upstreaming live-persist, presumably.

On the other hand, all this upstreaming would be only so that our weird usecase
is better supported there; it does not look like similar features have been
asked by anyone else, so we...
parent 2af1fbf4
diff --git a/bin/ b/bin/
index f85b2b2..fec1496 100755
--- a/lib/live/
+++ b/lib/live/
@@ -161,7 +161,7 @@ done
mount -o remount,ro /lib/live/mount/overlay > /dev/null 2>&1
# Remounting any persistence devices read-only
-for _MOUNT in $(awk '/\/lib\/live\/mount\/persistence/ { print $2 }' /proc/mounts)
+for _MOUNT in $(awk '/\/(lib\/live\/mount|live)\/persistence/ { print $2 }' /proc/mounts)
mount -o remount,ro ${_MOUNT} > /dev/null 2>&1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment