Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disable options in menu based on CPU
2016-03-16, 19:07
Post: #3
RE: Disable options in menu based on CPU
(2016-03-16 18:30)Fimlore Wrote:  However, somehow I need to provide the architecture while calling the PHP script; or I need an if statement in ipxe to not display the item.

You can use the ${buildarch} and ${platform} variables in iPXE. For example, with the standard 32-bit BIOS version of iPXE you would get ${buildarch}="i386" and ${platform}="pcbios".

You can pass these to the server (e.g. "http://10.168.51.5/bmenu.php?arch=${buildarch}-${platform}"), or you can use them in client-side tests. For example: to conditionally include a menu item to run the UEFI shell, which will appear only if running the UEFI version of iPXE:

Code:
iseq ${platform} efi && item --key e uefishell UEFI shell ||

Note that ${buildarch} is the architecture for which iPXE was built, not the architecture of the CPU on which iPXE is currently running. In a standard 32-bit BIOS build of iPXE, ${buildarch} will be "i386" even if the CPU itself can run both 32-bit and 64-bit code. You need to use the cpuid command if you want to do a runtime check to see if the CPU is 64-bit-capable.

Michael
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Disable options in menu based on CPU - mcb30 - 2016-03-16 19:07



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