From 5f1f46623efbefc4076f97d32dc6503823e159cc Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sun, 25 Feb 2018 00:07:16 +0100 Subject: [PATCH] decrypt-root-with-usb: Updated to Debian. --- decrypt-root-with-usb/README | 1 + .../initramfs-tools/scripts/local-top/cryptroot | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/decrypt-root-with-usb/README b/decrypt-root-with-usb/README index 6b04dad..0ed89ea 100644 --- a/decrypt-root-with-usb/README +++ b/decrypt-root-with-usb/README @@ -33,6 +33,7 @@ your initramfs, you need to add them by adding to usb_storage nls_utf8 nls_cp437 + nls_ascii vfat fat sd_mod diff --git a/decrypt-root-with-usb/usr/share/initramfs-tools/scripts/local-top/cryptroot b/decrypt-root-with-usb/usr/share/initramfs-tools/scripts/local-top/cryptroot index b473f82..af38f42 100755 --- a/decrypt-root-with-usb/usr/share/initramfs-tools/scripts/local-top/cryptroot +++ b/decrypt-root-with-usb/usr/share/initramfs-tools/scripts/local-top/cryptroot @@ -193,15 +193,18 @@ setup_mapping() if [ -z "$cryptkeyscript" ]; then # Test all devices - mkdir /mnt - echo -n "Searching for cryptkey.txt on available disks... " + mkdir -p /tmp/mnt + echo "Searching for cryptkey.txt on available disks... " for partition in `cat /proc/partitions |awk '{print $4}'|tail -n +3`; do - if mount /dev/$partition /mnt 2>/dev/null; then - cat /mnt/cryptkey.txt >> /tmp/cryptkeys.txt 2>/dev/null + echo Trying /dev/$partition + if mount /dev/$partition /tmp/mnt 2>/dev/null; then + if cat /tmp/mnt/cryptkey.txt >> /tmp/cryptkeys.txt 2>/dev/null; then + echo "Found keys on /dev/$partition" + fi umount /dev/$partition fi done - echo "done." + echo "Done searching." if [ ${cryptsource#/dev/disk/by-uuid/} != $cryptsource ]; then # UUIDs are not very helpful @@ -335,6 +338,7 @@ setup_mapping() rm /tmp/cryptkeys.txt unset key fi + echo Keyfound = "$keyfound" if [ "$keyfound" = "0" ]; then # Fall back to manual entry if ! crypttarget="$crypttarget" cryptsource="$cryptsource" \