Simplifying code a bit after removal of no longer supported overlay alternatives.
authorDaniel Baumann <mail@daniel-baumann.ch>
Sun, 4 Jan 2015 20:36:37 +0000 (21:36 +0100)
committerDaniel Baumann <mail@daniel-baumann.ch>
Sun, 4 Jan 2015 20:47:53 +0000 (21:47 +0100)
components/9990-misc-helpers.sh
components/9990-overlay.sh

index fcd2b07..87c4930 100755 (executable)
@@ -1292,16 +1292,22 @@ do_union ()
                        rw_opt="rw"
                        ro_opt="rr+wh"
                        noxino_opt="noxino"
                        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"
                        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 " "
                        # 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,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
 }
 
        esac
 }
 
index 316a21d..54b75e5 100755 (executable)
@@ -8,16 +8,12 @@ setup_unionfs ()
        rootmnt="${2}"
        addimage_directory="${3}"
 
        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,
 
        # 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,