fix: track whether partitioning is disallowed

This commit is contained in:
oddlama 2022-05-13 21:32:24 +02:00
parent 1dbb0b29d6
commit 4949293ac1
No known key found for this signature in database
GPG Key ID: 14EFE510775FE39A
2 changed files with 5 additions and 1 deletions

View File

@ -27,6 +27,8 @@ USED_ZFS=false
USED_BTRFS=false USED_BTRFS=false
# Flag to track usage of encryption # Flag to track usage of encryption
USED_ENCRYPTION=false 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 # An array of disk related actions to perform
DISK_ACTIONS=() DISK_ACTIONS=()
@ -355,6 +357,8 @@ function create_single_disk_layout() {
# boot=<device> Use the given device as the bios/efi partition. # boot=<device> Use the given device as the bios/efi partition.
# type=[efi|bios] Selects the boot type. Defaults to efi if not given. # type=[efi|bios] Selects the boot type. Defaults to efi if not given.
function create_existing_partitions_layout() { function create_existing_partitions_layout() {
NO_PARTITIONING_OR_FORMATTING=true
local known_arguments=('+swap' '+boot' '?type') local known_arguments=('+swap' '+boot' '?type')
local extra_arguments=() local extra_arguments=()
declare -A arguments; parse_arguments "$@" declare -A arguments; parse_arguments "$@"

View File

@ -707,7 +707,7 @@ function summarize_disk_actions() {
function apply_disk_configuration() { function apply_disk_configuration() {
summarize_disk_actions summarize_disk_actions
if [[ ]]; then if [[ $NO_PARTITIONING_OR_FORMATTING == true ]]; then
elog "You have chosen an existing disk configuration. No devices will" elog "You have chosen an existing disk configuration. No devices will"
elog "actually be re-partitioned or formatted. Please make sure that all" elog "actually be re-partitioned or formatted. Please make sure that all"
elog "devices are already formatted." elog "devices are already formatted."