projects
/
live-boot-grml.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add 'bind' option for the default behaviour of custom mounts (bind-mount).
[live-boot-grml.git]
/
scripts
/
live-helpers
diff --git
a/scripts/live-helpers
b/scripts/live-helpers
index
860e6ff
..
d8bd613
100644
(file)
--- a/
scripts/live-helpers
+++ b/
scripts/live-helpers
@@
-1187,12
+1187,14
@@
link_files ()
fi
link_files "${src}" "${dest}" "${src_mask}"
else
fi
link_files "${src}" "${dest}" "${src_mask}"
else
+ local final_src=${src}
if [ -n "${src_mask}" ]
then
if [ -n "${src_mask}" ]
then
-
src="$(echo ${
src} | sed "s|^${src_mask}||")"
+
final_src="$(echo ${final_
src} | sed "s|^${src_mask}||")"
fi
rm -rf "${dest}" 2> /dev/null
fi
rm -rf "${dest}" 2> /dev/null
- ln -s "${src}" "${dest}"
+ ln -s "${final_src}" "${dest}"
+ chown_ref "${src}" "${dest}"
fi
done
}
fi
done
}
@@
-1321,7
+1323,7
@@
get_custom_mounts ()
linkfiles)
opt_linkfiles="yes"
;;
linkfiles)
opt_linkfiles="yes"
;;
- union)
+ union
|bind
)
;;
*)
log_warning_msg "Skipping custom mount with unkown option: ${opt}"
;;
*)
log_warning_msg "Skipping custom mount with unkown option: ${opt}"
@@
-1387,25
+1389,27
@@
activate_custom_mounts ()
while read device source dest options # < ${custom_mounts}
do
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
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"
linkfiles)
opt_linkfiles="yes"
+ unset opt_bind opt_union
;;
union)
opt_union="yes"
;;
union)
opt_union="yes"
+ unset opt_bind opt_linkfiles
;;
esac
done
;;
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"
if [ -n "$(what_is_mounted_on "${dest}")" ]
then
log_warning_msg "Skipping custom mount ${dest}: $(what_is_mounted_on "${dest}") is already mounted there"
@@
-1453,7
+1457,8
@@
activate_custom_mounts ()
mkdir -p "${source}"
chown_ref "${dest}" "${source}"
chmod_ref "${dest}" "${source}"
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}"
# ensure that $dest is not copied *into* $source
mkdir -p "$(dirname ${source})"
cp -a "${dest}" "${source}"