From a9d29ee385fb31d8e5bda0ba649afb54914673c5 Mon Sep 17 00:00:00 2001 From: Tails developers Date: Thu, 22 Mar 2012 19:43:55 +0100 Subject: Remove cow dir contents that are in the way for custom mounts. This is mostly relevant if you activate persistence post boot; in that case you (or live-config) may have modified or added some file, which makes it appear in the cow dir. If you later activate a persistent volume which contains that file, the old file will "block" the one from the persistent volume, which likely isn't what you expect. --- scripts/live-helpers | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/live-helpers b/scripts/live-helpers index db6d25c..0ab36b9 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -1490,6 +1490,13 @@ activate_custom_mounts () else cow_dir="/live/cow/${dest}" fi + if [ -e "${cow_dir}" ] + then + # If an earlier custom mount has files here + # it will "block" the current mount's files + # which is undesirable + rm -rf "${cow_dir}" + fi mkdir -p ${cow_dir} chown --reference "${source}" "${cow_dir}" chmod --reference "${source}" "${cow_dir}" -- cgit v1.2.3