From 81fbed5acf561320d856017efdd7b593e62d8539 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 24 Dec 2017 19:28:41 -0800 Subject: [PATCH] Also check foor bzImage support in the ProxyDHCP stage. #51 Virtualbox inexplicably ships with an iPXE image that knows how to speak HTTP, but cannot handle bzImage files. This is a quick and dirty fix for that specific issue, while I work on the more permanent fix of always chainloading into a known good iPXE. --- pixiecore/dhcp.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pixiecore/dhcp.go b/pixiecore/dhcp.go index 0a8251c..6a21428 100644 --- a/pixiecore/dhcp.go +++ b/pixiecore/dhcp.go @@ -121,6 +121,7 @@ func (s *Server) validateDHCP(pkt *dhcp4.Packet) (mach Machine, isIpxe bool, fwt } // iPXE options + supportsHTTP, supportsBzImage := false, false if len(pkt.Options[175]) > 0 { bs := pkt.Options[175] for len(bs) > 0 { @@ -129,14 +130,18 @@ func (s *Server) validateDHCP(pkt *dhcp4.Packet) (mach Machine, isIpxe bool, fwt } switch bs[0] { case 19: - // This iPXE build supports HTTP, so is appropriate - // for going straight into the OS kernel, no need to - // chainload our own. - isIpxe = true + // This iPXE build supports HTTP. + supportsHTTP = true + case 24: + // This iPXE build supports bzImage. + supportsBzImage = true } bs = bs[2+int(bs[1]):] } } + // This firmware is an appropriate iPXE if it can speak HTTP and + // bzImage. If not, we'll chainload our own internal iPXE. + isIpxe = supportsHTTP && supportsBzImage mach.MAC = pkt.HardwareAddr mach.Arch = fwToArch[fwtype]