Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Taylor <dylan@dylanmtaylor.com>2021-11-22 20:25:43 -0500
committerDylan Taylor <dylan@dylanmtaylor.com>2021-11-22 20:25:43 -0500
commit45ba4a3f1bd92be30dc4c97073bf48cd22d09169 (patch)
tree247f822c000a16b2ffc03dce64432114458c1585
parent77e4bf6fa955e1caf0a913a494718930b28decf5 (diff)
Rewrite bootloader selection to allow efistub if advanced flag is set
-rw-r--r--archinstall/lib/user_interaction.py27
-rw-r--r--examples/guided.py2
2 files changed, 20 insertions, 9 deletions
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
diff --git a/examples/guided.py b/examples/guided.py
index 3b2f87b8..e48ad89d 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -124,7 +124,7 @@ def ask_user_questions():
# Ask which boot-loader to use (will only ask if we're in BIOS (non-efi) mode)
if not archinstall.arguments.get("bootloader", None):
- archinstall.arguments["bootloader"] = archinstall.ask_for_bootloader()
+ archinstall.arguments["bootloader"] = archinstall.ask_for_bootloader(archinstall.arguments.get('advanced', False))
if not archinstall.arguments.get('swap', None):
archinstall.arguments['swap'] = archinstall.ask_for_swap()