forked from warewulf/warewulf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
18cebb8
commit 53dae60
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!ipxe | ||
|
||
echo | ||
echo ================================================================================ | ||
echo Warewulf v4 now booting via dracut: {{.Fqdn}} ({{.Hwaddr}}) | ||
echo | ||
echo Container: {{.ContainerName}} | ||
{{if .KernelOverride }} | ||
echo Kernel: {{.KernelOverride}} | ||
{{else}} | ||
echo Kernel: {{.ContainerName}} (container default) | ||
{{end}} | ||
echo KernelArgs: {{.KernelArgs}} | ||
echo | ||
|
||
set uri http://{{.Ipaddr}}:{{.Port}}/provision/{{.Hwaddr}}?assetkey=${asset}&uuid=${uuid} | ||
echo Warewulf Controller: {{.Ipaddr}} | ||
|
||
echo Downloading Kernel Image: | ||
kernel --name kernel ${uri}&stage=kernel || goto reboot | ||
|
||
{{if ne .KernelOverride ""}} | ||
echo Downloading Kernel Modules: | ||
imgextract --name kmods ${uri}&stage=kmods&compress=gz || initrd --name kmods ${uri}&stage=kmods || goto reboot | ||
set kernel_mods initrd=kmods | ||
{{end}} | ||
|
||
echo Downloading initramfs | ||
initrd --name initramfs ${uri}&stage=initramfs || goto reboot | ||
|
||
set dracut_net rd.neednet=1 {{range $devname, $netdev := .NetDevs}}{{if and $netdev.Hwaddr $netdev.Device}} ifname={{$netdev.Device}}:{{$netdev.Hwaddr}} {{end}}{{end}} | ||
set dracut_wwinit root=wwinit wwinit.container=${uri}&stage=container&compress=gz wwinit.system=${uri}&stage=system&compress=gz wwinit.runtime=${uri}&stage=runtime&compress=gz {{if ne .KernelOverride ""}}wwinit.kmods=${uri}&stage=kmods&compress=gz{{end}} init=/init | ||
|
||
echo Booting initramfs | ||
#echo Network KernelArgs: ${dracut_net} | ||
#echo Dracut wwinit KernelArgs: ${dracut_wwinit} | ||
#sleep 15 | ||
boot kernel initrd=initramfs ${kernel_mods} ${dracut_net} ${dracut_wwinit} wwid={{.Hwaddr}} {{.KernelArgs}} | ||
|
||
|
||
:reboot | ||
echo | ||
echo There was an error, rebooting in 15s... | ||
echo | ||
sleep 15 | ||
reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
overlays/wwinit/rootfs/etc/NetworkManager/conf.d/ww4-discard-configuration.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[device] | ||
keep-configuration=no |