From fda32f23e8eb6f5771425db965b61cc798b5bd56 Mon Sep 17 00:00:00 2001 From: natemaia Date: Sun, 16 Dec 2018 22:10:52 -0800 Subject: [PATCH] Fix: missing default boot fallback directory name being empty when none exist --- src/archlabs-installer | 2 +- src/lib/boot.sh | 13 ++++++++++--- src/lib/dialogs.sh | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/archlabs-installer b/src/archlabs-installer index 9fae3d4..9e77047 100755 --- a/src/archlabs-installer +++ b/src/archlabs-installer @@ -10,7 +10,7 @@ # immutable globals -readonly VER="1.7.45" # Installer version +readonly VER="1.7.46" # Installer version readonly DIST="ArchLabs" # Linux distributor readonly MNT="/mnt" # Install mountpoint readonly ERR="/tmp/errlog" # Built-in error log diff --git a/src/lib/boot.sh b/src/lib/boot.sh index 1f7a4a5..0632dc0 100644 --- a/src/lib/boot.sh +++ b/src/lib/boot.sh @@ -233,12 +233,19 @@ uefi_boot_fallback() # some UEFI firmware requires a dir in the ESP with a generic bootx64.efi # see: https://wiki.archlinux.org/index.php/GRUB#UEFI - local esp="${MNT}${BMNTS[UEFI-grub]}" - local default="boot" + local esp="${MNT}${BMNTS[$SYS-$BOOTLDR]}" + + local default default="$(find $esp/EFI/ -maxdepth 1 -mindepth 1 -name '[Bb][oO][oO][tT]' -type d)" - default="$(basename $default)" + + if [[ $default ]]; then + default="${default##/*}" + else + default="boot" + fi printf "\n" + if [[ -d $esp/EFI/$default ]]; then rm -rfv $esp/EFI/$default/* else diff --git a/src/lib/dialogs.sh b/src/lib/dialogs.sh index 82b8b46..4bc17f4 100644 --- a/src/lib/dialogs.sh +++ b/src/lib/dialogs.sh @@ -370,7 +370,7 @@ select_wm_or_de() fi # add packages to the main package list - declare -g PACKAGES="$WM_PACKAGES" + PACKAGES="$WM_PACKAGES" } select_login()