From fab206b373f68245a97b3aa33e045eb4ed8ac103 Mon Sep 17 00:00:00 2001 From: Blake Romero Date: Wed, 3 Apr 2024 14:18:31 +0100 Subject: Fix incorrect boot size --- README | 4 ++-- install-artix.sh | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README b/README index d5deba0..42a7f1c 100644 --- a/README +++ b/README @@ -40,8 +40,8 @@ CONFIGURATION: - swap_size: defaults to auto, but can be overwritten e.g: 'swap_size=8G'. -- boot_size: defaults to 512M. Can be overwritten - e.g: 'boot_size=1G'. +- boot_size: defaults to 512M. + Set 512M or more if duel-booting; e.g: 'boot_size=1G'. - timezone: a timezone (defined in '/usr/share/zoneinfo/'). - locale: a locale (defined in '/etc/locale.gen'). diff --git a/install-artix.sh b/install-artix.sh index 2ee0fe2..05e95e9 100755 --- a/install-artix.sh +++ b/install-artix.sh @@ -79,9 +79,10 @@ ram_gb=$(bc <<< "${ram_kB} / 1000^2") && swap_size="$(bc <<< "sqrt(${ram_gb}) * 4")G" # Get boot size if using an already created partition -# (note: used for prompt confirmation) +# (note: only used for prompt confirmation) if [[ $duel_boot == true ]]; then - boot_size=$(df -h "${boot}" | awk 'NR==2 {print $2}') + boot_bytes=$(blockdev --getsize64 "${boot}") + boot_size="$(bc <<< "${boot_bytes} / 1000000000")G" fi # Set boot type @@ -96,7 +97,8 @@ else fi # Request confirmation -drive_size=$(df -h "${drive}" | awk 'NR==2 {print $2}') +drive_bytes=$(blockdev --getsize64 "${drive}") +drive_size="$(bc <<< "${drive_bytes} / 1000000000")G" features="" [[ $encrypt == true ]] && features+="encrypt " -- cgit