On 16/02/2008 To Helmut Grohne wrote:
> argh, you're right again. initramfs stuff doesn't support --tries yet.
> Could you try the following patch against
> /usr/share/initramfs//usr/share/initramfs-tools/scripts/local-top/cryptroot
> regenerate your initramfs (update-initramfs -u) and see whether this
> works for you? I'm not quite sure that I added all necessary changes, so
> a test by you would be helpful. Unfortunately I've no possibility to
> test this quite now, so I would have to setup a test environment first.

sorry, forgot to actually attach the patch. here it is.

greetings,
 jonas
--- /usr/share/initramfs-tools/scripts/local-top/cryptroot	2008-01-29 11:43:07.000000000 +0100
+++ /usr/share/initramfs-tools/scripts/local-top/cryptroot	2008-02-16 18:27:14.000000000 +0100
@@ -43,6 +43,7 @@
 	cryptlvm=""
 	cryptkeyscript=""
 	cryptkey="" # This is only used as an argument to an eventual keyscript
+	crypttries=3
 
 	local IFS=" ,"
 	for x in $cryptopts; do
@@ -78,6 +79,11 @@
 				cryptkey=${x#key=}
 			fi
 			;;
+		tries=*)
+			if [ "${x#tries=}" -gt 0 ]; then
+				crypttries=${x#tries=}
+			fi
+			;;
 		esac
 	done
 
@@ -170,9 +176,9 @@
 
 	# Prepare commands
 	if /sbin/cryptsetup isLuks $cryptsource > /dev/null 2>&1; then
-		cryptcreate="/sbin/cryptsetup luksOpen $cryptsource $crypttarget"
+		cryptcreate="/sbin/cryptsetup -T $crypttries luksOpen $cryptsource $crypttarget"
 	else
-		cryptcreate="/sbin/cryptsetup -c $cryptcipher -s $cryptsize -h $crypthash create $crypttarget $cryptsource"
+		cryptcreate="/sbin/cryptsetup -T $crypttries -c $cryptcipher -s $cryptsize -h $crypthash create $crypttarget $cryptsource"
 	fi
 	cryptremove="/sbin/cryptsetup remove $crypttarget"
 	NEWROOT="/dev/mapper/$crypttarget"

Reply via email to