mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-28 17:39:23 +03:00
Shellcheck cleanup for initrd scripts
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Kash Pande <kash@tripleback.net> Co-authored-by: Matthew Thode <mthode@mthode.org> Signed-off-by: Kash Pande <kash@tripleback.net> Signed-off-by: Matthew Thode <mthode@mthode.org> Closes #7214
This commit is contained in:
committed by
Brian Behlendorf
parent
7280d58197
commit
41532e5a29
@@ -13,7 +13,7 @@ esac
|
||||
GENERATOR_FILE=/run/systemd/generator/sysroot.mount
|
||||
GENERATOR_EXTENSION=/run/systemd/generator/sysroot.mount.d/zfs-enhancement.conf
|
||||
|
||||
if [ -e "$GENERATOR_FILE" -a -e "$GENERATOR_EXTENSION" ] ; then
|
||||
if [ -e "$GENERATOR_FILE" ] && [ -e "$GENERATOR_EXTENSION" ] ; then
|
||||
# If the ZFS sysroot.mount flag exists, the initial RAM disk configured
|
||||
# it to mount ZFS on root. In that case, we bail early. This flag
|
||||
# file gets created by the zfs-generator program upon successful run.
|
||||
@@ -57,9 +57,9 @@ ZFS_POOL="${ZFS_DATASET%%/*}"
|
||||
|
||||
if import_pool "${ZFS_POOL}" ; then
|
||||
# Load keys if we can or if we need to
|
||||
if [ $(zpool list -H -o feature@encryption $(echo "${ZFS_POOL}" | awk -F\/ '{print $1}')) == 'active' ]; then
|
||||
if [ $(zpool list -H -o feature@encryption $(echo "${ZFS_POOL}" | awk -F\/ '{print $1}')) = 'active' ]; then
|
||||
# if the root dataset has encryption enabled
|
||||
ENCRYPTIONROOT=$(zfs get -H -o value encryptionroot ${ZFS_DATASET})
|
||||
ENCRYPTIONROOT="$(zfs get -H -o value encryptionroot "${ZFS_DATASET}")"
|
||||
if ! [ "${ENCRYPTIONROOT}" = "-" ]; then
|
||||
# decrypt them
|
||||
ask_for_password \
|
||||
|
||||
Reference in New Issue
Block a user