[ipxe-devel] [gPXE] native gPXE loading custom gPXE

Michael Brown mbrown at fensystems.co.uk
Thu Sep 29 22:59:08 UTC 2011


On Thursday 29 Sep 2011 17:52:15 Richman, Steven C wrote:
> I am using a modified version of gPXE that allows >256 characters to be
> passed to the kernel command line. gPXE needs to pass a very long string
> of arguments to the kernel command line. I am chain-loading gPXE from PXE.
> DHCP is configured to look for the gpxe.bus-id in the dhcpd.conf file to
> break out of the infinite loop.
> 
> The new Qlogic NICs are coming with gPXE. This poses a problem because it
> doesn't load the custom gPXE (w/Kernel CmdLine patch) because DHCP sees
> that the gpxe.bus-id is already defined so it doesn't hand-out the custom
> gPXE like it does for NICs that PXE boot.
> 
> Is there a known solution for loading a custom (patched) gPXE from gPXE
> (native) without falling into an infinite loop?
>
> Can an attribute be set to tell dhcp to always offer the custom bootloader
> unless the attribute defined in the custom gPXE version is present?

Firstly, upgrade from gPXE to iPXE.

Secondly, you can use the DHCP user-class instead of bus-id:

  http://ipxe.org/howto/dhcpd#pxe_chainloading

You can use an embedded script within your undionly.kpxe binary:

  http://ipxe.org/scripting#embedded_scripts

to override the DHCP user-class transmitted by undionly.kpxe:

  http://ipxe.org/appnote/userclass

For example:

  #!ipxe
  set user-class CustomBootloader
  autoboot

and on your DHCP server:

  if exists user-class and option user-class = "CustomBootloader" {
      filename "http://my.web.server/real_boot_script.php";
  } else {
      filename "undionly.kpxe";
  }

HTH,

Michael



More information about the ipxe-devel mailing list