I have a collection of boot utilities that derive from ISO images. And I would like that menu item to become the default instead of the boot from local drive.
When I set the “Default Menu Item” check, the client loads DHCP them complains as if ‘choose’ command is wrong. However, when unset as default (and local-boot is default), the menu displays fine and choice work as expected.
So what is the trick to assign it as default?
My menu item follow:
set http http://${fog-ip}/images
set nfs nfs://${fog-ip}/images
set tftp tftp://${fog-ip}/images
#
:GMENU
menu Good Utilities Menu
item --gap -- -------------------------------------
item --key i hostinfo host (I)nformation
item --key a actBootDisk (A)ctive@ Boot Disk
item --key c clonezilla (C)onezilla
item --key f freeDOS (F)reeDOS 13-RC3
item --key h HDAT2 (H)DAT2 CD Boot DOS Disk v7.0
item --key m MiniW10 (M)ini Windows 10
item --key p pMagic (P)artedMagic 2019-03-17
item --key s SPIN (S)pinRite Drive Diagnostics 6
item --key r sysresc System (R)escue
item --key d redob Re(d)o Backup & Restore
item --key h shell iPXE s(h)ell
item --key b reboot re(b)oot
item --key l return reload a(l)l menus
item --key t MENU return (t)o previous menu
choose --default hostinfo target && goto ${target}
#-----------common-----------#
:failed
echo failed.
echo press any key to return to the Utilities Menu ||
prompt
goto GMENU
#-----------boot IMG via memdisk-----------#
:MEMIMG
#--eg. set img ${nfs}/memdisk/img/SpinRite.img ; goto MEMIMG--#
initrd ${img}
set memargs img ${memargs}
chain memdisk ${memargs} ||
#boot || read void
boot || goto failed
#-----------load an ISO via memdisk kernel-----------#
:KMEMISO
#---eg. set iso ${nfs}/memdisk/iso/FD13LIVE.ISO ; set memargs iso raw ; goto KMEMISO---#
set memargs iso ${memargs}
kernel memdisk ${memargs}
initrd ${iso}
boot || goto failed
#-----------chain load an ISO via memdisk-----------#
:CHMEMISO
#---eg. set iso ${nfs}/memdisk/iso/FD13LIVE.ISO ; goto CHMEMISO---#
initrd ${iso}
set memargs iso ${memargs}
chain memdisk ${memargs} ||
boot || goto failed
#-----------hostinfo-----------#
:hostinfo
#cpuid --ext 29 && set arch amd64 || set arch x86
echo This computer : ||
echo =--=--=--=--=--=--= ||
echo Platform : ........ ${arch} ||
echo Web Boot Root : ... ${boot-url} ||
echo MAC address : ..... ${net0/mac} ||
echo IP address : ...... ${ip} ||
echo Netmask : ......... ${netmask} ||
echo Serial : .......... ${serial} ||
echo Asset number : .... ${asset} ||
echo Manufacturer : .... ${manufacturer} ||
echo Product : ......... ${product} ||
echo BIOS platform : ... ${platform} ||
echo FOG Ip Address : .. ${fog-ip} ||
echo FOG Web Root : .... ${fog-webroot} ||
echo iPXE version : .... ${version} ||
echo ||
echo press any key to return to Good Utilities Menu ||
prompt
goto GMENU
#-----------actBootDisk-----------#
:actBootDisk
set root ${http}/iso/abd
kernel ${nfs}/wimboot gui
imgfetch --name bootmgr ${root}/bootmgr bootmgr
imgfetch --name BCD ${root}/Boot/BCD BCD
imgfetch --name boot.sdi ${root}/Boot/boot.sdi boot.sdi
imgfetch --name boot.wim ${root}/sources/boot.wim boot.wim
boot || read void
goto failed
#-----------clonezilla-----------#
:clonezilla
set live ${http}/clonezilla/live
initrd ${live}/initrd.img || goto failed
kernel ${live}/vmlinuz boot=live config noswap nolocales edd=off nomodeset vga=788 nosplash noprompt setkmap=us locale=en_US.UTF-8 fetch=${live}/filesystem.squashfs || goto failed
boot || goto failed
goto UMENU
#-----------freeDOS1.3-----------#
:freeDOS
set iso ${http}/memdisk/iso/FD13LIVE.ISO
goto CHMEMISO
goto failed
#-----------HDAT2--Win98?---------#
:HDAT2
initrd ${http}/try/HDAT2_7.0.iso
chain memdisk iso ||
goto failed
#-----------Mini_Windows_10-----------#
:MiniW10
set root ${http}/iso/mw10
kernel ${nfs}/wimboot gui
imgfetch --name bootmgr.exe ${root}/bootmgr.exe bootmgr.exe
initrd ${root}/efi/microsoft/boot/fonts/segmono_boot.ttf segmono_boot.ttf
initrd ${root}/efi/microsoft/boot/fonts/segoe_slboot.ttf segoe_slboot.ttf
initrd ${root}/efi/microsoft/boot/fonts/segoen_slboot.ttf segoen_slboot.ttf
initrd ${root}/efi/microsoft/boot/fonts/wgl4_boot.ttf wgl4_boot.ttf
imgfetch --name BCD ${root}/Boot/bcd BCD
imgfetch --name boot.sdi ${root}/Boot/boot.sdi boot.sdi
imgfetch --name boot.wim ${root}/sources/boot.wim boot.wim
boot || goto failed
#-----------pMagic-----------#
:pMagic
set root ${http}/pmagic/pxe
kernel ${root}/bzImage64
imgargs netboot=nfs root=/dev/nfs nfsroot=${fog-ip}:/images/pmagic/contents/pmagic boot=/boot timezone=America/Toronto
initrd ${root}/initrd.img
initrd ${root}/files.cgz
initrd ${root}/fu.img
initrd ${root}/m64.img
boot || goto failed
#-----------redo-----------#
:redob
set path /iso/redo
set live ${http}/iso/redo/live
kernel ${http}${path}/vmlinuz
imgargs vmlinuz edd=off config components union=overlay username=user noswap noeject vga=normal rw rootfstype=squashfs ip=dhcp root=${http}${path} locale=en_US.UTF-8 fetch=${http}${path}/live/filesystem.squashfs boot=live
initrd ${http}${path}/initrd
boot || goto failed
#-----------SPINRITE-----------#
:SPIN
set img ${http}/memdisk/img/SpinRite.img
goto MEMIMG
#-----------sysresc-----------#
:sysresc
set root ${nfs}/sysresccd/boot
kernel ${root}/vmlinuz edd=off setkmap=en copytoram archisobasedir=/sysresccd/boot ip=dhcp archiso_http_srv=${http} checksum startx
initrd ${root}/intel_ucode.img
initrd ${root}/amd_ucode.img
initrd ${root}/sysresccd.img
boot || goto failed
#-----------reboot-----------#
:reboot
reboot
#-----------shell-----------#
:shell
echo Type 'exit' to get the back to the menu
shell || goto failed
#-----------reload menu-----------#
:return
set menu-timeout 0
chain http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac} ||
prompt
goto MENU
autoboot
Side question, do I need “autoboot”, what’s the significance?
Also I should say that I also have many other ISO files that I am unable to boot. Windows-based, usually installers, are relatively easy - I have then in a separate menu item. Ask if I should display them. These only load in BIOS mode I believe.
Most, if not all, load via http and I do not copy the files - I mount the ISO file as a loop and boot from that. The only issue is NFS says file not found… I guess the reason maybe because the NFS service loads first, then later, the FS table is processed, then later, Apache service starts. Can anyone confirm or explain the real reason and whether this is good to do?
Please post your findings if good results.
I am unsure what imgargs to supply, so some maybe unneeded.