|
|
|
@ -11,7 +11,7 @@
|
|
|
|
|
# Copyright 2015-2018, Philip Mueller <philm@manjaro.org>
|
|
|
|
|
# Copyright 2016-2017, Teo Mrnjavac <teo@kde.org>
|
|
|
|
|
# Copyright 2017, Alf Gaida <agaida@siduction.org>
|
|
|
|
|
# Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
|
|
|
|
|
# Copyright 2017-2019, Adriaan de Groot <groot@kde.org>
|
|
|
|
|
# Copyright 2017, Gabriel Craciunescu <crazy@frugalware.org>
|
|
|
|
|
# Copyright 2017, Ben Green <Bezzy1999@hotmail.com>
|
|
|
|
|
#
|
|
|
|
@ -37,6 +37,17 @@ import libcalamares
|
|
|
|
|
from libcalamares.utils import check_target_env_call
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import gettext
|
|
|
|
|
_ = gettext.translation("calamares-python",
|
|
|
|
|
localedir=libcalamares.utils.gettext_path(),
|
|
|
|
|
languages=libcalamares.utils.gettext_languages(),
|
|
|
|
|
fallback=True).gettext
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def pretty_name():
|
|
|
|
|
return _("Install bootloader.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_uuid():
|
|
|
|
|
"""
|
|
|
|
|
Checks and passes 'uuid' to other routine.
|
|
|
|
@ -424,21 +435,16 @@ def run():
|
|
|
|
|
|
|
|
|
|
fw_type = libcalamares.globalstorage.value("firmwareType")
|
|
|
|
|
|
|
|
|
|
if (libcalamares.globalstorage.value("bootLoader") is None
|
|
|
|
|
and fw_type != "efi"):
|
|
|
|
|
if (libcalamares.globalstorage.value("bootLoader") is None and fw_type != "efi"):
|
|
|
|
|
libcalamares.utils.warning( "Non-EFI system, and no bootloader is set." )
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
efi_system_partition = libcalamares.globalstorage.value("efiSystemPartition")
|
|
|
|
|
esp_found = [ p for p in partitions if p["mountPoint"] == efi_system_partition ]
|
|
|
|
|
if not esp_found:
|
|
|
|
|
libcalamares.utils.warning( "EFI system, but nothing mounted on {!s}".format(efi_system_partition) )
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
prepare_bootloader(fw_type)
|
|
|
|
|