Skip to content

Commit

Permalink
Check for ESP if systemd-boot selected
Browse files Browse the repository at this point in the history
  • Loading branch information
codefiles committed Dec 3, 2023
1 parent f107104 commit 63bf41e
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions archinstall/lib/global_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ def has_superuser() -> bool:

return list(missing)

def _invalid_configs(self) -> List[str]:
errors = []

if error := self._validate_bootloader():
errors.append(error)

return errors

def _is_config_valid(self) -> bool:
"""
Checks the validity of the current configuration.
Expand Down Expand Up @@ -238,6 +246,11 @@ def _install_text(self):
missing = len(self._missing_configs())
if missing > 0:
return _('Install ({} config(s) missing)').format(missing)

invalid = len(self._invalid_configs())
if invalid > 0:
return _('Install ({} config(s) invalid)').format(invalid)

return _('Install')

def _display_network_conf(self, config: Optional[NetworkConfiguration]) -> str:
Expand Down Expand Up @@ -369,9 +382,16 @@ def _validate_bootloader(self) -> Optional[str]:
if boot_partition is None:
return "Boot partition not found"

if bootloader == Bootloader.Limine:
if boot_partition.fs_type != disk.FilesystemType.Fat32:
return "Limine does not support booting from filesystems other than FAT32"
match bootloader:
case Bootloader.Limine:
if boot_partition.fs_type != disk.FilesystemType.Fat32:
return "Limine does not support booting from filesystems other than FAT32"
case Bootloader.Systemd:
for layout in disk_config.device_modifications:
if layout.get_efi_partition():
break
else:
return "EFI system partition not found"

return None

Expand All @@ -382,8 +402,11 @@ def _prev_install_invalid_config(self) -> Optional[str]:
text += f'- {m}\n'
return text[:-1] # remove last new line

if error := self._validate_bootloader():
return str(_(f"Invalid configuration: {error}"))
if errors := self._invalid_configs():
text = str(_('Invalid configurations:\n'))
for error in errors:
text += f'- {error}\n'
return text[:-1] # remove last new line

return None

Expand Down

0 comments on commit 63bf41e

Please sign in to comment.