From c6d037f95ff52d9cf7fd8580233e80f9c16412a5 Mon Sep 17 00:00:00 2001 From: oddlama Date: Sun, 30 May 2021 02:44:26 +0200 Subject: [PATCH] Create rpool/ROOT dataset automatically, and supply password automatically. --- scripts/functions.sh | 5 ++++- scripts/utils.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index 2570743..6c9e769 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -408,10 +408,13 @@ function format_zfs_standard() { "${extra_args[@]}" \ rpool \ "${devices[@]}" \ + <<< "$GENTOO_INSTALL_ENCRYPTION_KEY" || die "Could not create zfs pool on $devices_desc" + zfs create -o mountpoint=/ rpool/ROOT \ + || die "Could not create zfs dataset 'rpool/ROOT'" zfs create -o mountpoint=/ rpool/ROOT/default \ - || die "Could not create zfs default dataset" + || die "Could not create zfs dataset 'rpool/ROOT/default'" zpool set bootfs=rpool/ROOT/default rpool \ || die "Could not set zfs property bootfs on rpool" } diff --git a/scripts/utils.sh b/scripts/utils.sh index f6386d0..93fd8cb 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -176,7 +176,7 @@ function cache_lsblk_output() { function get_device_by_ptuuid() { local ptuuid="${1,,}" local dev - if [[ -n $CACHED_LSBLK_OUTPUT ]]; then + if [[ -v CACHED_LSBLK_OUTPUT ]]; then dev="$CACHED_LSBLK_OUTPUT" else dev="$(lsblk --all --path --pairs --output NAME,PTUUID,PARTUUID)" \