From ef5f3a9377e4510a6ecb4687bf34e5a420ae4100 Mon Sep 17 00:00:00 2001 From: Takoda Date: Wed, 4 Sep 2024 18:41:11 -0500 Subject: [PATCH] setup-disk: fix automatic LVM with swap behavior --- setup-disk.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup-disk.in b/setup-disk.in index 47def20..d274e1e 100644 --- a/setup-disk.in +++ b/setup-disk.in @@ -1598,6 +1598,10 @@ else done fi +if [ -z "$SWAP_SIZE" ]; then + SWAP_SIZE=$(find_swap_size $diskdevs) +fi + if [ -n "$diskdevs" ] && [ -z "$DISK_MODE" ]; then resp= disk_is_or_disks_are="disk is" @@ -1626,7 +1630,7 @@ if [ -n "$diskdevs" ] && [ -z "$DISK_MODE" ]; then nolvm) USE_LVM="";; crypt) USE_CRYPT="_crypt" - if [ -n "$SWAP_SIZE" ]; then + if [ "$SWAP_SIZE" -gt 0 ]; then USE_LVM="_lvm" fi ;; @@ -1639,7 +1643,7 @@ if [ -n "$diskdevs" ] && [ -z "$DISK_MODE" ]; then cryptsys) resp=${resp#crypt} USE_CRYPT="_crypt" - if [ -n "$SWAP_SIZE" ]; then + if [ "$SWAP_SIZE" -gt 0 ]; then USE_LVM="_lvm" fi break @@ -1649,10 +1653,6 @@ if [ -n "$diskdevs" ] && [ -z "$DISK_MODE" ]; then DISK_MODE="$resp" fi -if [ -z "$SWAP_SIZE" ]; then - SWAP_SIZE=$(find_swap_size $diskdevs) -fi - if [ -n "$USE_EFI" ] && [ -z "$USE_CRYPT" ] && [ -z "$BOOT_SIZE" ]; then BOOT_SIZE=$(find_efi_size $diskdevs) fi