X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-helpers;h=771ab85aedd9fa9f89e960c179576927b18bb687;hb=9211faa0a71579dcf6c4f193804dd5443bb40bf9;hp=504a3f4e5348709693d6a3b6e6b34e1fbb269ad0;hpb=14c650c9f014b63f688643f948a498b147421739;p=live-boot-grml.git diff --git a/scripts/live-helpers b/scripts/live-helpers index 504a3f4..771ab85 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -34,6 +34,13 @@ get_fstype () local FSTYPE local FSSIZE + # fstype misreports LUKS devices + if is_luks "${1}" + then + /lib/udev/vol_id -t ${1} 2>/dev/null + return + fi + eval $(fstype < ${1}) if [ "${FSTYPE}" != "unknown" ] @@ -171,9 +178,10 @@ setup_loop () do load_keymap - echo -n "Enter passphrase for ${fspath}: " >&6 + echo -n "Enter passphrase for root filesystem: " >&6 read -s passphrase echo "${passphrase}" > /tmp/passphrase + unset passphrase exec 9&6 + echo + echo -n "There was an error decrypting the root filesystem ... Retry? [Y/n] " >&6 read answer - if [ 'no' = "${answer}" ] + if [ "$(echo "${answer}" | cut -b1 | tr A-Z a-z)" = "n" ] then unset answer break @@ -306,3 +315,16 @@ get_mac () echo ${mac} } + +is_luks() +{ + devname="${1}" + if [ -x /sbin/cryptsetup ] + then + /sbin/cryptsetup isLuks "${devname}" 2>/dev/null || ret=${?} + return ${ret} + else + return 1 + fi + +}