Add a note about a potential, future code simplification.
[live-boot-grml.git] / scripts / live-helpers
index 442f749..78608b6 100644 (file)
@@ -1357,6 +1357,11 @@ activate_custom_mounts ()
                        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 ${source} on ${dest}: $(what_is_mounted_on "${dest}") is already mounted there"
@@ -1398,13 +1403,16 @@ activate_custom_mounts ()
                # dealing with /etc or other system dir.
                if [ ! -d "${source}" ]
                then
-                       if [ -n "${PERSISTENT_READONLY}" ] || [ -n "${opt_linkfiles}" ]
+                       if [ -n "${PERSISTENT_READONLY}" ]
                        then
                                continue
-                       elif [ -n "${opt_union}" ]
+                       elif [ -n "${opt_union}" ] || [ -n "${opt_linkfiles}" ]
                        then
-                               # union's don't need to be bootstrapped
+                               # unions and don't need to be bootstrapped
+                               # linkfiles dirs can't be bootstrapped in a sensible way
                                mkdir "${source}"
+                               chown --reference "${dest}" "${source}"
+                               chmod --reference "${dest}" "${source}"
                        else
                                # ensure that $dest is not copied *into* $source
                                mkdir -p "$(dirname ${source})"
@@ -1412,6 +1420,8 @@ activate_custom_mounts ()
                        fi
                fi
 
+               # XXX: If CONFIG_AUFS_ROBR is added to the Debian kernel we can
+               # ignore the loop below and set rofs_dest_backing=$dest
                rofs_dest_backing=""
                for d in ${rootmnt}/live/rofs/*
                do