diff --git a/dhcpd/handler.go b/dhcpd/handler.go index 397e11f..131d965 100644 --- a/dhcpd/handler.go +++ b/dhcpd/handler.go @@ -4,10 +4,12 @@ package dhcpd import ( "errors" + "net" + "strings" + mfest "github.com/DSpeichert/netbootd/manifest" "github.com/insomniacslk/dhcp/dhcpv4" "golang.org/x/net/ipv4" - "net" ) func (server *Server) HandleMsg4(buf []byte, oob *ipv4.ControlMessage, peer net.Addr) { @@ -134,7 +136,11 @@ func (server *Server) HandleMsg4(buf []byte, oob *ipv4.ControlMessage, peer net. resp.Options.Update(dhcpv4.OptBootFileName(manifest.BootFilename)) } else if len(req.ClientArch()) > 0 && req.ClientArch()[0] > 0 { // likely UEFI (not BIOS) - resp.Options.Update(dhcpv4.OptBootFileName("ipxe.efi")) + if strings.Contains(req.ClassIdentifier(), "PXEClient:Arch:00011") { + resp.Options.Update(dhcpv4.OptBootFileName("ipxe_arm64.efi")) + } else { + resp.Options.Update(dhcpv4.OptBootFileName("ipxe.efi")) + } //bootFileSize = 1 } else { resp.Options.Update(dhcpv4.OptBootFileName("undionly.kpxe")) diff --git a/static/files.go b/static/files.go index 1003547..d2cabdb 100644 --- a/static/files.go +++ b/static/files.go @@ -2,5 +2,5 @@ package static import "embed" -//go:embed ipxe.efi undionly.kpxe +//go:embed ipxe.efi undionly.kpxe ipxe_arm64.efi var Files embed.FS diff --git a/static/ipxe_arm64.efi b/static/ipxe_arm64.efi new file mode 100644 index 0000000..562867a Binary files /dev/null and b/static/ipxe_arm64.efi differ