summarylogtreecommitdiffstats
path: root/plymouth-zfs.initcpio.hook
diff options
context:
space:
mode:
Diffstat (limited to 'plymouth-zfs.initcpio.hook')
-rw-r--r--plymouth-zfs.initcpio.hook5
1 files changed, 4 insertions, 1 deletions
diff --git a/plymouth-zfs.initcpio.hook b/plymouth-zfs.initcpio.hook
index d5950fcad04b..e5afc140d368 100644
--- a/plymouth-zfs.initcpio.hook
+++ b/plymouth-zfs.initcpio.hook
@@ -38,10 +38,13 @@ zfs_decrypt_fs() {
encryptionroot=$(zfs get -H -o value encryptionroot "${dataset}")
# check if key is already loaded
- [ "$(zfs get -H -o value encryption "${dataset}")" != "available" ] || return 0
+ [ "$(zfs get -H -o value keystatus "${dataset}")" != "available" ] || return 0
# finally load the key
plymouth ask-for-password --prompt="Password for ${dataset} dataset" --dont-pause-progress --number-of-tries=5 --command="zfs load-key ${encryptionroot}"
+
+ # retry if key wasn't loaded
+ [ "$(zfs get -H -o value keystatus "${dataset}")" != "available" ] && zfs_decrypt_fs "${dataset}"
}
zfs_mount_handler () {