From 965570af96cfe7330805dc47a5d9789dceb11794 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 10 Mar 2016 13:37:14 +0100 Subject: [PATCH] Skip installing EFI bootloader if no ESP with mount point is found. --- src/modules/bootloader/main.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/modules/bootloader/main.py b/src/modules/bootloader/main.py index d32c7b44d..3796d7aac 100644 --- a/src/modules/bootloader/main.py +++ b/src/modules/bootloader/main.py @@ -216,13 +216,18 @@ def prepare_bootloader(fw_type): device = boot_device[:-1] if not boot_p or not device: - return ("EFI directory \"{!s}\" not found!", - "Boot partition: \"{!s}\"", - "Boot device: \"{!s}\"".format(efi_directory, boot_p, device)) + return ("EFI directory \"{!s}\" not found!".format(efi_directory), + "Boot partition: \"{!s}\"".format(boot_p), + "Boot device: \"{!s}\"".format(device)) else: print("EFI directory: \"{!s}\"".format(efi_directory)) print("Boot partition: \"{!s}\"".format(boot_p)) print("Boot device: \"{!s}\"".format(device)) + + if not boot_device: + print("WARNING: no EFI system partition or EFI system partition mount point not set.") + print(" >>> no EFI bootloader will be installed <<<") + return None print("Set 'EF00' flag") subprocess.call(["sgdisk", "--typecode={!s}:EF00".format(boot_p), "{!s}".format(device)])