Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disable options in menu based on CPU
2016-03-16, 18:45
Post: #2
RE: Disable options in menu based on CPU
Here is an example of my ipxe bootstraping script,
as you can see here arch (among other things) is sent to PHP so that the correct menu items can be added to the script (also platform is used for this)

Code:
#!ipxe
set boot-url http://server/pxe
set esc:hex 1b && set esc ${esc:string}[            # ANSI escape character - "^["
set cls ${esc}2J  # ANSI clear screen sequence - "^[[2J"

cpuid --ext 29 && set arch amd64 || set arch x86
set nloc ${netX/busloc}
set menu-url ${boot-url}/pxe.php?mac=${netX/mac:hexraw}&bus=${netX/busid:hexhyp}&loc=${nloc}&id=${pci/${nloc}.0.2}${pci/${nloc}.2.2}-${pci/${nloc}.0x2c.2}${pci/${nloc}.0x2e.2}&chip=${netX/chip:uristring}&ip=${netX/ip}&next-server=${next-server}&arch=${arch}&platform=${platform:uristring}

isset ${vram} && params && set dovram:uint8 1 || set novram:uint8 1
isset ${version} || chain ${boot-url}/ipxe.pxe ||

iseq ${filename} ${boot-url}/pxe.php && || goto notundi
iseq ${version} 1.0.0+ && chain -ar ${boot-url}/ipxe.pxe ||
iseq ${netX/chip} undionly && || goto notundi

echo ${esc}32;1mWe have UNDI: should try upgrade${esc}22;37m
iseq ${netX/busid:hex} 01:14:e4:16:92 && chain -ar ${boot-url}/ipxe.pxe ||
iseq ${netX/busid:hex} 01:14:e4:16:b5 && chain -ar ${boot-url}/ipxe.pxe ||
#iseq ${netX/busid:hex} 01:10:ec:81:68 && chain -ar ${boot-url}/ipxe.pxe ||
#iseq ${netX/busid:hex} 00:14:e4:16:92 && chain -ar ${boot-url}/ipxe.pxe ||
:notundi

iseq ${arch} amd64 && set warch x64 || set warch x86

chain -ar ${menu-url}&boot&hostname=${hostname:uristring} | shell


This do require an extra roundtrip, an alternative would be to add this as an embeded script into ipxe where you use dhcp at the top and then "chain -ar ${filename}&arch=${arch}" at the end, that way you still keep the option to modify filename on the dhcp server but get the arch in the actuall request.

Use GitHub Discussions
VRAM bin
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 - NiKiZe - 2016-03-16 18:45



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