From f4458db134dbc77c78522c18ec19cd55f51d2238 Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 18 Jul 2019 21:06:17 +0200 Subject: [PATCH] installer.sh: fail validation for EFI systems without proper ESP Right now the installer will print an error dialog but mark the filesystems done anyway and march on, which will later result in a failed GRUB installation. --- installer.sh.in | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/installer.sh.in b/installer.sh.in index b5bab03..c2a6f11 100644 --- a/installer.sh.in +++ b/installer.sh.in @@ -952,6 +952,7 @@ menu_network() { validate_filesystems() { local mnts dev size fstype mntpt mkfs rootfound fmt local usrfound efi_system_partition + local bootdev=$(get_option BOOTLOADER) unset TARGETFS mnts=$(grep -E '^MOUNTPOINT.*' $CONF_FILE) @@ -985,10 +986,11 @@ the mount point for the root filesystem (/) has not yet been configured." ${MSGB DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} \ /usr mount point has been configured but is not supported, please remove it to continue." ${MSGBOXSIZE} return 1 - elif [ -n "$EFI_SYSTEM" -a -z "$efi_system_partition" ]; then + elif [ -n "$EFI_SYSTEM" -a "$bootdev" != "none" -a -z "$efi_system_partition" ]; then DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} \ The EFI System Partition has not yet been configured, please create it\n as FAT32, mountpoint /boot/efi and at least with 100MB of size." ${MSGBOXSIZE} + return 1 fi FILESYSTEMS_DONE=1 } @@ -1191,17 +1193,10 @@ enable_dhcpd() { } menu_install() { - # Don't continue if filesystems are not ready. - validate_filesystems || return 1 - ROOTPASSWORD_DONE="$(get_option ROOTPASSWORD)" BOOTLOADER_DONE="$(get_option BOOTLOADER)" - if [ -z "$FILESYSTEMS_DONE" ]; then - DIALOG --msgbox "${BOLD}Required filesystems were not configured, \ -please do so before starting the installation.${RESET}" ${MSGBOXSIZE} - return 1 - elif [ -z "$ROOTPASSWORD_DONE" ]; then + if [ -z "$ROOTPASSWORD_DONE" ]; then DIALOG --msgbox "${BOLD}The root password has not been configured, \ please do so before starting the installation.${RESET}" ${MSGBOXSIZE} return 1 @@ -1211,6 +1206,16 @@ configured, please do so before starting the installation.${RESET}" ${MSGBOXSIZE return 1 fi + # Validate filesystems after making sure bootloader is done, + # so that specific checks can be made based on the selection + validate_filesystems || return 1 + + if [ -z "$FILESYSTEMS_DONE" ]; then + DIALOG --msgbox "${BOLD}Required filesystems were not configured, \ +please do so before starting the installation.${RESET}" ${MSGBOXSIZE} + return 1 + fi + DIALOG --yesno "${BOLD}The following operations will be executed:${RESET}\n\n ${BOLD}${TARGETFS}${RESET}\n ${BOLD}${RED}WARNING: data on partitions will be COMPLETELY DESTROYED for new \