[pkg-cryptsetup-devel] Bug#898495: cryptsetup: [patch] make failsleep configurable

Chris Lamb lamby at debian.org
Sat May 12 19:10:43 BST 2018


Source: cryptsetup
Version: 2:2.0.2-1
Severity: wishlist
Tags: patch

Hi,

It would be nice if the sleep-on-failure time was configurable, just
like tries=N, etc.

Patch attached.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
diff --git a/debian/initramfs/cryptroot-script b/debian/initramfs/cryptroot-script
index 75299a0..c562eed 100644
--- a/debian/initramfs/cryptroot-script
+++ b/debian/initramfs/cryptroot-script
@@ -73,6 +73,7 @@ parse_options()
 	cryptkey="" # This is only used as an argument to an eventual keyscript
 	cryptkeyslot=""
 	crypttries=3
+	cryptfailsleep=60
 	crypttcrypt=""
 	cryptveracrypt=""
 	cryptrootdev=""
@@ -140,6 +141,14 @@ parse_options()
 				;;
 			esac
 			;;
+		failsleep=*)
+			cryptfailsleep="${x#failsleep=}"
+			case "$cryptfailsleep" in
+			  *[![:digit:].]*)
+				cryptfailsleep=60
+				;;
+			esac
+			;;
 		tcrypt)
 			crypttcrypt="yes"
 			;;
@@ -379,12 +388,10 @@ setup_mapping()
 		break
 	done
 
-	failsleep=60 # make configurable later?
-
 	if [ "$cryptrootdev" = "yes" ] && [ $crypttries -gt 0 ] && [ $count -ge $crypttries ]; then
 		message "cryptsetup ($crypttarget): maximum number of tries exceeded"
-		message "cryptsetup: going to sleep for $failsleep seconds..."
-		sleep $failsleep
+		message "cryptsetup: going to sleep for $cryptfailsleep seconds..."
+		sleep $cryptfailsleep
 		exit 1
 	fi
 


More information about the pkg-cryptsetup-devel mailing list