diff --git a/internal/pkg/config/tftp.go b/internal/pkg/config/tftp.go index ca368414..1c898e39 100644 --- a/internal/pkg/config/tftp.go +++ b/internal/pkg/config/tftp.go @@ -9,5 +9,5 @@ type TFTPConf struct { SystemdName string `yaml:"systemd name" default:"tftp"` // Path is relative to buildconfig.DATADIR() - IpxeBinaries map[string]string `yaml:"ipxe" default:"{\"00:09\": \"x86_64.efi\",\"00:00\": \"x86_64.kpxe\",\"00:0B\": \"arm64.efi\",\"00:07\": \"x86_64.efi\"}"` + IpxeBinaries map[string]string `yaml:"ipxe" default:"{\"00:09\": \"ipxe/ipxe-snponly-x86_64.efi\",\"00:00\": \"ipxe/undionly.kpxe\",\"00:0B\": \"ipxe/arm64-efi/snponly.efi\",\"00:07\": \"ipxe/ipxe-snponly-x86_64.efi\"}"` } diff --git a/internal/pkg/configure/tftp.go b/internal/pkg/configure/tftp.go index 1c8da005..6cfb9561 100644 --- a/internal/pkg/configure/tftp.go +++ b/internal/pkg/configure/tftp.go @@ -27,7 +27,7 @@ func TFTP() error { continue } copyCheck[f] = true - err = util.SafeCopyFile(path.Join(controller.Paths.Datadir, f), path.Join(tftpdir, f)) + err = util.SafeCopyFile(path.Join(controller.Paths.Datadir, f), path.Join(tftpdir, path.Base(f))) if err != nil { wwlog.Warn("ipxe binary could not be copied, booting may not work: %s", err) } diff --git a/internal/pkg/overlay/overlay.go b/internal/pkg/overlay/overlay.go index 3754fa9c..0d441cc7 100644 --- a/internal/pkg/overlay/overlay.go +++ b/internal/pkg/overlay/overlay.go @@ -371,6 +371,7 @@ func RenderTemplateFile(fileName string, data TemplateStruct) ( "Include": templateFileInclude, "IncludeFrom": templateContainerFileInclude, "IncludeBlock": templateFileBlock, + "basename": path.Base, "inc": func(i int) int { return i + 1 }, "dec": func(i int) int { return i - 1 }, "file": func(str string) string { return fmt.Sprintf("{{ /* file \"%s\" */ }}", str) }, diff --git a/overlays/host/etc/dhcp/dhcpd.conf.ww b/overlays/host/etc/dhcp/dhcpd.conf.ww index 66b9d22e..4a9637f7 100644 --- a/overlays/host/etc/dhcp/dhcpd.conf.ww +++ b/overlays/host/etc/dhcp/dhcpd.conf.ww @@ -22,7 +22,7 @@ if exists user-class and option user-class = "iPXE" { } else { {{range $type,$name := $.Tftp.IpxeBinaries }} if option architecture-type = {{ $type }} { - filename "/warewulf/{{ $name }}"; + filename "/warewulf/{{ basename $name }}"; } {{ end }} }