From 45ba4a3f1bd92be30dc4c97073bf48cd22d09169 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Mon, 22 Nov 2021 20:25:43 -0500 Subject: Rewrite bootloader selection to allow efistub if advanced flag is set --- archinstall/lib/user_interaction.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index 844f40a4..39e87c02 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -382,14 +382,25 @@ def ask_for_a_timezone(): ) -def ask_for_bootloader() -> str: - bootloader = "systemd-bootctl" - if not has_uefi(): - bootloader = "grub-install" - else: - bootloader_choice = input("Would you like to use GRUB as a bootloader instead of systemd-boot? [y/N] ").lower() - if bootloader_choice == "y": - bootloader = "grub-install" +def ask_for_bootloader(advanced_options=False) -> str: + bootloader = "systemd-bootctl" if has_uefi() else "grub-install" + if has_uefi(): + if not advanced_options: + bootloader_choice = input("Would you like to use GRUB as a bootloader instead of systemd-boot? [y/N] ").lower() + if bootloader_choice == "y": + bootloader = "grub-install" + else: + # We use the common names for the bootloader as the selection, and map it back to the expected values. + choices = ['systemd-boot', 'grub', 'efistub'] + selection = generic_select(choices, f'Choose a bootloader or leave blank to use systemd-boot: ', options_output=True) + if selection != "": + if selection == 'systemd-boot': + bootloader = 'systemd-bootctl' + elif selection == 'grub': + bootloader = 'grub-install' + else: + bootloader = selection + return bootloader -- cgit v1.2.3-70-g09d2