From 17148dc99585d0885f025dbef76aa0950e71cdf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Canek=20Pel=C3=A1ez=20Vald=C3=A9s?= Date: Sat, 12 Mar 2016 16:22:14 -0600 Subject: [PATCH] kerninst: Guard against empty /boot. --- kerninst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kerninst b/kerninst index e3db64e..7998ba9 100644 --- a/kerninst +++ b/kerninst @@ -43,6 +43,16 @@ if [ "${KERNEL_VERSION}" == "" ] || [[ "${KERNEL_VERSION}" =~ \ |\' ]]; then exit 1 fi +if [ "${BOOT_MANAGER}" == "grub" ] && [ ! -d "/boot/grub" ]; then + kerror "Grub does not seem to be installed or /boot is not mounted." + exit 1 +fi + +if [ "${BOOT_MANAGER}" == "bootctl" ] && [ ! -d "/boot/EFI" ]; then + kerror "Bootctl does not seem to be installed or /boot is not mounted." + exit 1 +fi + function die() { kerror "An error ocurred. Exiting." exit 1 -- GitLab