Replace Gummiboot with systemd-boot.

main
Teo Mrnjavac 10 years ago
parent 8dc90d0cca
commit 7dd4104009

@ -1,15 +1,15 @@
--- ---
# Define which bootloader you want to use for EFI installations # Define which bootloader you want to use for EFI installations
# Possible options are 'grub' and 'gummiboot'. # Possible options are 'grub' and 'systemd-boot'.
efiBootLoader: "grub" efiBootLoader: "grub"
# Gummiboot 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: "/vmlinuz-linux" kernel: "/vmlinuz-linux"
img: "/initramfs-linux.img" img: "/initramfs-linux.img"
fallback: "/initramfs-linux-fallback.img" fallback: "/initramfs-linux-fallback.img"
timeout: "10" timeout: "10"
# Optionally set the menu entry name and kernel name to use in Gummiboot. # 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: "Generic GNU/Linux" # bootloaderEntryName: "Generic GNU/Linux"
# kernelLine: ", with Stable-Kernel" # kernelLine: ", with Stable-Kernel"

@ -77,8 +77,8 @@ def get_kernel_line(kernel_type):
return "" return ""
def create_conf(uuid, conf_path, kernel_line): def create_systemd_boot_conf(uuid, conf_path, kernel_line):
""" Creates gummiboot configuration files based on given parameters. """ Creates systemd-boot configuration files based on given parameters.
:param uuid: :param uuid:
:param conf_path: :param conf_path:
@ -129,12 +129,12 @@ def create_loader(loader_path):
f.close() f.close()
def install_gummiboot(efi_directory): def install_systemd_boot(efi_directory):
""" Installs gummiboot as bootloader for EFI setups. """ Installs systemd-boot as bootloader for EFI setups.
:param efi_directory: :param efi_directory:
""" """
print("Bootloader: gummiboot") print("Bootloader: systemd-boot")
install_path = libcalamares.globalstorage.value("rootMountPoint") install_path = libcalamares.globalstorage.value("rootMountPoint")
install_efi_directory = install_path + efi_directory install_efi_directory = install_path + efi_directory
fallback_kernel_line = libcalamares.job.configuration["fallbackKernelLine"] fallback_kernel_line = libcalamares.job.configuration["fallbackKernelLine"]
@ -150,13 +150,13 @@ def install_gummiboot(efi_directory):
"{!s}-fallback.conf".format(distribution_translated)) "{!s}-fallback.conf".format(distribution_translated))
loader_path = os.path.join( loader_path = os.path.join(
install_efi_directory, "loader", "loader.conf") install_efi_directory, "loader", "loader.conf")
subprocess.call(["gummiboot", "--path={!s}".format(install_efi_directory), "install"]) subprocess.call(["bootctl", "--path={!s}".format(install_efi_directory), "install"])
kernel_line = get_kernel_line("default") kernel_line = get_kernel_line("default")
print("Configure: \"{!s}\"".format(kernel_line)) print("Configure: \"{!s}\"".format(kernel_line))
create_conf(uuid, conf_path, kernel_line) create_systemd_boot_conf(uuid, conf_path, kernel_line)
kernel_line = get_kernel_line("fallback") kernel_line = get_kernel_line("fallback")
print("Configure: \"{!s}\"".format(kernel_line)) print("Configure: \"{!s}\"".format(kernel_line))
create_conf(uuid, fallback_path, kernel_line) create_systemd_boot_conf(uuid, fallback_path, kernel_line)
create_loader(loader_path) create_loader(loader_path)
@ -200,7 +200,7 @@ def install_grub(efi_directory, fw_type):
def prepare_bootloader(fw_type): def prepare_bootloader(fw_type):
""" Prepares bootloader and set proper flags to EFI boot partition (esp,boot). """ Prepares bootloader and set proper flags to EFI boot partition (esp,boot).
Based on value 'efi_boot_loader', it either calls gummiboot or grub to be installed. Based on value 'efi_boot_loader', it either calls systemd-boot or grub to be installed.
:param fw_type: :param fw_type:
:return: :return:
@ -226,8 +226,8 @@ def prepare_bootloader(fw_type):
print("Boot device: \"{!s}\"".format(device)) print("Boot device: \"{!s}\"".format(device))
print("Set 'EF00' flag") print("Set 'EF00' flag")
subprocess.call(["sgdisk", "--typecode={!s}:EF00".format(boot_p), "{!s}".format(device)]) subprocess.call(["sgdisk", "--typecode={!s}:EF00".format(boot_p), "{!s}".format(device)])
if (efi_boot_loader == "gummiboot" and fw_type == "efi"): if (efi_boot_loader == "systemd-boot" and fw_type == "efi"):
install_gummiboot(efi_directory) install_systemd_boot(efi_directory)
else: else:
install_grub(efi_directory, fw_type) install_grub(efi_directory, fw_type)

Loading…
Cancel
Save