Skip to content

Commit 5c0cef0

Browse files
author
Juan RP
authored
Merge pull request #83 from void-ppc/installer-return
installer.sh: fail validation for EFI systems without proper ESP
2 parents 510a4be + f4458db commit 5c0cef0

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

installer.sh.in

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,7 @@ menu_network() {
952952
validate_filesystems() {
953953
local mnts dev size fstype mntpt mkfs rootfound fmt
954954
local usrfound efi_system_partition
955+
local bootdev=$(get_option BOOTLOADER)
955956

956957
unset TARGETFS
957958
mnts=$(grep -E '^MOUNTPOINT.*' $CONF_FILE)
@@ -985,10 +986,11 @@ the mount point for the root filesystem (/) has not yet been configured." ${MSGB
985986
DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} \
986987
/usr mount point has been configured but is not supported, please remove it to continue." ${MSGBOXSIZE}
987988
return 1
988-
elif [ -n "$EFI_SYSTEM" -a -z "$efi_system_partition" ]; then
989+
elif [ -n "$EFI_SYSTEM" -a "$bootdev" != "none" -a -z "$efi_system_partition" ]; then
989990
DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} \
990991
The EFI System Partition has not yet been configured, please create it\n
991992
as FAT32, mountpoint /boot/efi and at least with 100MB of size." ${MSGBOXSIZE}
993+
return 1
992994
fi
993995
FILESYSTEMS_DONE=1
994996
}
@@ -1191,17 +1193,10 @@ enable_dhcpd() {
11911193
}
11921194

11931195
menu_install() {
1194-
# Don't continue if filesystems are not ready.
1195-
validate_filesystems || return 1
1196-
11971196
ROOTPASSWORD_DONE="$(get_option ROOTPASSWORD)"
11981197
BOOTLOADER_DONE="$(get_option BOOTLOADER)"
11991198

1200-
if [ -z "$FILESYSTEMS_DONE" ]; then
1201-
DIALOG --msgbox "${BOLD}Required filesystems were not configured, \
1202-
please do so before starting the installation.${RESET}" ${MSGBOXSIZE}
1203-
return 1
1204-
elif [ -z "$ROOTPASSWORD_DONE" ]; then
1199+
if [ -z "$ROOTPASSWORD_DONE" ]; then
12051200
DIALOG --msgbox "${BOLD}The root password has not been configured, \
12061201
please do so before starting the installation.${RESET}" ${MSGBOXSIZE}
12071202
return 1
@@ -1211,6 +1206,16 @@ configured, please do so before starting the installation.${RESET}" ${MSGBOXSIZE
12111206
return 1
12121207
fi
12131208

1209+
# Validate filesystems after making sure bootloader is done,
1210+
# so that specific checks can be made based on the selection
1211+
validate_filesystems || return 1
1212+
1213+
if [ -z "$FILESYSTEMS_DONE" ]; then
1214+
DIALOG --msgbox "${BOLD}Required filesystems were not configured, \
1215+
please do so before starting the installation.${RESET}" ${MSGBOXSIZE}
1216+
return 1
1217+
fi
1218+
12141219
DIALOG --yesno "${BOLD}The following operations will be executed:${RESET}\n\n
12151220
${BOLD}${TARGETFS}${RESET}\n
12161221
${BOLD}${RED}WARNING: data on partitions will be COMPLETELY DESTROYED for new \

0 commit comments

Comments
 (0)