Added loop condition in initcpio hook to be able to unlock encrypted root over SSH

pull/261/head
Arnaud Cordier 7 years ago
parent f9888aad48
commit 11aae3b0e3
  1. 5
      src/zfs-utils/zfs-utils.initcpio.hook

@ -40,8 +40,9 @@ zfs_decrypt_fs() {
# get the encryption root # get the encryption root
encryptionroot=$(zfs get -H -o value encryptionroot "${dataset}") encryptionroot=$(zfs get -H -o value encryptionroot "${dataset}")
# loop until we get the correct password # loop until we get the correct password or key is unlocked by another vector (SSH for instance)
while ! eval zfs load-key "${encryptionroot}"; do while [ "$(zfs get -H -o value keystatus "${encryptionroot}")" != "available" ] &&
! eval zfs load-key "${encryptionroot}"; do
sleep 2 sleep 2
done done
} }

Loading…
Cancel
Save