aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/initramfs
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-05-23 18:04:14 +0200
committerBrian Behlendorf <[email protected]>2021-06-09 13:05:34 -0700
commit11b165cc9bac152c941301831c21afbb44509dbf (patch)
tree8ad670f438b6790f2477d28622faf295693338d3 /contrib/initramfs
parent2dde9202d9a6097f76cdcde0a7ffac14d825b884 (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')
-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 bb7bbb34e..6fcfc64bd 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)"