All of lore.kernel.org
 help / color / mirror / Atom feed
* Detecting running platform (specifically EFI) during runtime?
@ 2013-01-05  9:28 Andrey Borzenkov
  2013-01-05 11:47 ` Keshav P R
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Borzenkov @ 2013-01-05  9:28 UTC (permalink / raw)
  To: grub-devel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Detecting running platform (specifically EFI) during runtime?
  2013-01-05  9:28 Detecting running platform (specifically EFI) during runtime? Andrey Borzenkov
@ 2013-01-05 11:47 ` Keshav P R
  2013-01-07 10:43   ` Colin Watson
  0 siblings, 1 reply; 3+ messages in thread
From: Keshav P R @ 2013-01-05 11:47 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 887 bytes --]

On Sat, Jan 5, 2013 at 2:58 PM, Andrey Borzenkov <arvidjaar@gmail.com>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
> Grub-devel@gnu.org
> 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

[-- Attachment #2: Type: text/html, Size: 2644 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Detecting running platform (specifically EFI) during runtime?
  2013-01-05 11:47 ` Keshav P R
@ 2013-01-07 10:43   ` Colin Watson
  0 siblings, 0 replies; 3+ messages in thread
From: Colin Watson @ 2013-01-07 10:43 UTC (permalink / raw)
  To: grub-devel

On Sat, Jan 05, 2013 at 05:17:18PM +0530, Keshav P R wrote:
> On Sat, Jan 5, 2013 at 2:58 PM, Andrey Borzenkov <arvidjaar@gmail.com>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?
> 
> 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

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,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-07 10:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-05  9:28 Detecting running platform (specifically EFI) during runtime? Andrey Borzenkov
2013-01-05 11:47 ` Keshav P R
2013-01-07 10:43   ` Colin Watson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.