From 9c4819592f4d28ca091d0d2c39e7fdfc39a52de1 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Fri, 17 Feb 2017 16:19:33 +0100 Subject: [PATCH] Improve EFI configuration check in grubcfg. --- src/modules/grubcfg/main.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/modules/grubcfg/main.py b/src/modules/grubcfg/main.py index 1aea140d7..05d86df2a 100644 --- a/src/modules/grubcfg/main.py +++ b/src/modules/grubcfg/main.py @@ -4,7 +4,7 @@ # === This file is part of Calamares - === # # Copyright 2014-2015, Philip Müller -# Copyright 2015, Teo Mrnjavac +# Copyright 2015-2017, Teo Mrnjavac # # Calamares is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,6 +23,7 @@ import libcalamares import os import re + def modify_grub_default(partitions, root_mount_point, distributor): """ Configures '/etc/default/grub' for hibernation and plymouth. @@ -65,7 +66,7 @@ def modify_grub_default(partitions, root_mount_point, distributor): "cryptdevice=UUID={!s}:{!s}".format(partition["luksUuid"], partition["luksMapperName"]), "root=/dev/mapper/{!s}".format(partition["luksMapperName"]) - ] + ] kernel_params = ["quiet"] @@ -162,10 +163,24 @@ def run(): :return: """ - if libcalamares.globalstorage.value("bootLoader") is None: + + fw_type = libcalamares.globalstorage.value("firmwareType") + + if libcalamares.globalstorage.value("bootLoader") is None and fw_type != "efi": return None partitions = libcalamares.globalstorage.value("partitions") + + if fw_type == "efi": + esp_found = False + + for partition in partitions: + if partition["mountPoint"] == libcalamares.globalstorage.value("efiSystemPartition"): + esp_found = True + + if not esp_found: + return None + root_mount_point = libcalamares.globalstorage.value("rootMountPoint") branding = libcalamares.globalstorage.value("branding") distributor = branding["bootloaderEntryName"]