Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detect if bios or uefi possible?
2016-01-02, 08:34
Post: #2
RE: Detect if bios or uefi possible?
(2015-12-04 01:46)layzer253 Wrote:  Is there a function similar to how you can check if you are booted via BIOS or UEFI in a menu simliar to how you can check cpu architecture? My current setup is 2 different static menus, one for each boot mode as certain options dont work in UEFI. I am using dual boot usb sticks via syslinux>ipxe.lkrn and ipxe renamed to BOOTX64.EFI so that way I can support as many different models of computers as possible.

You can use the 'platform' function/command to test if a client is booted in Legacy or EFI, http://ipxe.org/cfg/platform
Code:
iseq ${platform} efi && goto is_efi || goto not_efi

I also had separate menus for both types, but got tired of updating two files whenever i make a simple change or added something, so now i have one menu, and if a certain program needs doesn't support EFI or needs some special option i use, IMO this is batter then having separate files.
Here's an example:

Code:
:rhel67
iseq ${platform} efi && goto rhel67_efi || goto rhel67_legacy

    :rhel67-efi
    echo Starting RHEL 6.7 Server x64 (EFI)
    chain ${tftp-server}/grub2-efi/rhel67server/bootx64.efi || goto rhel67-efi

    :rhel67-legacy
    echo Starting RHEL 6.7 Server x64 (EFI)
    set repo ${http-images}/iso_images/rhel/rhel67_server
    kernel ${repo}/isolinux/vmlinuz || goto rhel67-legacy
    initrd ${repo}/isolinux/initrd.img
    boot || goto failed
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Detect if bios or uefi possible? - silver310 - 2016-01-02 08:34



User(s) browsing this thread: 1 Guest(s)