From 4949293ac162f63ef2854b93a1d6f5928c0b33a6 Mon Sep 17 00:00:00 2001 From: oddlama Date: Fri, 13 May 2022 21:32:24 +0200 Subject: [PATCH] fix: track whether partitioning is disallowed --- scripts/config.sh | 4 ++++ scripts/functions.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/config.sh b/scripts/config.sh index 6519aaf..0bc92ef 100644 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -27,6 +27,8 @@ USED_ZFS=false USED_BTRFS=false # Flag to track usage of encryption USED_ENCRYPTION=false +# Flag to track whether partitioning or formatting is forbidden +NO_PARTITIONING_OR_FORMATTING=false # An array of disk related actions to perform DISK_ACTIONS=() @@ -355,6 +357,8 @@ function create_single_disk_layout() { # boot= Use the given device as the bios/efi partition. # type=[efi|bios] Selects the boot type. Defaults to efi if not given. function create_existing_partitions_layout() { + NO_PARTITIONING_OR_FORMATTING=true + local known_arguments=('+swap' '+boot' '?type') local extra_arguments=() declare -A arguments; parse_arguments "$@" diff --git a/scripts/functions.sh b/scripts/functions.sh index 9c11687..42ed4d2 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -707,7 +707,7 @@ function summarize_disk_actions() { function apply_disk_configuration() { summarize_disk_actions - if [[ ]]; then + if [[ $NO_PARTITIONING_OR_FORMATTING == true ]]; then elog "You have chosen an existing disk configuration. No devices will" elog "actually be re-partitioned or formatted. Please make sure that all" elog "devices are already formatted."