diff --git a/archinstall/lib/args.py b/archinstall/lib/args.py index f654345be9..93b7007289 100644 --- a/archinstall/lib/args.py +++ b/archinstall/lib/args.py @@ -185,7 +185,7 @@ def from_config(cls, args_config: dict[str, Any], args: Arguments) -> 'ArchConfi 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 c127186214..7b22c564d1 100644 --- a/archinstall/lib/bootloader/bootloader_menu.py +++ b/archinstall/lib/bootloader/bootloader_menu.py @@ -83,8 +83,8 @@ def _prev_uki(self, item: MenuItem) -> str | None: 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 @@ def _select_bootloader(self, preset: Bootloader | None) -> Bootloader | None: 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 @@ def _select_removable(self, preset: bool) -> bool: + '\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 457d2b3b34..5494ea2281 100644 --- a/archinstall/lib/models/bootloader.py +++ b/archinstall/lib/models/bootloader.py @@ -65,7 +65,7 @@ def from_arg(cls, bootloader: str, skip_boot: bool) -> Bootloader: 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 @@ def json(self) -> dict[str, Any]: 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}'