[bootloader] merge with upstream master branch
This commit is contained in:
parent
2e07c28db0
commit
f5fa62feef
@ -5,23 +5,31 @@ efiBootLoader: "grub"
|
|||||||
|
|
||||||
# systemd-boot configuration files settings, set kernel and initramfs file names
|
# systemd-boot configuration files settings, set kernel and initramfs file names
|
||||||
# and amount of time before default selection boots
|
# and amount of time before default selection boots
|
||||||
kernel: "_ALL_kver_"
|
kernel: "/vmlinuz-linux"
|
||||||
img: "_default_image_"
|
img: "/initramfs-linux.img"
|
||||||
fallback: "_fallback_image_"
|
fallback: "/initramfs-linux-fallback.img"
|
||||||
timeout: "10"
|
timeout: "10"
|
||||||
# Optionally set the menu entry name and kernel name to use in systemd-boot.
|
# Optionally set the menu entry name and kernel name to use in systemd-boot.
|
||||||
# If not specified here, these settings will be taken from branding.desc.
|
# If not specified here, these settings will be taken from branding.desc.
|
||||||
# bootloaderEntryName: "Manjaro"
|
# bootloaderEntryName: "Generic GNU/Linux"
|
||||||
kernelLine: ", with _manjaro_kernel_"
|
# kernelLine: ", with Stable-Kernel"
|
||||||
fallbackKernelLine: ", with _manjaro_kernel_ (fallback initramfs)"
|
# fallbackKernelLine: ", with Stable-Kernel (fallback initramfs)"
|
||||||
|
|
||||||
# GRUB 2 binary names and boot directory
|
# GRUB 2 binary names and boot directory
|
||||||
# Some distributions (e.g. Fedora) use grub2-* (resp. /boot/grub2/) names.
|
# Some distributions (e.g. Fedora) use grub2-* (resp. /boot/grub2/) names.
|
||||||
grubInstall: "grub-install"
|
grubInstall: "grub-install"
|
||||||
grubMkconfig: "grub-mkconfig"
|
grubMkconfig: "grub-mkconfig"
|
||||||
grubCfg: "/boot/grub/grub.cfg"
|
grubCfg: "/boot/grub/grub.cfg"
|
||||||
# Optionally set the --bootloader-id to use for EFI. If not set, this defaults
|
|
||||||
# to the bootloaderEntryName from branding.desc with problematic characters
|
# Optionally set the bootloader ID to use for EFI. This is passed to
|
||||||
# replaced. If an efiBootloaderId is specified here, it is taken to already be a
|
# grub-install --bootloader-id.
|
||||||
# valid directory name, so no such postprocessing is done in this case.
|
#
|
||||||
|
# If not set here, the value from bootloaderEntryName from branding.desc
|
||||||
|
# is used, with problematic characters (space and slash) replaced.
|
||||||
|
#
|
||||||
|
# The ID is also used as a directory name within the EFI environment,
|
||||||
|
# and the bootloader is copied from /boot/efi/EFI/<dirname>/ . When
|
||||||
|
# setting the option here, take care to use only valid directory
|
||||||
|
# names since no sanitizing is done.
|
||||||
|
#
|
||||||
# efiBootloaderId: "dirname"
|
# efiBootloaderId: "dirname"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# === This file is part of Calamares - <http://github.com/calamares> ===
|
# === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
#
|
#
|
||||||
# Copyright 2014, Aurélien Gâteau <agateau@kde.org>
|
# Copyright 2014, Aurélien Gâteau <agateau@kde.org>
|
||||||
# Copyright 2014, Anke Boersma <demm@kaosx.us>
|
# Copyright 2014, Anke Boersma <demm@kaosx.us>
|
||||||
@ -13,6 +13,7 @@
|
|||||||
# Copyright 2017, Alf Gaida <agaida@siduction.org>
|
# Copyright 2017, Alf Gaida <agaida@siduction.org>
|
||||||
# Copyright 2017, Adriaan de Groot <groot@kde.org>
|
# Copyright 2017, Adriaan de Groot <groot@kde.org>
|
||||||
# Copyright 2017, Gabriel Craciunescu <crazy@frugalware.org>
|
# Copyright 2017, Gabriel Craciunescu <crazy@frugalware.org>
|
||||||
|
# Copyright 2017, Ben Green <Bezzy1999@hotmail.com>
|
||||||
#
|
#
|
||||||
# Calamares is free software: you can redistribute it and/or modify
|
# Calamares is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -111,7 +112,7 @@ def create_systemd_boot_conf(uuid, conf_path, kernel_line):
|
|||||||
# - encrypted root sets cryptdevice_params
|
# - encrypted root sets cryptdevice_params
|
||||||
for partition in partitions:
|
for partition in partitions:
|
||||||
has_luks = "luksMapperName" in partition
|
has_luks = "luksMapperName" in partition
|
||||||
if partition["fs"].lower() == "linuxswap" and not has_luks:
|
if partition["fs"] == "linuxswap" and not has_luks:
|
||||||
swap_uuid = partition["uuid"]
|
swap_uuid = partition["uuid"]
|
||||||
|
|
||||||
if partition["mountPoint"] == "/" and has_luks:
|
if partition["mountPoint"] == "/" and has_luks:
|
||||||
@ -235,10 +236,18 @@ def install_grub(efi_directory, fw_type):
|
|||||||
# if the kernel is older than 4.0, the UEFI bitness likely isn't
|
# if the kernel is older than 4.0, the UEFI bitness likely isn't
|
||||||
# exposed to the userspace so we assume a 64 bit UEFI here
|
# exposed to the userspace so we assume a 64 bit UEFI here
|
||||||
efi_bitness = "64"
|
efi_bitness = "64"
|
||||||
bitness_translate = {"32": "--target=i386-efi",
|
|
||||||
"64": "--target=x86_64-efi"}
|
if efi_bitness == "32":
|
||||||
|
efi_target = "i386-efi"
|
||||||
|
efi_grub_file = "grubia32.efi"
|
||||||
|
efi_boot_file = "bootia32.efi"
|
||||||
|
elif efi_bitness == "64":
|
||||||
|
efi_target = "x86_64-efi"
|
||||||
|
efi_grub_file = "grubx64.efi"
|
||||||
|
efi_boot_file = "bootx64.efi"
|
||||||
|
|
||||||
check_target_env_call([libcalamares.job.configuration["grubInstall"],
|
check_target_env_call([libcalamares.job.configuration["grubInstall"],
|
||||||
bitness_translate[efi_bitness],
|
"--target=" + efi_target,
|
||||||
"--efi-directory=" + efi_directory,
|
"--efi-directory=" + efi_directory,
|
||||||
"--bootloader-id=" + efi_bootloader_id,
|
"--bootloader-id=" + efi_bootloader_id,
|
||||||
"--force"])
|
"--force"])
|
||||||
@ -260,19 +269,13 @@ def install_grub(efi_directory, fw_type):
|
|||||||
os.makedirs(install_efi_boot_directory)
|
os.makedirs(install_efi_boot_directory)
|
||||||
|
|
||||||
# Workaround for some UEFI firmwares
|
# Workaround for some UEFI firmwares
|
||||||
efi_file_source = {"32": os.path.join(install_efi_directory_firmware,
|
efi_file_source = os.path.join(install_efi_directory_firmware,
|
||||||
efi_bootloader_id,
|
efi_bootloader_id,
|
||||||
"grubia32.efi"),
|
efi_grub_file)
|
||||||
"64": os.path.join(install_efi_directory_firmware,
|
efi_file_target = os.path.join(install_efi_boot_directory,
|
||||||
efi_bootloader_id,
|
efi_boot_file)
|
||||||
"grubx64.efi")}
|
|
||||||
|
|
||||||
efi_file_target = {"32": os.path.join(install_efi_boot_directory,
|
shutil.copy2(efi_file_source, efi_file_target)
|
||||||
"bootia32.efi"),
|
|
||||||
"64": os.path.join(install_efi_boot_directory,
|
|
||||||
"bootx64.efi")}
|
|
||||||
|
|
||||||
shutil.copy2(efi_file_source[efi_bitness], efi_file_target[efi_bitness])
|
|
||||||
else:
|
else:
|
||||||
print("Bootloader: grub (bios)")
|
print("Bootloader: grub (bios)")
|
||||||
if libcalamares.globalstorage.value("bootLoader") is None:
|
if libcalamares.globalstorage.value("bootLoader") is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user