From 1d145f7f0ca70d3bb0ee93441cbb43058cf458d8 Mon Sep 17 00:00:00 2001 From: Daniel Maksymilian Syrnicki Date: Wed, 15 Apr 2026 09:11:58 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20pick=20bootloader=20based=20on=20firmwar?= =?UTF-8?q?e=20(BIOS=20=E2=86=92=20GRUB,=20UEFI=20=E2=86=92=20systemd-boot?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- webinstaller/app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webinstaller/app.py b/webinstaller/app.py index fd35a31..306ecfe 100644 --- a/webinstaller/app.py +++ b/webinstaller/app.py @@ -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"],