[ipxe-devel] Problem with iPXE menu

Andreas Hammarskjöld andreas at 2PintSoftware.com
Mon Sep 28 09:04:35 UTC 2020


This line does not look legit to me;

isset ${net${interface-idx}/mac} || goto end-loop-int item --key ${interface-idx} net${interface-idx} net${interface-idx} inc interface-idx && goto loop-int :end-loop-int

AFAIK you cant have multiple commands like this;

goto end-loop-int item --key ${interface...

So you would need to split it out like;

|| goto end-loop-int &&  goto loop-int

And then deal with you setting the "item" othwise. 

//A

andreas at 2pintsoftware.com @andhammarskold +46727253995

-----Original Message-----
From: ipxe-devel <ipxe-devel-bounces at lists.ipxe.org> On Behalf Of James Peltier
Sent: Friday, 25 September 2020 19:44
To: ipxe-devel at ipxe.org
Subject: [ipxe-devel] Problem with iPXE menu

Hi All,

I'm having a bit of trouble with iPXE menus.  I'm trying to allow a user to select the interface that they would like to boot from and this works fine.  However, if someone incorrectly selected the wrong interface, I want them to be able to go back into the menu and reselect the proper one.

When i choose the option to select the boot interface the first time it works and sets the boot-interface variable to the selected network, returns to the menu showing the "Select Boot Interface (DONE)". If I then select this option again it seems to attempt to boot and ends up with an INT18 error.

What am I doing wrong?


CODE
=========

:menu
clear boot-interface

menu Main Menu
item --gap Build Date: ${build_date} (UTC) item item --gap We will be booting from ${mirror} today.
item
item --key N boot-dhcp (N)ormal Boot
item --key C customization-menu (C)ustom Boot choose --timeout 0 --default boot-dhcp boot-select && goto boot-type || goto menu


:select-boot-interface
menu Select an interface to boot from

:loop-int
isset ${net${interface-idx}/mac} || goto end-loop-int item --key ${interface-idx} net${interface-idx} net${interface-idx} inc interface-idx && goto loop-int :end-loop-int

choose --timeout 0 --default 0 boot-interface && goto customization-menu


:attempt-boot
echo
echo Attempting to boot ${boot-interface} #isset ${net${interface-idx}/mac} && goto ${fqdn} || goto boot-dhcp isset ${boot-interface}/mac} && goto ${fqdn} || goto boot-dhcp


:customization-menu
menu Customize Installation
item
item --key 1 attempt-boot (1) Try All Interfaces isset ${boot-interface} && item select-boot-interface Select Boot Interface (Done) || item select-boot-interface Select Boot Interface item custom-boot Start Custom Boot item menu Main Menu choose --timeout 0 --default attempt-boot customization-menu-selection || goto customization-menu goto ${customization-menu-selection} _______________________________________________
ipxe-devel mailing list
ipxe-devel at lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel


More information about the ipxe-devel mailing list