Merge pull request #83 from void-ppc/installer-return
installer.sh: fail validation for EFI systems without proper ESP
This commit is contained in:
commit
5c0cef01da
@ -952,6 +952,7 @@ menu_network() {
|
|||||||
validate_filesystems() {
|
validate_filesystems() {
|
||||||
local mnts dev size fstype mntpt mkfs rootfound fmt
|
local mnts dev size fstype mntpt mkfs rootfound fmt
|
||||||
local usrfound efi_system_partition
|
local usrfound efi_system_partition
|
||||||
|
local bootdev=$(get_option BOOTLOADER)
|
||||||
|
|
||||||
unset TARGETFS
|
unset TARGETFS
|
||||||
mnts=$(grep -E '^MOUNTPOINT.*' $CONF_FILE)
|
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} \
|
DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} \
|
||||||
/usr mount point has been configured but is not supported, please remove it to continue." ${MSGBOXSIZE}
|
/usr mount point has been configured but is not supported, please remove it to continue." ${MSGBOXSIZE}
|
||||||
return 1
|
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} \
|
DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} \
|
||||||
The EFI System Partition has not yet been configured, please create it\n
|
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}
|
as FAT32, mountpoint /boot/efi and at least with 100MB of size." ${MSGBOXSIZE}
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
FILESYSTEMS_DONE=1
|
FILESYSTEMS_DONE=1
|
||||||
}
|
}
|
||||||
@ -1191,17 +1193,10 @@ enable_dhcpd() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
menu_install() {
|
menu_install() {
|
||||||
# Don't continue if filesystems are not ready.
|
|
||||||
validate_filesystems || return 1
|
|
||||||
|
|
||||||
ROOTPASSWORD_DONE="$(get_option ROOTPASSWORD)"
|
ROOTPASSWORD_DONE="$(get_option ROOTPASSWORD)"
|
||||||
BOOTLOADER_DONE="$(get_option BOOTLOADER)"
|
BOOTLOADER_DONE="$(get_option BOOTLOADER)"
|
||||||
|
|
||||||
if [ -z "$FILESYSTEMS_DONE" ]; then
|
if [ -z "$ROOTPASSWORD_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
|
|
||||||
DIALOG --msgbox "${BOLD}The root password has not been configured, \
|
DIALOG --msgbox "${BOLD}The root password has not been configured, \
|
||||||
please do so before starting the installation.${RESET}" ${MSGBOXSIZE}
|
please do so before starting the installation.${RESET}" ${MSGBOXSIZE}
|
||||||
return 1
|
return 1
|
||||||
@ -1211,6 +1206,16 @@ configured, please do so before starting the installation.${RESET}" ${MSGBOXSIZE
|
|||||||
return 1
|
return 1
|
||||||
fi
|
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
|
DIALOG --yesno "${BOLD}The following operations will be executed:${RESET}\n\n
|
||||||
${BOLD}${TARGETFS}${RESET}\n
|
${BOLD}${TARGETFS}${RESET}\n
|
||||||
${BOLD}${RED}WARNING: data on partitions will be COMPLETELY DESTROYED for new \
|
${BOLD}${RED}WARNING: data on partitions will be COMPLETELY DESTROYED for new \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user