From a25a696ced39c24c67570ad0c20a8659bc77df52 Mon Sep 17 00:00:00 2001 From: oddlama Date: Wed, 2 Jun 2021 17:25:09 +0200 Subject: [PATCH] Don't access GENTOO_INSTALL_ENCRYPTION_KEY when not using zfs encryption. --- scripts/functions.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index 4c67cce..f021c2f 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -437,12 +437,15 @@ function format_zfs_standard() { ) fi + local zfs_stdin if [[ "$encrypt" == true ]]; then extra_args+=( "-O" "encryption=aes-256-gcm" "-O" "keyformat=passphrase" "-O" "keylocation=prompt" ) + + zfs_stdin="$GENTOO_INSTALL_ENCRYPTION_KEY" fi # dnodesize=legacy might be needed for GRUB2, but auto is preferred for xattr=sa. @@ -459,7 +462,7 @@ function format_zfs_standard() { "${extra_args[@]}" \ rpool \ "${devices[@]}" \ - <<< "$GENTOO_INSTALL_ENCRYPTION_KEY" \ + <<< "$zfs_stdin" \ || die "Could not create zfs pool on $devices_desc" zfs create rpool/ROOT \