X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=components%2F9990-misc-helpers.sh;h=a97615bb6ddc5f128eeafa0be2d10e8e121dc1f5;hb=6f465ddc145fb527215865ed042875d231d8dcfd;hp=995187314d7fe94e8ffe5dc0033122295f97baf9;hpb=6bc8a6645a6310e8089f5521b7c62b25925abe78;p=live-boot-grml.git diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh index 9951873..a97615b 100755 --- a/components/9990-misc-helpers.sh +++ b/components/9990-misc-helpers.sh @@ -420,13 +420,19 @@ 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 return 0 else # Then try to add support for it the gentle way using the initramfs capabilities - modprobe ${fstype} + modprobe -q -b ${fstype} if grep -q ${fstype} /proc/filesystems then return 0 @@ -1292,23 +1298,8 @@ do_union () rw_opt="rw" ro_opt="rr+wh" noxino_opt="noxino" - ;; - - unionfs-fuse) - rw_opt="RW" - ro_opt="RO" - ;; - *) - rw_opt="rw" - ro_opt="ro" - ;; - esac - - case "${UNIONTYPE}" in - unionfs-fuse) - unionmountopts="-o cow -o noinitgroups -o default_permissions -o allow_other -o use_ino -o suid" - unionmountopts="${unionmountopts} ${unionrw}=${rw_opt}" + unionmountopts="-o noatime,${noxino_opt},dirs=${unionrw}=${rw_opt}" if [ -n "${unionro}" ] then for rofs in ${unionro} @@ -1316,38 +1307,29 @@ do_union () unionmountopts="${unionmountopts}:${rofs}=${ro_opt}" done fi - ( sysctl -w fs.file-max=391524 ; ulimit -HSn 16384 - unionfs-fuse ${unionmountopts} "${unionmountpoint}" ) && \ - ( mkdir -p /run/sendsigs.omit.d - pidof unionfs-fuse >> /run/sendsigs.omit.d/unionfs-fuse || true ) ;; - overlayfs) - # XXX: can multiple unionro be used? (overlayfs only handles two dirs, but perhaps they can be chained?) - # XXX: and can unionro be optional? i.e. can overlayfs skip lowerdir? + 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 overlayfs (unionro = ${unionro})." + panic "Multiple lower filesystems are currently not supported with overlay (unionro = ${unionro})." elif [ -z "${unionro}" ] then - panic "Overlayfs needs at least one lower filesystem (read-only branch)." + panic "overlay needs at least one lower filesystem (read-only branch)." fi - 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}" + # overlayfs requires: + # + a workdir to become mounted + # + workdir and upperdir to reside under the same mount + # + workdir and upperdir to be in separate directories + mkdir "${unionrw}/rw" + mkdir "${unionrw}/work" + unionmountopts="-o noatime,lowerdir=${unionro},upperdir=${unionrw}/rw,workdir=${unionrw}/work" ;; esac + + mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}" } get_custom_mounts () @@ -1415,7 +1397,7 @@ get_custom_mounts () union|bind) ;; *) - log_warning_msg "Skipping custom mount with unkown option: ${opt}" + log_warning_msg "Skipping custom mount with unknown option: ${opt}" continue 2 ;; esac