summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2012-03-22 19:43:55 +0100
committerDaniel Baumann <daniel@debian.org>2012-04-05 07:50:24 +0200
commita9d29ee385fb31d8e5bda0ba649afb54914673c5 (patch)
tree88a6595431092395b984987ade7ccbf2cc162be2 /scripts
parent8b3ccc55856039a150b0d06c4dce24c50020a8fd (diff)
downloadlive-boot-a9d29ee385fb31d8e5bda0ba649afb54914673c5.tar.gz
live-boot-a9d29ee385fb31d8e5bda0ba649afb54914673c5.zip
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.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/live-helpers7
1 files changed, 7 insertions, 0 deletions
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}"