fix: pick bootloader based on firmware (BIOS → GRUB, UEFI → systemd-boot)
systemd-boot is UEFI-only. Hardcoding it broke the install on BIOS/legacy hosts with HardwareIncompatibilityError in installer._add_systemd_bootloader. Detect via /sys/firmware/efi and fall back to GRUB for BIOS. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
54dd88d4c6
commit
1d145f7f0c
1 changed files with 7 additions and 1 deletions
|
|
@ -450,12 +450,18 @@ def _post_install_commands(hostname):
|
|||
]
|
||||
|
||||
|
||||
def _detect_bootloader():
|
||||
# systemd-boot is UEFI-only; on BIOS/legacy it trips HardwareIncompatibilityError
|
||||
# inside archinstall. /sys/firmware/efi exists iff we were booted via UEFI.
|
||||
return "Systemd-boot" if Path("/sys/firmware/efi").exists() else "Grub"
|
||||
|
||||
|
||||
def build_archinstall_config(s):
|
||||
return {
|
||||
"archinstall-language": "English",
|
||||
"timezone": "Europe/Berlin",
|
||||
"ntp": True,
|
||||
"bootloader": "Systemd-boot",
|
||||
"bootloader": _detect_bootloader(),
|
||||
"disk_config": build_disk_config(s["boot_drive"]),
|
||||
"hostname": s["hostname"],
|
||||
"kernels": ["linux"],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue