]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Add timeout option to crypt module
authorNicolas Porcel <nicolasporcel06@gmail.com>
Fri, 18 May 2018 08:49:01 +0000 (10:49 +0200)
committerHarald Hoyer <harald@hoyer.xyz>
Wed, 4 Jul 2018 07:16:50 +0000 (09:16 +0200)
dracut.cmdline.7.asc
modules.d/90crypt/cryptroot-ask.sh

index ada15e9fd9138beac7c29598c0c566a84fd87f3c..2e7f5f23aae40ff4e73c2baff29118f98da72566 100644 (file)
@@ -311,6 +311,11 @@ crypto LUKS
 **rd.luks.crypttab=0**::
     do not check, if LUKS partition is in _/etc/crypttab_
 
+**rd.luks.timeout=**__<seconds>__::
+    specify how long dracut should wait when waiting for the user to enter the
+    password. This avoid blocking the boot if no password is entered. It does
+    not apply to luks key. The default is '0', which means 'forever'.
+
 crypto LUKS - key on removable device support
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 **rd.luks.key=**__<keypath>__:__<keydev>__:__<luksdev>__::
index 9f635eb30c82f201391bbfb90a7513ac2b98a39f..5d63d687111805ae11d651d6d490ced3a0d1bd01 100755 (executable)
@@ -165,12 +165,15 @@ fi
 
 if [ $ask_passphrase -ne 0 ]; then
     luks_open="$(command -v cryptsetup) $cryptsetupopts luksOpen"
+    _timeout=$(getargs "rd.luks.timeout")
+    _timeout=${_timeout:-0}
     ask_for_password --ply-tries 5 \
         --ply-cmd "$luks_open -T1 $device $luksname" \
         --ply-prompt "Password ($device)" \
         --tty-tries 1 \
-        --tty-cmd "$luks_open -T5 $device $luksname"
+        --tty-cmd "$luks_open -T5 -t $_timeout $device $luksname"
     unset luks_open
+    unset _timeout
 fi
 
 unset device luksname luksfile