diff options
author | Christian Hesse <mail@eworm.de> | 2013-10-01 22:18:24 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2013-10-01 22:18:24 +0200 |
commit | d4dd18af2c5672c71e5a01e7ef38d5b15fc3dc92 (patch) | |
tree | af6e8131946fdde89a0c33f3d73fed8edbe10325 /udev/ykfde | |
parent | 9d89a654727af9b37cb8437b017dc7545549e00c (diff) | |
download | mkinitcpio-ykfde-d4dd18af2c5672c71e5a01e7ef38d5b15fc3dc92.tar.gz mkinitcpio-ykfde-d4dd18af2c5672c71e5a01e7ef38d5b15fc3dc92.tar.zst |
use inotifywait to work around race condition
It was passible that the keyfile was created too late, but the password
agent was not ready yet. Work around this by waiting for a new request.
Diffstat (limited to 'udev/ykfde')
-rwxr-xr-x | udev/ykfde | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -10,6 +10,7 @@ source /etc/ykfde.conf ykchalresp -${YKFDE_SLOT:-2} "$(cat /ykfde-challenge)" 2>/dev/null | tr -d '\n' > /crypto_keyfile.bin # if the systemd unit was faster try to answer password agent -for REQUEST in $(grep -l '^Message=Please enter passphrase for disk' /run/systemd/ask-password/ask.*); do +for REQUEST in $(grep -l '^Message=Please enter passphrase for disk' /run/systemd/ask-password/ask.* || \ + inotifywait /run/systemd/ask-password/ 2>/dev/null | awk '{ print $1 $3 }'); do /usr/lib/systemd/systemd-reply-password 1 $(grep '^Socket=' ${REQUEST} | cut -d= -f2) < /crypto_keyfile.bin done |