diff options
author | LinkTed <link.ted@mailbox.org> | 2021-06-21 19:15:01 +0200 |
---|---|---|
committer | Jóhann B. Guðmundsson <johannbg@gmail.com> | 2021-06-29 22:00:03 +0000 |
commit | 6610093698db25fda1d584b9771da1e2c2330095 (patch) | |
tree | 03ef5f16ffb4fcef425c863d9d103a1fd8a982ca | |
parent | c7fbc0c8901917baf0d1f0822568e65c6ec00d18 (diff) | |
download | dracut-6610093698db25fda1d584b9771da1e2c2330095.tar.gz |
fix(crypt-gpg): execute --card-status on each try
If the gpg card is not inserted before the --card-status command is
executed then the public key is not linked with the card. Therefore,
the LUKS partition cannot be decrypted. To solve this, the
--card--status command is executed on each try.
-rwxr-xr-x | modules.d/91crypt-gpg/crypt-gpg-lib.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules.d/91crypt-gpg/crypt-gpg-lib.sh b/modules.d/91crypt-gpg/crypt-gpg-lib.sh index 0613803a..88ce16e2 100755 --- a/modules.d/91crypt-gpg/crypt-gpg-lib.sh +++ b/modules.d/91crypt-gpg/crypt-gpg-lib.sh @@ -51,7 +51,7 @@ gpg_decrypt() { fi ask_for_password \ - --cmd "gpg $opts --decrypt $mntp/$keypath" \ + --cmd "GNUPGHOME=$gpghome gpg --card-status --no-tty > /dev/null 2>&1; gpg $opts --decrypt $mntp/$keypath" \ --prompt "${inputPrompt:-Password ($keypath on $keydev for $device)}" \ --tries 3 --tty-echo-off |