From: Daniel Baumann Date: Sun, 4 Jan 2015 20:36:37 +0000 (+0100) Subject: Simplifying code a bit after removal of no longer supported overlay alternatives. X-Git-Tag: debian/5.0_a1-1~2 X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=commitdiff_plain;h=f2dcec3f21086a557db86ae928295474be79d35b Simplifying code a bit after removal of no longer supported overlay alternatives. --- 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,