Skip to content

Commit 613d2ce

Browse files
committed
Made the Bootloader option visible during --skip-boot and set the default value to NO_BOOTLOADER when --skip-boot is present
1 parent 58eda42 commit 613d2ce

4 files changed

Lines changed: 21 additions & 20 deletions

File tree

archinstall/lib/global_menu.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from archinstall.tui.menu_item import MenuItem, MenuItemGroup
1111

1212
from .applications.application_menu import ApplicationMenu
13-
from .args import ArchConfig, arch_config_handler
13+
from .args import ArchConfig
1414
from .authentication.authentication_menu import AuthenticationMenu
1515
from .configuration import save_config
1616
from .hardware import SysInfo
@@ -197,12 +197,6 @@ def _get_menu_options(self) -> list[MenuItem]:
197197
),
198198
]
199199

200-
if arch_config_handler.args.skip_boot:
201-
for index, item in enumerate(menu_options):
202-
if item.text == tr('Bootloader'):
203-
menu_options.pop(index)
204-
break
205-
206200
return menu_options
207201

208202
def _safe_config(self) -> None:
@@ -438,13 +432,7 @@ def _validate_bootloader(self) -> str | None:
438432
boot_partition: PartitionModification | None = None
439433
efi_partition: PartitionModification | None = None
440434

441-
if arch_config_handler.args.skip_boot:
442-
# We only need to do this if statement if we hide
443-
# the bootloader from the menu system, otherwise
444-
# find_by_key() will be able to find it.
445-
bootloader = Bootloader.NO_BOOTLOADER
446-
else:
447-
bootloader = self._item_group.find_by_key('bootloader').value
435+
bootloader = self._item_group.find_by_key('bootloader').value
448436

449437
if disk_config := self._item_group.find_by_key('disk_config').value:
450438
for layout in disk_config.device_modifications:

archinstall/lib/interactions/system_conf.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from archinstall.tui.result import ResultType
77
from archinstall.tui.types import Alignment, FrameProperties, FrameStyle, Orientation, PreviewStyle
88

9+
from ..args import arch_config_handler
910
from ..hardware import GfxDriver, SysInfo
1011
from ..models.bootloader import Bootloader
1112

@@ -47,14 +48,25 @@ def select_kernel(preset: list[str] = []) -> list[str]:
4748

4849
def ask_for_bootloader(preset: Bootloader | None) -> Bootloader | None:
4950
# Systemd is UEFI only
51+
options = []
52+
hidden_options = []
53+
default = None
54+
header = None
55+
56+
if arch_config_handler.args.skip_boot:
57+
default = Bootloader.NO_BOOTLOADER
58+
else:
59+
hidden_options += [Bootloader.NO_BOOTLOADER]
60+
5061
if not SysInfo.has_uefi():
51-
options = [Bootloader.Grub, Bootloader.Limine]
52-
default = Bootloader.Grub
62+
options += [Bootloader.Grub, Bootloader.Limine]
63+
if not default:
64+
default = Bootloader.Grub
5365
header = tr('UEFI is not detected and some options are disabled')
5466
else:
55-
options = [b for b in Bootloader]
56-
default = Bootloader.Systemd
57-
header = None
67+
options += [b for b in Bootloader if b not in hidden_options]
68+
if not default:
69+
default = Bootloader.Systemd
5870

5971
items = [MenuItem(o.value, value=o) for o in options]
6072
group = MenuItemGroup(items)

archinstall/lib/models/bootloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def json(self) -> str:
2828
def values() -> list[str]:
2929
from ..args import arch_config_handler
3030

31-
return [e.value for e in Bootloader if e != Bootloader.NO_BOOTLOADER or arch_config_handler.args.skip_boot]
31+
return [e.value for e in Bootloader if e != Bootloader.NO_BOOTLOADER or arch_config_handler.args.skip_boot is True]
3232

3333
@classmethod
3434
def get_default(cls) -> None | Bootloader:

archinstall/tui/menu_item.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ def get_item_text(self, item: MenuItem) -> str:
196196

197197
max_width = self._max_items_text_width
198198
display_text = item.get_display_value()
199+
199200
default_text = self._default_suffix(item)
200201

201202
text = unicode_ljust(str(item.text), max_width, ' ')

0 commit comments

Comments
 (0)