summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2012-02-08 12:49:40 +0100
committerDaniel Baumann <daniel@debian.org>2012-04-01 22:05:38 +0200
commit336dae6909b0b4fe78fce4b1e3c33fc716507a6b (patch)
tree7cfe9c5e64c227c5b316d270a5739b4b66b258c7 /scripts
parenta844e2f2b5c126e6f3e54a65e69b8673553afdf3 (diff)
downloadlive-boot-336dae6909b0b4fe78fce4b1e3c33fc716507a6b.tar.gz
live-boot-336dae6909b0b4fe78fce4b1e3c33fc716507a6b.zip
Handle custom mounts options a bit more beautifully.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/live18
1 files changed, 14 insertions, 4 deletions
diff --git a/scripts/live b/scripts/live
index 077ad52..c89ebb7 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1707,6 +1707,16 @@ setup_unionfs ()
# Now we do the actual mounting (and symlinking)
while read source dest options # < ${custom_mounts}
do
+ local opt_linkfiles=""
+ for opt in $(echo ${options} | tr ',' ' ');
+ do
+ case "${opt}" in
+ "linkfiles")
+ opt_linkfiles="yes"
+ ;;
+ esac
+ done
+
if mountpoint -q "${dest}";
then
log_warning_msg "Skipping custom mount ${source} on ${dest}: destination is already a mount point"
@@ -1745,7 +1755,7 @@ setup_unionfs ()
# dealing with /etc or other system dir.
if [ ! -d "${source}" ]
then
- if [ -n "${PERSISTENT_READONLY}" ] || echo ${options} | grep -qe "\<linkfiles\>"
+ if [ -n "${PERSISTENT_READONLY}" ] || [ -n "${opt_linkfiles}" ]
then
continue
fi
@@ -1756,7 +1766,7 @@ setup_unionfs ()
if [ -z "${PERSISTENT_READONLY}" ]
then
- if echo ${options} | grep -qe "\<linkfiles\>";
+ if [ -n "${opt_linkfiles}" ]
then
links_source="${source}"
links_dest="${dest}"
@@ -1764,7 +1774,7 @@ setup_unionfs ()
mount --bind "${source}" "${dest}"
fi
else
- if echo ${options} | grep -qe "\<linkfiles\>";
+ if [ -n "${opt_linkfiles}" ]
then
links_dest="${dest}"
dest="$(mktemp -d ${persistent_backing}/links_source-XXXXXX)"
@@ -1776,7 +1786,7 @@ setup_unionfs ()
mount -t "${UNIONTYPE}" -o "${unionmountopts}" "${UNIONTYPE}" "${dest}"
fi
- if echo $options | grep -qe "\<linkfiles\>";
+ if [ -n "${opt_linkfiles}" ]
then
link_files "${links_source}" "${links_dest}" "${rootmnt}"
fi