Skip to content

Commit

Permalink
feature: add support for rpi4
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Hellemun <[email protected]>
  • Loading branch information
OGKevin authored and DSpeichert committed May 26, 2021
1 parent 8b141d3 commit 7f8084a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions dhcpd/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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"))
Expand Down
2 changes: 1 addition & 1 deletion static/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file added static/ipxe_arm64.efi
Binary file not shown.

0 comments on commit 7f8084a

Please sign in to comment.