mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 18:05:36 -04:00
bootloader: Allow overriding the bootloaderEntryName setting.
Allow setting bootloaderEntryName in bootloader.conf. If not specified there, the setting will be taken from branding.desc.
This commit is contained in:
parent
462819060b
commit
ab4d31f1a6
2 changed files with 14 additions and 8 deletions
|
@ -52,9 +52,15 @@ def get_uuid():
|
|||
return ""
|
||||
|
||||
|
||||
def get_bootloader_entry_name():
|
||||
if "bootloaderEntryName" in libcalamares.job.configuration:
|
||||
return libcalamares.job.configuration["bootloaderEntryName"]
|
||||
else:
|
||||
branding = libcalamares.globalstorage.value("branding")
|
||||
return branding["bootloaderEntryName"]
|
||||
|
||||
def create_conf(uuid, conf_path):
|
||||
branding = libcalamares.globalstorage.value("branding")
|
||||
distribution = branding["bootloaderEntryName"]
|
||||
distribution = get_bootloader_entry_name()
|
||||
kernel = libcalamares.job.configuration["kernel"]
|
||||
img = libcalamares.job.configuration["img"]
|
||||
partitions = libcalamares.globalstorage.value("partitions")
|
||||
|
@ -80,8 +86,7 @@ def create_conf(uuid, conf_path):
|
|||
|
||||
|
||||
def create_fallback(uuid, fallback_path):
|
||||
branding = libcalamares.globalstorage.value("branding")
|
||||
distribution = branding["bootloaderEntryName"]
|
||||
distribution = get_bootloader_entry_name()
|
||||
kernel = libcalamares.job.configuration["kernel"]
|
||||
fb_img = libcalamares.job.configuration["fallback"]
|
||||
partitions = libcalamares.globalstorage.value("partitions")
|
||||
|
@ -107,8 +112,7 @@ def create_fallback(uuid, fallback_path):
|
|||
|
||||
|
||||
def create_loader(loader_path):
|
||||
branding = libcalamares.globalstorage.value("branding")
|
||||
distribution = branding["bootloaderEntryName"]
|
||||
distribution = get_bootloader_entry_name()
|
||||
timeout = libcalamares.job.configuration["timeout"]
|
||||
file_name_sanitizer = str.maketrans(" /", "_-")
|
||||
lines = [
|
||||
|
@ -126,8 +130,7 @@ def install_bootloader(boot_loader, fw_type):
|
|||
if fw_type == 'efi':
|
||||
install_path = libcalamares.globalstorage.value("rootMountPoint")
|
||||
uuid = get_uuid()
|
||||
branding = libcalamares.globalstorage.value("branding")
|
||||
distribution = branding["bootloaderEntryName"]
|
||||
distribution = get_bootloader_entry_name()
|
||||
file_name_sanitizer = str.maketrans(" /", "_-")
|
||||
conf_path = os.path.join(
|
||||
install_path, "boot", "loader", "entries", "%s.conf" % distribution.translate(file_name_sanitizer))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue