iPXE discussion forum
iPXE boot failed but 'boot || goto boot_menu' reback to boot menu NOT work - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: iPXE boot failed but 'boot || goto boot_menu' reback to boot menu NOT work (/showthread.php?tid=8157)



iPXE boot failed but 'boot || goto boot_menu' reback to boot menu NOT work - lvii - 2016-08-16 08:44

Hi,

When I test iPXE boot menu, boot menu with wrong URL make boot failed.

I have added :

Code:
boot || goto boot_menu

to a boot menu entry, hoping to return back to boot menu when boot failed. But it seem that boot || goto boot_menu NOT work.

Boot failed with a message, and then exit iPXE boot to localdisk :

Code:
Could not boot: No such file or directory (http://ipxe.org/2d0c613b)
Could not boot image: No such file or directory
No more network devices

Here is the Failed screenshot :

[Image: Bqi3MO2.png]

My iPXE script :

Code:
#!ipxe
prompt --key 0x02 --timeout 1000 Press Ctrl-B for the iPXE command line... && shell ||

:boot_menu
menu iPXE Clone Menu
item clone      KS Auto Install : centos-7-kvm
item localboot  Boot From Local Disk
item static     gPXE Static Install
item shell      iPXE Shell

choose --default localboot --timeout 30000 target && goto ${target} ||
echo __NOTE: Cancel Enter Select Menu, Exit
exit

:localboot
sanboot --no-describe --drive 0x80 || goto boot_menu

:clone
kernel http=//192.168.10.199/iso/7/images/pxeboot/vmlinuz net.ifnames=0 biosdevname=0 inst.sshd ipv6.disable=1 inst.stage2=http=//192.168.10.199/iso/7 inst.ks=http=//192.168.10.199/ks/ks-centos-7-kvm.cfg ks.device
=bootif BOOTIF=01-${net0/mac:hexhyp}
initrd http=//192.168.10.199/iso/7/images/pxeboot/initrd.img
boot || goto boot_menu
goto boot_menu

:static
set 210:string http://${next-server}/pxe/
set 209:string ${210:string}pxelinux.cfg/default
echo __INFO: chain ${210:string}gpxelinux.0
echo __INFO: ${209:string}
chain ${210:string}gpxelinux.0 ||
goto boot_menu

:shell
echo __NOTE: Type 'config' enter iPXE config setting, 'exit' return to boot menu.
shell
goto boot_menu



RE: iPXE boot failed but 'boot || goto boot_menu' reback to boot menu NOT work - MultimediaMan - 2016-08-16 09:37

Instead of this:

Code:
:clone
kernel http=//192.168.10.199/iso/7/images/pxeboot/vmlinuz net.ifnames=0 biosdevname=0 inst.sshd ipv6.disable=1 inst.stage2=http=//192.168.10.199/iso/7 inst.ks=http=//192.168.10.199/ks/ks-centos-7-kvm.cfg ks.device
=bootif BOOTIF=01-${net0/mac:hexhyp}
initrd http=//192.168.10.199/iso/7/images/pxeboot/initrd.img
boot || goto boot_menu
goto boot_menu

Try this:

Code:
:clone
initrd http://192.168.10.199/iso/7/images/pxeboot/initrd.img ||
chain http://192.168.10.199/iso/7/images/pxeboot/vmlinuz net.ifnames=0 biosdevname=0 inst.sshd ipv6.disable=1 inst.stage2=http://192.168.10.199/iso/7 inst.ks=http://192.168.10.199/ks/ks-centos-7-kvm.cfg ks.device
=bootif BOOTIF=01-${net0/mac:hexhyp} ||
goto boot_menu