X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=components%2F9990-misc-helpers.sh;h=5a4c8b847d915b8217cef212b7e51d8f1f35f2c7;hb=9f0266a0a0e66de04153c4c9caa5e19c92b111c1;hp=42518986f3bad4ea6d060ecde22b2306831a3321;hpb=773bef668749c32f1b01d6fa3e61a251602016f5;p=live-boot-grml.git diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh index 4251898..5a4c8b8 100755 --- a/components/9990-misc-helpers.sh +++ b/components/9990-misc-helpers.sh @@ -150,7 +150,7 @@ check_dev () ISO_DEVICE=$(dirname ${ISO_DEVICE}) [ -b "$ISO_DEVICE" ] && break i=$(($i -1)) - done + done fi if [ "$ISO_DEVICE" = "/" ] @@ -443,6 +443,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 @@ -1097,18 +1103,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 @@ -1640,6 +1646,32 @@ activate_custom_mounts () echo ${used_devices} } +fix_backwards_compatibility () +{ + local device dir opt backing include_list + device=${1} + dir=${2} + opt=${3} + + if [ -n "${PERSISTENCE_READONLY}" ] + then + return + fi + + backing="$(mount_persistence_media ${device})" + if [ -z "${backing}" ] + then + return + fi + + include_list="${backing}/${persistence_list}" + if [ ! -r "${include_list}" ] && [ ! -r "${backing}/${old_persistence_list}" ] + then + echo "# persistence backwards compatibility: +${dir} ${opt},source=." > "${include_list}" + fi +} + is_mountpoint () { directory="$1"