Files
warewulf/etc/ipxe/default.ipxe
Gregory Kurtzer 6ccc3ceecb Readded compression to the GET request
This works around an out of memory issue reported in IRC from
Norm Gaywood (thanks Norm!)
2022-05-25 23:10:10 -07:00

79 lines
2.4 KiB
Plaintext

#!ipxe
echo
echo ================================================================================
echo Warewulf v4 now booting: {{.Fqdn}} ({{.Hwaddr}})
echo
echo Container: {{.ContainerName}}
{{if .KernelOverride }}
echo Kernel: {{.KernelOverride}}
{{else}}
echo Kernel: {{.ContainerName}} (container default)
{{end}}
echo KernelArgs: {{.KernelArgs}}
echo
set uri_base http://{{.Ipaddr}}:{{.Port}}/provision/{{.Hwaddr}}?assetkey=${asset}&uuid=${uuid}
echo Warewulf Controller: {{.Ipaddr}}
echo Downloading Kernel Image:
kernel --name kernel ${uri_base}&stage=kernel || goto reboot
# try extracting compressed images first
# NOTE: system overlay tends to be the smallest, so failure here is the cheapest
echo Downloading Container Image:
imgextract --name container ${uri_base}&stage=container&compress=gz || goto nocompress
echo Downloading System Overlay:
imgextract --name system ${uri_base}&stage=system&compress=gz || goto reboot
echo Downloading Runtime Overlay:
imgextract --name runtime ${uri_base}&stage=runtime&compress=gz || goto reboot
{{if ne .KernelOverride "" -}}
echo Downloading Kernel Modules:
imgextract --name kmods ${uri_base}&stage=kmods&compress=gz || goto reboot
{{- end}}
goto imoktogo
:nocompress
echo
echo Image extract not supported in this iPXE, using standard initrd mode
echo Downloading Container Image:
initrd --name container ${uri_base}&stage=container&compress=gz || goto reboot
echo Downloading System Overlay:
initrd --name system ${uri_base}&stage=system&compress=gz || goto reboot
echo Downloading Runtime Overlay:
initrd --name runtime ${uri_base}&stage=runtime&compress=gz || goto reboot
{{if ne .KernelOverride "" -}}
echo Downloading Kernel Modules:
initrd --name kmods ${uri_base}&stage=kmods&compress=gz || goto reboot
{{- end}}
:imoktogo
echo Booting in 3s...
{{if ne .KernelOverride "" -}}
echo boot kernel initrd=container initrd=kmods initrd=system initrd=runtime wwid={{.Hwaddr}} {{.KernelArgs}}
sleep 3
boot kernel initrd=container initrd=kmods initrd=system initrd=runtime wwid={{.Hwaddr}} {{.KernelArgs}} || goto reboot
{{- else -}}
echo boot kernel initrd=container initrd=system initrd=runtime wwid={{.Hwaddr}} {{.KernelArgs}}
sleep 3
boot kernel initrd=container initrd=system initrd=runtime wwid={{.Hwaddr}} {{.KernelArgs}} || goto reboot
{{- end}}
:reboot
echo
echo There was an error, rebooting in 15s...
echo
sleep 15
reboot