X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-helpers;h=203ee4c524ce3a782cb3b01266a3f5fef8bfa50f;hb=ee0a58653ae3c8909984712be9cdcda6d59ed259;hp=504a3f4e5348709693d6a3b6e6b34e1fbb269ad0;hpb=14c650c9f014b63f688643f948a498b147421739;p=live-boot-grml.git diff --git a/scripts/live-helpers b/scripts/live-helpers index 504a3f4..203ee4c 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -34,6 +34,13 @@ get_fstype () local FSTYPE local FSSIZE + # fstype misreports LUKS devices + is_luks "${1}" + if [ $? -eq 0 ]; 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 + return $? + else + return 1 + fi + +}