diff options
-rwxr-xr-x | components/9990-misc-helpers.sh | 28 | ||||
-rwxr-xr-x | components/9990-overlay.sh | 14 |
2 files changed, 16 insertions, 26 deletions
diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh index fcd2b07..87c4930 100755 --- a/components/9990-misc-helpers.sh +++ b/components/9990-misc-helpers.sh @@ -1292,16 +1292,22 @@ do_union () rw_opt="rw" ro_opt="rr+wh" noxino_opt="noxino" + + unionmountopts="-o noatime,${noxino_opt},dirs=${unionrw}=${rw_opt}" + if [ -n "${unionro}" ] + then + for rofs in ${unionro} + do + unionmountopts="${unionmountopts}:${rofs}=${ro_opt}" + done + fi + mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}" ;; - *) + overlay) rw_opt="rw" ro_opt="ro" - ;; - esac - case "${UNIONTYPE}" in - overlay) # XXX: can multiple unionro be used? (overlay only handles two dirs, but perhaps they can be chained?) # XXX: and can unionro be optional? i.e. can overlay skip lowerdir? if echo ${unionro} | grep -q " " @@ -1314,18 +1320,6 @@ do_union () unionmountopts="-o noatime,lowerdir=${unionro},upperdir=${unionrw}" mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}" ;; - - *) - unionmountopts="-o noatime,${noxino_opt},dirs=${unionrw}=${rw_opt}" - if [ -n "${unionro}" ] - then - for rofs in ${unionro} - do - unionmountopts="${unionmountopts}:${rofs}=${ro_opt}" - done - fi - mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}" - ;; esac } diff --git a/components/9990-overlay.sh b/components/9990-overlay.sh index 316a21d..54b75e5 100755 --- a/components/9990-overlay.sh +++ b/components/9990-overlay.sh @@ -8,16 +8,12 @@ setup_unionfs () rootmnt="${2}" addimage_directory="${3}" - case ${UNIONTYPE} in - aufs|overlay) - if ! cut -f2 /proc/filesystems | grep -q "^${UNIONTYPE}\$" - then - panic "${UNIONTYPE} not available." - fi + if ! cut -f2 /proc/filesystems | grep -q "^${UNIONTYPE}\$" + then + panic "${UNIONTYPE} not available." + fi - modprobe -q -b ${UNIONTYPE} - ;; - esac + modprobe -q -b ${UNIONTYPE} # run-init can't deal with images in a subdir, but we're going to # move all of these away before it runs anyway. No, we're not, |