X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive;h=c89ebb73993c68d37c3a3e995b3c7b6a359786fd;hb=336dae6909b0b4fe78fce4b1e3c33fc716507a6b;hp=e80c47091a09dbb0060463f446e50a6c295b0f02;hpb=baa35e3dbde1d68bedca73fa03425d0a7d8b374c;p=live-boot-grml.git diff --git a/scripts/live b/scripts/live index e80c470..c89ebb7 100755 --- a/scripts/live +++ b/scripts/live @@ -1695,16 +1695,28 @@ setup_unionfs () # that we won't hide a previous mount. We also ignore # duplicate destinations in a more or less arbitrary way. [ -e "${bindings}" ] && sort -k2 -sbu ${bindings} >> ${custom_mounts} + rm -f ${bindings} # After all mounts are considered we add symlinks so they # won't be hidden by some mount. [ -e "${links}" ] && sort -k2 -sbu ${links} >> ${custom_mounts} + rm -f ${links} [ "${DEBUG}" = "Yes" ] && cp ${custom_mounts} ${persistent_backing} # 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" @@ -1743,7 +1755,7 @@ setup_unionfs () # dealing with /etc or other system dir. if [ ! -d "${source}" ] then - if [ -n "${PERSISTENT_READONLY}" ] || echo ${options} | grep -qe "\" + if [ -n "${PERSISTENT_READONLY}" ] || [ -n "${opt_linkfiles}" ] then continue fi @@ -1754,7 +1766,7 @@ setup_unionfs () if [ -z "${PERSISTENT_READONLY}" ] then - if echo ${options} | grep -qe "\"; + if [ -n "${opt_linkfiles}" ] then links_source="${source}" links_dest="${dest}" @@ -1762,7 +1774,7 @@ setup_unionfs () mount --bind "${source}" "${dest}" fi else - if echo ${options} | grep -qe "\"; + if [ -n "${opt_linkfiles}" ] then links_dest="${dest}" dest="$(mktemp -d ${persistent_backing}/links_source-XXXXXX)" @@ -1774,7 +1786,7 @@ setup_unionfs () mount -t "${UNIONTYPE}" -o "${unionmountopts}" "${UNIONTYPE}" "${dest}" fi - if echo $options | grep -qe "\"; + if [ -n "${opt_linkfiles}" ] then link_files "${links_source}" "${links_dest}" "${rootmnt}" fi