Also create parents when creating union/linkfiles source directories.
[live-boot-grml.git] / scripts / live-helpers
index db6d25c..13a8cec 100644 (file)
@@ -1436,7 +1436,7 @@ activate_custom_mounts ()
                        then
                                # unions and don't need to be bootstrapped
                                # linkfiles dirs can't be bootstrapped in a sensible way
-                               mkdir "${source}"
+                               mkdir -p "${source}"
                                chown --reference "${dest}" "${source}"
                                chmod --reference "${dest}" "${source}"
                        else
@@ -1490,6 +1490,13 @@ activate_custom_mounts ()
                        else
                                cow_dir="/live/cow/${dest}"
                        fi
+                       if [ -e "${cow_dir}" ]
+                       then
+                               # If an earlier custom mount has files here
+                               # it will "block" the current mount's files
+                               # which is undesirable
+                               rm -rf "${cow_dir}"
+                       fi
                        mkdir -p ${cow_dir}
                        chown --reference "${source}" "${cow_dir}"
                        chmod --reference "${source}" "${cow_dir}"