diff options
| author | Tails developers <amnesia@boum.org> | 2012-03-26 16:29:19 +0200 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2012-04-05 07:54:42 +0200 |
| commit | 161e3e634a4f975f4d72fc2cfd715d9741fe9d16 (patch) | |
| tree | 9aad9d0b724eb20073842ffd270d66c3e2bee672 /scripts | |
| parent | 65dc1e4b2ba0d3e086308d4ad3104a1ce3a098cd (diff) | |
| download | live-boot-161e3e634a4f975f4d72fc2cfd715d9741fe9d16.tar.gz live-boot-161e3e634a4f975f4d72fc2cfd715d9741fe9d16.zip | |
Add 'bind' option for the default behaviour of custom mounts (bind-mount).
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/live-helpers | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/scripts/live-helpers b/scripts/live-helpers index 5306cf5..d8bd613 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -1323,7 +1323,7 @@ get_custom_mounts () linkfiles) opt_linkfiles="yes" ;; - union) + union|bind) ;; *) log_warning_msg "Skipping custom mount with unkown option: ${opt}" @@ -1389,25 +1389,27 @@ activate_custom_mounts () while read device source dest options # < ${custom_mounts} do + local opt_bind="yes" local opt_linkfiles="" local opt_union="" for opt in $(echo ${options} | tr ',' ' '); do case "${opt}" in + bind) + opt_bind="yes" + unset opt_linkfiles opt_union + ;; linkfiles) opt_linkfiles="yes" + unset opt_bind opt_union ;; union) opt_union="yes" + unset opt_bind opt_linkfiles ;; esac done - if [ -n "${opt_linkfiles}" ] && [ -n "${opt_union}" ] - then - log_warning_msg "Skipping custom mount ${dest} with options ${options}: \"linkfiles\" and \"union\" are mutually exclusive options" - fi - if [ -n "$(what_is_mounted_on "${dest}")" ] then log_warning_msg "Skipping custom mount ${dest}: $(what_is_mounted_on "${dest}") is already mounted there" @@ -1455,7 +1457,8 @@ activate_custom_mounts () mkdir -p "${source}" chown_ref "${dest}" "${source}" chmod_ref "${dest}" "${source}" - else + elif [ -n "${opt_bind}" ] + then # ensure that $dest is not copied *into* $source mkdir -p "$(dirname ${source})" cp -a "${dest}" "${source}" |
