From f15a91cbe21eab3994b2f55258c5e4f61b35283e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 24 Jul 2026 12:24:30 -0700 Subject: [PATCH] Read the BIOS vendor once in the direct boot setup Co-Authored-By: Claude Opus 5 (1M context) --- bin/omarchy-setup-direct-boot | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/bin/omarchy-setup-direct-boot b/bin/omarchy-setup-direct-boot index ebd618b9..898108ac 100755 --- a/bin/omarchy-setup-direct-boot +++ b/bin/omarchy-setup-direct-boot @@ -13,15 +13,18 @@ if ! efibootmgr &>/dev/null; then exit 1 fi -if cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "American Megatrends"; then - echo "Error: American Megatrends firmware may not safely support custom EFI entries" >&2 - exit 1 -fi +bios_vendor=$(cat /sys/class/dmi/id/bios_vendor 2>/dev/null) -if cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "Apple"; then - echo "Error: Apple firmware uses its own boot manager" >&2 - exit 1 -fi +case "${bios_vendor,,}" in + *"american megatrends"*) + echo "Error: American Megatrends firmware may not safely support custom EFI entries" >&2 + exit 1 + ;; + *apple*) + echo "Error: Apple firmware uses its own boot manager" >&2 + exit 1 + ;; +esac existing_entry=$(efibootmgr | grep -E "^Boot[0-9A-Fa-f]+\*? Omarchy([[:space:]]|$)" | head -1)