Read the BIOS vendor once in the direct boot setup
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
8d6ea817dd
commit
f15a91cbe2
@@ -13,15 +13,18 @@ if ! efibootmgr &>/dev/null; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "American Megatrends"; then
|
bios_vendor=$(cat /sys/class/dmi/id/bios_vendor 2>/dev/null)
|
||||||
echo "Error: American Megatrends firmware may not safely support custom EFI entries" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "Apple"; then
|
case "${bios_vendor,,}" in
|
||||||
echo "Error: Apple firmware uses its own boot manager" >&2
|
*"american megatrends"*)
|
||||||
exit 1
|
echo "Error: American Megatrends firmware may not safely support custom EFI entries" >&2
|
||||||
fi
|
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)
|
existing_entry=$(efibootmgr | grep -E "^Boot[0-9A-Fa-f]+\*? Omarchy([[:space:]]|$)" | head -1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user