#!ipxe

console --picture http://$SERVER_IP$:$HTTP_PORT$/uis_loader/uis_background_$BKIMG_INDEX$.png || console
sleep $LOGO_TIMEOUT$

set kernel_url  $HTTP_IMG_URL$/install/netboot/ubuntu-installer/amd64/linux
set initrd_url  $HTTP_IMG_URL$/install/netboot/ubuntu-installer/amd64/initrd.gz
set kernel_para $EXT_BOOT_OPT$ boot=live  union=overlay  live-config  noswap nolocales  edd=on  nomodeset osc_live_run="osc-live-general" osc_live_extra_param=""  keyboard-layouts= osc_live_batch="no"  locales=  vga=788 nosplash


goto $BIOS_MODE$

:LEGACY
kernel ${kernel_url} ${kernel_para}
initrd ${initrd_url}
$UDS_DRIVER_FMT$
boot


:UEFI
kernel --name grub_chain_linux.efi   http://$SERVER_IP$:$HTTP_PORT$/uis_loader/grub_chain_linux.efi
imgfetch --name initrd.img  ${initrd_url}
imgfetch --name vmlinuz     ${kernel_url}
$UDS_DRIVER_FMT$

img_get_addr vmlinuz           vmlinuz_mem
img_get_addr initrd.img        initrd_mem
img_get_addr $UDS_DRIVER_NAME$ driver_mem && set driver_mem_url mem:${driver_mem_addr}:size:${driver_mem_size} ||

set uds_chain_no_image_name 1
imgargs grub_chain_linux.efi \
    echo -en 'Downloading kernel ... ' @N@ \
    linux mem:${vmlinuz_mem_addr}:size:${vmlinuz_mem_size} ${kernel_para} @N@ \
    echo -en 'OK\nDownloading initrd ... ' @N@ \
    initrd mem:${initrd_mem_addr}:size:${initrd_mem_size} ${driver_mem_url} @N@ \
    echo -en 'OK\nBooting ...' @N@ \
    boot

boot

