Merge pull request #755 from dylanmtaylor/advanced-efistub
Rewrite bootloader selection to allow efistub if advanced flag is set
This commit is contained in:
commit
2be4576c42
|
|
@ -382,14 +382,25 @@ def ask_for_a_timezone():
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def ask_for_bootloader() -> str:
|
def ask_for_bootloader(advanced_options=False) -> str:
|
||||||
bootloader = "systemd-bootctl"
|
bootloader = "systemd-bootctl" if has_uefi() else "grub-install"
|
||||||
if not has_uefi():
|
if has_uefi():
|
||||||
bootloader = "grub-install"
|
if not advanced_options:
|
||||||
else:
|
bootloader_choice = input("Would you like to use GRUB as a bootloader instead of systemd-boot? [y/N] ").lower()
|
||||||
bootloader_choice = input("Would you like to use GRUB as a bootloader instead of systemd-boot? [y/N] ").lower()
|
if bootloader_choice == "y":
|
||||||
if bootloader_choice == "y":
|
bootloader = "grub-install"
|
||||||
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
|
return bootloader
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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)
|
# Ask which boot-loader to use (will only ask if we're in BIOS (non-efi) mode)
|
||||||
if not archinstall.arguments.get("bootloader", None):
|
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):
|
if not archinstall.arguments.get('swap', None):
|
||||||
archinstall.arguments['swap'] = archinstall.ask_for_swap()
|
archinstall.arguments['swap'] = archinstall.ask_for_swap()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue