aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/initramfs/scripts/zfs
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-05-23 18:04:14 +0200
committerBrian Behlendorf <[email protected]>2021-06-04 14:01:08 -0700
commitb2c68bea50bd6fcf03ea01f045bbfeac8a88eb4e (patch)
tree505e7319b4b61f750b25e07a8c405eb9ccfe0ec4 /contrib/initramfs/scripts/zfs
parentc38bc221b28a104dc05f825492062638b7f92d86 (diff)
Use %%/* instead of awk -F/ {print $1} to strip datasets
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12108
Diffstat (limited to 'contrib/initramfs/scripts/zfs')
-rw-r--r--contrib/initramfs/scripts/zfs2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs
index 38122594b..cfc099e6c 100644
--- a/contrib/initramfs/scripts/zfs
+++ b/contrib/initramfs/scripts/zfs
@@ -390,7 +390,7 @@ decrypt_fs()
fs="$1"
# If pool encryption is active and the zfs command understands '-o encryption'
- if [ "$(zpool list -H -o feature@encryption "$(echo "${fs}" | awk -F/ '{print $1}')")" = 'active' ]; then
+ if [ "$(zpool list -H -o feature@encryption "${fs%%/*}")" = 'active' ]; then
# Determine dataset that holds key for root dataset
ENCRYPTIONROOT="$(get_fs_value "${fs}" encryptionroot)"