#!ipxe

# Detectar si se está ejecutando en modo UEFI o BIOS
iseq ${platform} efi && goto uefi_boot || goto bios_boot

:bios_boot
echo "Running in BIOS mode - Booting first disk, third partition"
chain http://__SERVERIP__/tftpboot/grub.exe --config-file="timeout 0; title FirstHardDisk-ThirdPartition;root (hd0,2);chainloader (hd0,2)+1;boot" || echo "Failed to boot in BIOS mode"
exit

:uefi_boot
echo "Running in UEFI mode - Booting first disk, third partition"
sanboot --no-describe --drive 0 --filename \EFI\Part-01-03\Boot\ogloader.efi || echo "Failed to boot in UEFI mode"
exit

