[Pkg-cryptsetup-devel] Bug#430158: Bug#430158: closed by Jonas Meurer <jonas at freesources.org> (closing because of inactivity)

Helmut Grohne helmut at subdivi.de
Sat Feb 16 17:53:59 UTC 2008


Hi,

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

May I propose a different patch and try that instead?

> 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

I aggree with this until now.

> @@ -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"

The retry management basically happened below in the previous version:
Line 181:
	count=0
	while [ $count -lt 3]; do

I therefore suggest to reuse that management (or throw it away
completely), because your patch will only allow for multiples of 3 tries
this way.

My patch is attached (really, no second mail :-p). If you like to use
the trial management from cryptsetup, it would be great if you could
clean the cryptroot script and send me a new patch.

Helmut
-------------- next part --------------
A non-text attachment was scrubbed...
Name: helmuts.patch
Type: text/x-diff
Size: 696 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-cryptsetup-devel/attachments/20080216/0330a14d/attachment.patch 


More information about the Pkg-cryptsetup-devel mailing list