Skip to content

Instantly share code, notes, and snippets.

@warewolf
Created December 29, 2013 02:57
Show Gist options
  • Select an option

  • Save warewolf/8166951 to your computer and use it in GitHub Desktop.

Select an option

Save warewolf/8166951 to your computer and use it in GitHub Desktop.
updateme ipxe gist
next-server 192.168.2.1;
# Make sure the iPXE we're loading supports what we need,
# if not load a full-featured version
if exists ipxe.http and exists ipxe.iscsi
and exists ipxe.bzimage and exists ipxe.pxe
and exists ipxe.elf and exists ipxe.menu {
filename "bootstrap.ipxe";
# Still waiting for NFS boot support to be merged
}
elsif exists user-class and option user-class = "iPXE" {
# We're already using iPXE, but not a feature-full version,
# and possibly an out-of-date version from ROM, so load a more
# complete version with native drivers
if exists client-arch {
if option client-arch = 0 {
filename "bin/ipxe.pxe";
} elsif option client-arch = 6 {
filename "bin-i386-efi/snponly.efi";
} elsif option client-arch = 9 {
filename "bin-x86_64-efi/snponly.efi";
} else {
filename "bin/updateme.pxe";
}
}
}
elsif exists user-class and option user-class = "gPXE" {
# If someone has an old version of gPXE burned into their ROM,
# load a more recent iPXE
if exists client-arch {
if option client-arch = 0 {
filename "bin/ipxe.pxe";
} elsif option client-arch = 6 {
filename "bin-i386-efi/snponly.efi";
} elsif option client-arch = 9 {
filename "bin-x86_64-efi/snponly.efi";
} else {
filename "bin/gpxeupdateme.pxe";
}
}
}
else {
# I like to use iPXE-provided drivers, so therefore give ipxe.pxe
# to all non-iPXE clients
# If not all your hardware is supported by iPXE you might want to use
# UNDI or the more unconvential alternative ipxe.kpxe which includes
# all drivers (including UNDI) and will try to reuse UNDI unless it
# finds a native iPXE driver (this behavior has not been confirmed)
if exists client-arch {
if option client-arch = 0 {
filename "bin/ipxe.pxe";
} elsif option client-arch = 6 {
filename "bin-i386-efi/snponly.efi";
} elsif option client-arch = 9 {
filename "bin-x86_64-efi/snponly.efi";
} else {
filename "bin/fallthrough.pxe";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment