aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/dracut/90zfs/zfs-load-key.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/dracut/90zfs/zfs-load-key.sh.in')
-rwxr-xr-xcontrib/dracut/90zfs/zfs-load-key.sh.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/dracut/90zfs/zfs-load-key.sh.in b/contrib/dracut/90zfs/zfs-load-key.sh.in
index 3f466798e..88f43b6ed 100755
--- a/contrib/dracut/90zfs/zfs-load-key.sh.in
+++ b/contrib/dracut/90zfs/zfs-load-key.sh.in
@@ -38,6 +38,9 @@ if [ "$(zpool list -H -o feature@encryption $(echo "${BOOTFS}" | awk -F\/ '{prin
# if the root dataset has encryption enabled
ENCRYPTIONROOT=$(zfs get -H -o value encryptionroot "${BOOTFS}")
if ! [ "${ENCRYPTIONROOT}" = "-" ]; then
+ KEYSTATUS="$(zfs get -H -o value keystatus "${ENCRYPTIONROOT}")"
+ # continue only if the key needs to be loaded
+ [ "$KEYSTATUS" = "unavailable" ] || exit 0
# decrypt them
TRY_COUNT=5
while [ $TRY_COUNT -gt 0 ]; do