From 42a4ee8472314a697f41a8289596c78b7c5c4404 Mon Sep 17 00:00:00 2001 From: Mintsuki <36459316+mintsuki@users.noreply.github.com> Date: Sat, 27 Dec 2025 14:38:14 +0100 Subject: [PATCH] Make removable location the default for bootloader installation (#4030) Also update the option's description to make it clear that it being enabled is the sane default. --- archinstall/lib/args.py | 2 +- archinstall/lib/bootloader/bootloader_menu.py | 25 +++++++++++++------ archinstall/lib/models/bootloader.py | 8 +++--- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/archinstall/lib/args.py b/archinstall/lib/args.py index f654345b..93b70072 100644 --- a/archinstall/lib/args.py +++ b/archinstall/lib/args.py @@ -185,7 +185,7 @@ class ArchConfig: uki = args_config.get('uki', False) if uki and not bootloader.has_uki_support(): uki = False - arch_config.bootloader_config = BootloaderConfiguration(bootloader=bootloader, uki=uki, removable=False) + arch_config.bootloader_config = BootloaderConfiguration(bootloader=bootloader, uki=uki, removable=True) # deprecated: backwards compatibility audio_config_args = args_config.get('audio_config', None) diff --git a/archinstall/lib/bootloader/bootloader_menu.py b/archinstall/lib/bootloader/bootloader_menu.py index c1271862..7b22c564 100644 --- a/archinstall/lib/bootloader/bootloader_menu.py +++ b/archinstall/lib/bootloader/bootloader_menu.py @@ -83,8 +83,8 @@ class BootloaderMenu(AbstractSubMenu[BootloaderConfiguration]): def _prev_removable(self, item: MenuItem) -> str | None: if item.value: - return tr('Will install to /EFI/BOOT/ (removable location)') - return tr('Will install to standard location with NVRAM entry') + return tr('Will install to /EFI/BOOT/ (removable location, safe default)') + return tr('Will install to custom location with NVRAM entry') @override def run( @@ -114,6 +114,9 @@ class BootloaderMenu(AbstractSubMenu[BootloaderConfiguration]): removable_item.value = False self._bootloader_conf.removable = False else: + if not removable_item.enabled: + removable_item.value = True + self._bootloader_conf.removable = True removable_item.enabled = True return bootloader @@ -147,18 +150,26 @@ class BootloaderMenu(AbstractSubMenu[BootloaderConfiguration]): + '\n\n' + tr('This installs the bootloader to /EFI/BOOT/BOOTX64.EFI (or similar) which is useful for:') + '\n\n • ' + + tr('Firmware that does not properly support NVRAM boot entries like most MSI motherboards,') + + '\n ' + + tr('most Apple Macs, many laptops...') + + '\n • ' + tr('USB drives or other portable external media.') + '\n • ' + tr('Systems where you want the disk to be bootable on any computer.') - + '\n • ' - + tr('Firmware that does not properly support NVRAM boot entries.') + '\n\n' + tr( textwrap.dedent( """\ - This is NOT recommended if none of the above apply, as it makes installing multiple - EFI bootloaders on the same disk more challenging, and it overwrites whatever bootloader - was previously installed on the default removable media search location, if any. + If you do not know what this means, LEAVE THIS OPTION ENABLED, as it is the safe default. + + It is suggested to disable this if none of the above apply, as it makes installing multiple + EFI bootloaders on the same disk easier, and it will not overwrite whatever bootloader + was previously installed at the default removable media search location, if any. + + It may also make the installation more resilient in case of dual-booting with Windows, + as Windows is known to sometimes erase or replace the bootloader installed at the removable + location. """ ) ) diff --git a/archinstall/lib/models/bootloader.py b/archinstall/lib/models/bootloader.py index 457d2b3b..5494ea22 100644 --- a/archinstall/lib/models/bootloader.py +++ b/archinstall/lib/models/bootloader.py @@ -65,7 +65,7 @@ class Bootloader(Enum): class BootloaderConfiguration: bootloader: Bootloader uki: bool = False - removable: bool = False + removable: bool = True def json(self) -> dict[str, Any]: return {'bootloader': self.bootloader.json(), 'uki': self.uki, 'removable': self.removable} @@ -74,12 +74,14 @@ class BootloaderConfiguration: def parse_arg(cls, config: dict[str, Any], skip_boot: bool) -> BootloaderConfiguration: bootloader = Bootloader.from_arg(config.get('bootloader', ''), skip_boot) uki = config.get('uki', False) - removable = config.get('removable', False) + removable = config.get('removable', True) return cls(bootloader=bootloader, uki=uki, removable=removable) @classmethod def get_default(cls) -> BootloaderConfiguration: - return cls(bootloader=Bootloader.get_default(), uki=False, removable=False) + bootloader = Bootloader.get_default() + removable = SysInfo.has_uefi() and bootloader.has_removable_support() + return cls(bootloader=bootloader, uki=False, removable=removable) def preview(self) -> str: text = f'{tr("Bootloader")}: {self.bootloader.value}'