cryptroot: More progress info.

This commit is contained in:
Ole Tange 2022-01-30 16:48:47 +01:00
parent df08db72c7
commit 017d33ac7b

View file

@ -1,5 +1,7 @@
#!/bin/sh
# Search for cryptkey.txt
PREREQ="cryptroot-prepare"
#
@ -171,9 +173,11 @@ setup_mapping() {
echo -n "Searching for cryptkey.txt on available disks... "
local partition
for partition in `cat /proc/partitions |awk '{print $4}'|tail -n +3`; do
if mount /dev/$partition /mnt 2>/dev/null; then
echo -n " $partition"
if mount -oro /dev/"$partition" /mnt 2>/dev/null; then
echo -n "(mounted)"
cat /mnt/cryptkey.txt >> /tmp/cryptkeys.txt 2>/dev/null
umount /dev/$partition
umount /dev/"$partition"
fi
done
echo "done."
@ -182,7 +186,7 @@ setup_mapping() {
if [ -s /tmp/cryptkeys.txt ]; then
local keyfound
keyfound=0
echo Trying keys from cryptkey.txt
echo "Trying keys from cryptkey.txt for opening $CRYPTTAB_SOURCE as $CRYPTTAB_NAME"
for key in `cat /tmp/cryptkeys.txt`; do
if echo -n "$key" | unlock_mapping; then
# Found the key