New, optional dracut.ipxe configuration

dracut.ipxe boots an initramfs detected in the container image. This
required a few small changes to warewulfd and the wwinit overlay to
accommodate the dracut initramfs configuring the network interface
before wwinit:

- Include .NetDevs in the ipxe configuration template, so that dracut
  can configure interfaces with the correct names.

- Configure NetworkManager to not keep the initramfs configuration, in
  stead applying the configuration found by wwinit.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-04-16 11:00:54 -06:00
parent 18cebb8652
commit 53dae60e20
4 changed files with 56 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ import (
warewulfconf "github.com/warewulf/warewulf/internal/pkg/config"
"github.com/warewulf/warewulf/internal/pkg/container"
"github.com/warewulf/warewulf/internal/pkg/kernel"
"github.com/warewulf/warewulf/internal/pkg/node"
"github.com/warewulf/warewulf/internal/pkg/overlay"
"github.com/warewulf/warewulf/internal/pkg/util"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
@@ -33,6 +34,7 @@ type templateVars struct {
Port string
KernelArgs string
KernelOverride string
NetDevs map[string]*node.NetDevs
}
func ProvisionSend(w http.ResponseWriter, req *http.Request) {
@@ -94,6 +96,7 @@ func ProvisionSend(w http.ResponseWriter, req *http.Request) {
} else if rinfo.stage == "ipxe" {
stage_file = path.Join(conf.Paths.Sysconfdir, "warewulf/ipxe/"+node.Ipxe.Get()+".ipxe")
tstruct := overlay.InitStruct(&node)
tmpl_data = templateVars{
Id: node.Id.Get(),
Cluster: node.ClusterName.Get(),
@@ -104,7 +107,8 @@ func ProvisionSend(w http.ResponseWriter, req *http.Request) {
Hwaddr: rinfo.hwaddr,
ContainerName: node.ContainerName.Get(),
KernelArgs: node.Kernel.Args.Get(),
KernelOverride: node.Kernel.Override.Get()}
KernelOverride: node.Kernel.Override.Get(),
NetDevs: tstruct.NetDevs}
} else if rinfo.stage == "kernel" {
if node.Kernel.Override.Defined() {
stage_file = kernel.KernelImage(node.Kernel.Override.Get())