mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
add sanity checks for ROOT DEVICE and ESP
This commit is contained in:
parent
0446d99b0f
commit
b0bf38d4d6
1 changed files with 18 additions and 0 deletions
|
@ -411,6 +411,24 @@ _mkfs() {
|
|||
_dialog --msgbox "Error mounting ${3}${5}" 0 0
|
||||
return 1
|
||||
fi
|
||||
# check if /boot exists on ROOT DEVICE
|
||||
if [[ -z "${_ASK_MOUNTPOINTS}" && "${5}" = "/" && ! -d "${3}${5}/boot" ]]; then
|
||||
_dialog --msgbox "Error: ROOT DEVICE ${3}${5} does not contain /boot directory." 0 0
|
||||
_umountall
|
||||
return 1
|
||||
fi
|
||||
# check on /EFI on /efi mountpoint
|
||||
if [[ -z "${_ASK_MOUNTPOINTS}" && "${5}" = "/efi" && ! -d "${3}${5}/EFI" ]]; then
|
||||
_dialog --msgbox "Error: EFI SYSTEM PARTITION (ESP) ${3}${5} does not contain /EFI directory." 0 0
|
||||
_umountall
|
||||
return 1
|
||||
fi
|
||||
# check on /EFI on /boot
|
||||
if [[ -z "${_ASK_MOUNTPOINTS}" && "${5}" = "/boot" && -n "${_UEFI_BOOT}" && ! $(mountpoint /efi > "${_NO_LOG}") && ! -d "${3}${5}/EFI" ]]; then
|
||||
_dialog --msgbox "Error: EFI SYSTEM PARTITION (ESP) ${3}${5} does not contain /EFI directory." 0 0
|
||||
_umountall
|
||||
return 1
|
||||
fi
|
||||
# btrfs needs balancing on fresh created raid, else weird things could happen
|
||||
[[ "${2}" == "btrfs" && -n "${4}" ]] && btrfs balance start --full-balance "${3}""${5}" &>"${_LOG}"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue