48 lines
1.5 KiB
Plaintext
48 lines
1.5 KiB
Plaintext
#!ipxe
|
|
{{ if .ContainerName }}
|
|
echo
|
|
echo ================================================================================
|
|
echo Warewulf v4 now booting via dracut: {{.Fqdn}} ({{.Hwaddr}})
|
|
echo
|
|
echo Container: {{.ContainerName}}
|
|
{{if .KernelVersion }}
|
|
echo Kernel: {{.KernelVersion}}
|
|
{{else}}
|
|
echo Kernel: {{.ContainerName}} (container default)
|
|
{{end}}
|
|
echo KernelArgs: {{.KernelArgs}}
|
|
echo
|
|
|
|
set baseuri http://{{.Ipaddr}}:{{.Port}}/provision/{{.Hwaddr}}
|
|
set uri ${baseuri}?assetkey=${asset}&uuid=${uuid}
|
|
echo Warewulf Controller: {{.Ipaddr}}
|
|
|
|
echo Downloading Kernel Image:
|
|
kernel --name kernel ${uri}&stage=kernel || goto reboot
|
|
|
|
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.uri=${baseuri} init=/init
|
|
|
|
echo Booting initramfs
|
|
boot kernel initrd=initramfs ${dracut_net} ${dracut_wwinit} wwid={{.Hwaddr}} {{.KernelArgs}}
|
|
|
|
|
|
:reboot
|
|
echo
|
|
echo There was an error, rebooting in 15s...
|
|
echo
|
|
sleep 15
|
|
reboot
|
|
{{ else }}
|
|
echo ================================================================================
|
|
echo Warewulf v4:
|
|
echo No node image/container defined for this node ({{.Fqdn}}).
|
|
echo Rebooting in 30s.
|
|
echo ================================================================================
|
|
sleep 30
|
|
reboot
|
|
{{ end }}
|