#!ipxe

set attempts:int32 10
set i:int32 0

goto deploy

:deploy
imgfree
kernel --timeout 60000 http://192.168.24.23:8088/d152ff9b-0a5c-4b45-9629-64f4b0c31564/deploy_kernel selinux=0 troubleshoot=0 text nofb nomodeset vga=normal ipa-inspection-collectors=default,pci-devices ipa-inspection-callback-url=http://192.168.24.17:5050/v1/continue ipa-global-request-id=req-fcdfdfa6-94c4-4dc0-90d9-9e474e2f42b5 BOOTIF=${mac} initrd=deploy_ramdisk || goto retry

initrd --timeout 60000 http://192.168.24.23:8088/d152ff9b-0a5c-4b45-9629-64f4b0c31564/deploy_ramdisk || goto retry
boot

:retry
iseq ${i} ${attempts} && goto fail ||
inc i
echo No response, retrying in ${i} seconds.
sleep ${i}
goto deploy

:fail
echo Failed to get a response after ${attempts} attempts
echo Powering off in 30 seconds.
sleep 30
poweroff

:boot_partition
imgfree
kernel --timeout 60000 no_kernel root={{ ROOT }} ro text nofb nomodeset vga=normal ipa-inspection-collectors=default,pci-devices ipa-inspection-callback-url=http://192.168.24.17:5050/v1/continue ipa-global-request-id=req-fcdfdfa6-94c4-4dc0-90d9-9e474e2f42b5 initrd=ramdisk || goto boot_partition
initrd --timeout 60000 no_ramdisk || goto boot_partition
boot

:boot_anaconda
imgfree
kernel --timeout 60000 no_kernel text nofb nomodeset vga=normal ipa-inspection-collectors=default,pci-devices ipa-inspection-callback-url=http://192.168.24.17:5050/v1/continue ipa-global-request-id=req-fcdfdfa6-94c4-4dc0-90d9-9e474e2f42b5 inst.ks= inst.stage2= initrd=ramdisk || goto boot_anaconda
initrd --timeout 60000 no_ramdisk || goto boot_anaconda
boot

:boot_ramdisk
imgfree
kernel --timeout 60000 no_kernel root=/dev/ram0 text nofb nomodeset vga=normal ipa-inspection-collectors=default,pci-devices ipa-inspection-callback-url=http://192.168.24.17:5050/v1/continue ipa-global-request-id=req-fcdfdfa6-94c4-4dc0-90d9-9e474e2f42b5  initrd=ramdisk || goto boot_ramdisk
initrd --timeout 60000 no_ramdisk || goto boot_ramdisk
boot

:boot_whole_disk
sanboot --no-describe