#!ipxe

set attempts:int32 10
set i:int32 0

goto boot_ramdisk

:deploy
imgfree
kernel --timeout 60000  selinux=0 troubleshoot=0 text nofb nomodeset vga=normal ipa-global-request-id=req-14f9f1ed-11b4-4b7a-83e6-eedf4ffd1900 BOOTIF=${mac} initrd=deploy_ramdisk || goto retry

initrd --timeout 60000  || goto retry
boot

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

: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-global-request-id=req-14f9f1ed-11b4-4b7a-83e6-eedf4ffd1900 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-global-request-id=req-14f9f1ed-11b4-4b7a-83e6-eedf4ffd1900 inst.ks= inst.stage2= initrd=ramdisk || goto boot_anaconda
initrd --timeout 60000 no_ramdisk || goto boot_anaconda
boot

:boot_ramdisk
imgfree
sanboot http://192.168.24.23:8088/d435a292-ea13-485e-a771-e0a0e68e6afe/boot_iso

:boot_whole_disk
sanboot --no-describe