diff options
author | наб <[email protected]> | 2021-05-23 18:04:14 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-06-04 14:01:08 -0700 |
commit | b2c68bea50bd6fcf03ea01f045bbfeac8a88eb4e (patch) | |
tree | 505e7319b4b61f750b25e07a8c405eb9ccfe0ec4 /contrib/initramfs/scripts/zfs | |
parent | c38bc221b28a104dc05f825492062638b7f92d86 (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/zfs | 2 |
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)" |