#!ipxe

goto ${menu} ||

:live_menu
set os_arch ${arch}
iseq ${os_arch} x86_64 && set os_arch amd64 ||
iseq ${os_arch} i386 && set os_arch i686 ||
set os Clonezilla
menu ${os}
item --gap ${os} Versions
item debian ${space} ${os} Debian Based
iseq ${os_arch} amd64 && item ubuntu ${space} ${os} Ubuntu Based ||
choose live_version || goto live_exit
menu ${os} ${live_version} - ${os_arch}
item --gap ${os} Flavors
goto ${live_version}

:debian
iseq ${os_arch} amd64 && item /debian-squash/releases/download/3.3.3-37-0790c10c/ ${space} Clonezilla 3.3.3-37 Stable ||
iseq ${os_arch} amd64 && item /debian-squash/releases/download/3.3.4-22-7f56e939/ ${space} Clonezilla 3.3.4-22 Testing ||
choose path || goto live_menu
goto clonezilla-boot

:ubuntu
iseq ${os_arch} amd64 && item /ubuntu-squash/releases/download/20260913-resolute-e29c1458/ ${space} Clonezilla 20260913-Resolute Stable ||
iseq ${os_arch} amd64 && item /ubuntu-squash/releases/download/20261108-tenacious-2558197c/ ${space} Clonezilla 20261108-Tenacious Testing ||
choose path || goto live_menu
goto clonezilla-boot

:clonezilla-boot
imgfree
set url ${live_endpoint}${path}
kernel ${url}vmlinuz boot=live username=user union=overlay config components noswap edd=on nomodeset ocs_live_run="ocs-live-general" ocs_live_batch=no net.ifnames=0 nosplash noprompt fetch=${url}filesystem.squashfs initrd=initrd.magic ${cmdline}
initrd ${url}initrd
boot

:live_exit
clear menu
exit 0

