Browse Source

Merge pull request #83 from void-ppc/installer-return

installer.sh: fail validation for EFI systems without proper ESP
Juan RP 5 years ago
parent
commit
5c0cef01da
1 changed files with 14 additions and 9 deletions
  1. 14 9
      installer.sh.in

+ 14 - 9
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 \