grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting running platform (specifically EFI) during runtime?


From: Keshav P R
Subject: Re: Detecting running platform (specifically EFI) during runtime?
Date: Sat, 5 Jan 2013 17:17:18 +0530

On Sat, Jan 5, 2013 at 2:58 PM, Andrey Borzenkov <address@hidden> wrote:
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
address@hidden
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_uga
fi

if [ "${grub_platform}" == "pc" ]; then
    set _GRUB_PLATFORM="BIOS"
    
    insmod vbe
    insmod vga
fi
[/CODE]

Regards.

Keshav

reply via email to

[Prev in Thread] Current Thread [Next in Thread]