Don't access GENTOO_INSTALL_ENCRYPTION_KEY when not using zfs encryption.

This commit is contained in:
oddlama 2021-06-02 17:25:09 +02:00
parent b51f8daae9
commit a25a696ced
No known key found for this signature in database
GPG Key ID: 14EFE510775FE39A
1 changed files with 4 additions and 1 deletions

View File

@ -437,12 +437,15 @@ function format_zfs_standard() {
) )
fi fi
local zfs_stdin
if [[ "$encrypt" == true ]]; then if [[ "$encrypt" == true ]]; then
extra_args+=( extra_args+=(
"-O" "encryption=aes-256-gcm" "-O" "encryption=aes-256-gcm"
"-O" "keyformat=passphrase" "-O" "keyformat=passphrase"
"-O" "keylocation=prompt" "-O" "keylocation=prompt"
) )
zfs_stdin="$GENTOO_INSTALL_ENCRYPTION_KEY"
fi fi
# dnodesize=legacy might be needed for GRUB2, but auto is preferred for xattr=sa. # dnodesize=legacy might be needed for GRUB2, but auto is preferred for xattr=sa.
@ -459,7 +462,7 @@ function format_zfs_standard() {
"${extra_args[@]}" \ "${extra_args[@]}" \
rpool \ rpool \
"${devices[@]}" \ "${devices[@]}" \
<<< "$GENTOO_INSTALL_ENCRYPTION_KEY" \ <<< "$zfs_stdin" \
|| die "Could not create zfs pool on $devices_desc" || die "Could not create zfs pool on $devices_desc"
zfs create rpool/ROOT \ zfs create rpool/ROOT \