Detecting running platform (specifically EFI) during runtime?
Is it possible to check at run-time on which platform we are running. Specifically, any way to distinguish between EFI and legacy BIOS?
TIA
-andrey
Quoted 12 lines · Andrey Borzenkov
Is it possible to check at run-time on which platform we are running. Specifically, any way to distinguish between EFI and legacy BIOS?
TIA
-andrey
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Something like below should work (requires grub 2.00, not 1.99):
[CODE - part of grub.cfg]
if [ "${grub_platform}" == "efi" ]; then
set _GRUB_PLATFORM="UEFI"
if [ "${grub_cpu}" == "x86_64" ]; then
set _UEFI_ARCH="x64"
fi
if [ "${grub_cpu}" == "i386" ]; then
set _UEFI_ARCH="ia32"
fi
insmod efi_gop
insmod efi_ugafi
if [ "${grub_platform}" == "pc" ]; then
set _GRUB_PLATFORM="BIOS"
insmod vbe
insmod vga
fi
[/CODE]
Regards.
Keshav
Quoted 11 lines · Keshav P R
Quoted 2 lines · Andrey Borzenkov
Is it possible to check at run-time on which platform we are running. Specifically, any way to distinguish between EFI and legacy BIOS?
Something like below should work (requires grub 2.00, not 1.99):
[CODE - part of grub.cfg]
if [ "${grub_platform}" == "efi" ]; thenset _GRUB_PLATFORM="UEFI" if [ "${grub_cpu}" == "x86_64" ]; then
I have now documented the grub_cpu and grub_platform environment variables in docs/grub.texi in trunk. (When explaining something not documented in the manual, please consider whether it would be useful to propose a documentation patch.)
Cheers,
Signature · 1 line
Colin Watson [[email protected]]