fi
local opt_source=""
- local opt_linkfiles=""
+ local opt_link=""
for opt in $(echo ${options} | tr ',' ' ');
do
case "${opt}" in
source=*)
opt_source=${opt#source=}
;;
- linkfiles)
- opt_linkfiles="yes"
+ link)
+ opt_link="yes"
;;
union|bind)
;;
local full_source="$(trim_path ${backing}/${source})"
local full_dest="$(trim_path ${rootmnt}/${dir})"
- if [ -n "${opt_linkfiles}" ]
+ if [ -n "${opt_link}" ]
then
echo "${device} ${full_source} ${full_dest} ${options}" >> ${links}
else
while read device source dest options # < ${custom_mounts}
do
local opt_bind="yes"
- local opt_linkfiles=""
+ local opt_link=""
local opt_union=""
for opt in $(echo ${options} | tr ',' ' ');
do
case "${opt}" in
bind)
opt_bind="yes"
- unset opt_linkfiles opt_union
+ unset opt_link opt_union
;;
- linkfiles)
- opt_linkfiles="yes"
+ link)
+ opt_link="yes"
unset opt_bind opt_union
;;
union)
opt_union="yes"
- unset opt_bind opt_linkfiles
+ unset opt_bind opt_link
;;
esac
done
if [ -n "${PERSISTENCE_READONLY}" ]
then
continue
- elif [ -n "${opt_union}" ] || [ -n "${opt_linkfiles}" ]
+ elif [ -n "${opt_union}" ] || [ -n "${opt_link}" ]
then
# unions and don't need to be bootstrapped
- # linkfiles dirs can't be bootstrapped in a sensible way
+ # link dirs can't be bootstrapped in a sensible way
mkdir -p "${source}"
chown_ref "${dest}" "${source}"
chmod_ref "${dest}" "${source}"
# XXX: If CONFIG_AUFS_ROBR is added to the Debian kernel we can
# ignore the loop below and set rofs_dest_backing=$dest
local rofs_dest_backing=""
- if [ -n "${opt_linkfiles}"]
+ if [ -n "${opt_link}"]
then
for d in ${rootmnt}/live/rofs/*
do
done
fi
- if [ -n "${opt_linkfiles}" ] && [ -z "${PERSISTENCE_READONLY}" ]
+ if [ -n "${opt_link}" ] && [ -z "${PERSISTENCE_READONLY}" ]
then
link_files ${source} ${dest} ${rootmnt}
- elif [ -n "${opt_linkfiles}" ] && [ -n "${PERSISTENCE_READONLY}" ]
+ elif [ -n "${opt_link}" ] && [ -n "${PERSISTENCE_READONLY}" ]
then
mkdir -p ${rootmnt}/live/persistence
local links_source=$(mktemp -d ${rootmnt}/live/persistence/links-source-XXXXXX)
# post boot
local cow_dir="/live/overlay/${dest}"
fi
- if [ -e "${cow_dir}" ] && [ -z "${opt_linkfiles}" ]
+ if [ -e "${cow_dir}" ] && [ -z "${opt_link}" ]
then
# If an earlier custom mount has files here
# it will "block" the current mount's files
fi
}
-is_mountpoint () {
-
+is_mountpoint ()
+{
directory="$1"
- if [ $(stat -fc%d:%D "${directory}") != $(stat -fc%d:%D "${directory}/..") ]
- then
- return 0
- else
- return 1
- fi
+ [ $(stat -fc%d:%D "${directory}") != $(stat -fc%d:%D "${directory}/..") ]
}