Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion archinstall/lib/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
25 changes: 18 additions & 7 deletions archinstall/lib/bootloader/bootloader_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we can keep the hints that help users choose removable=True!

return tr('Will install to custom location with NVRAM entry')

@override
def run(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
"""
)
)
Expand Down
8 changes: 5 additions & 3 deletions archinstall/lib/models/bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}'
Expand Down