Testing for dual boot setup

This commit is contained in:
natemaia 2018-08-27 19:58:55 -07:00
parent 0e51c6ce6a
commit 9bc3c70c5a

View File

@ -198,13 +198,15 @@ install_bootloader() {
if [[ $SYS == 'UEFI' ]]; then
# make sure efivarfs has been mounted
mount -o remount,rw -t efivarfs efivarfs /sys/firmware/efi/efivars >/dev/null 2>&1
BCMDS[$BOOTLDR]="mount -o remount,rw -t efivarfs efivarfs /sys/firmware/efi/efivars; ${BCMDS[$BOOTLDR]}"
mount -o remount,rw -t efivarfs efivarfs $EFI >/dev/null 2>&1
BCMDS[$BOOTLDR]="mount -o remount,rw -t efivarfs efivarfs $EFI; ${BCMDS[$BOOTLDR]}"
# remove old boot entries
local esp="$MNT/boot/efi/EFI/"
[[ ! -d $MNT/boot/efi/EFI && -d $MNT/boot/EFI ]] && esp="$MNT/boot/EFI/"
find $esp -maxdepth 1 -mindepth 1 \( -name '[aA][rR][cC][hH][lL]abs' -o -name '[Bb][oO][oO][tT]' \) -type d -exec rm -rf '{}' \; >/dev/null 2>&1
find $esp -maxdepth 1 -mindepth 1 \
\( -name '[aA][rR][cC][hH][lL]abs' -o -name '[Bb][oO][oO][tT]' \) \
-type d -exec rm -rf '{}' \; >/dev/null 2>&1
fi
# sets up the bootloader config(s) and ${BCMDS[$BOOTLDR]}