X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=components%2F9990-misc-helpers.sh;h=39e609d3a2619ef15f15116d524afe6c984b2b22;hb=f5716f9a79564e44e38f5d4164a4dc1d77cb8c3a;hp=e3b382bc1e3972f54f0f818096390a6f64b6276a;hpb=1d3f7a8c955d20ac4b442719de70d9ed7406d201;p=live-boot-grml.git diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh index e3b382b..39e609d 100755 --- a/components/9990-misc-helpers.sh +++ b/components/9990-misc-helpers.sh @@ -114,7 +114,7 @@ check_dev () ISO_DEVICE=$(dirname ${ISO_DEVICE}) [ -b "$ISO_DEVICE" ] && break i=$(($i -1)) - done + done fi if [ "$ISO_DEVICE" = "/" ] @@ -420,6 +420,12 @@ is_supported_fs () return 1 fi + # get_fstype might report "unknown" or "swap", ignore it as no such kernel module exists + if [ "${fstype}" = "unknown" ] || [ "${fstype}" = "swap" ] + then + return 1 + fi + # Try to look if it is already supported by the kernel if grep -q ${fstype} /proc/filesystems then @@ -1074,18 +1080,18 @@ find_persistence_media () result=$(probe_for_file_name "${overlays}" ${dev}) if [ -n "${result}" ] then - local loopdevice + local loopdevice loopdevice=${result##*=} - if is_in_comma_sep_list luks ${PERSISTENCE_ENCRYPTION} && is_luks_partition ${loopdevice} + if is_in_comma_sep_list luks ${PERSISTENCE_ENCRYPTION} && is_luks_partition ${loopdevice} then - local luksfile + local luksfile luksfile="" if luksfile=$(open_luks_device "${loopdevice}") then - result=${result%%=*} + result=${result%%=*} result="${result}=${luksfile}" else - losetup -d $loopdevice + losetup -d $loopdevice result="" fi fi @@ -1304,16 +1310,14 @@ do_union () ;; 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 " " - then - panic "Multiple lower filesystems are currently not supported with overlay (unionro = ${unionro})." - elif [ -z "${unionro}" ] + # XXX: can unionro be optional? i.e. can overlay skip lowerdir? + if [ -z "${unionro}" ] then panic "overlay needs at least one lower filesystem (read-only branch)." fi - unionmountopts="-o noatime,lowerdir=${unionro},upperdir=${unionrw}" + # Multiple lower layers can now be given using the the colon (":") as a + # separator character between the directory names. + unionro="$(echo ${unionro} | sed -e 's| |:|g')" # overlayfs requires: # + a workdir to become mounted # + workdir and upperdir to reside under the same mount @@ -1321,7 +1325,6 @@ do_union () mkdir "${unionrw}/rw" mkdir "${unionrw}/work" unionmountopts="-o noatime,lowerdir=${unionro},upperdir=${unionrw}/rw,workdir=${unionrw}/work" - mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}" ;; esac