2012-10-11, 18:40
I am attempting to write my first iPXE menu using https://gist.github.com/2234639 as an example.
However, when I write a basic menu, I get the error "menu: command not found".
Since this is my first attempt, I'm not sure if this is a syntax error, missing feature, a failure to load a library, etc. What am I missing?
Ah! I had an old version of undionly.kpxe . I am not sure what version I had, since I am not sure how to print the version string.
I updated to the latest version of iPXE from git://git.ipxe.org/ipxe.git , built from source, and the new version works.
However, when I write a basic menu, I get the error "menu: command not found".
Since this is my first attempt, I'm not sure if this is a syntax error, missing feature, a failure to load a library, etc. What am I missing?
Code:
#!ipxe
# menu.ipxe by stefanl
# hints from:
# http://jpmens.net/2011/07/18/network-booting-machines-over-http/
# https://gist.github.com/2234639
# http://ipxe.org/cmd/menu
# menu [--name <name>] [--delete] [<title>]
# item [--menu <menu>] [--key <key>] [--default] [<label>|--gap [<text>]]
# choose [--menu <menu>] [--default <label>] [--timeout <timeout>] [--keep] <setting>
# Setup some basic convenience variables
set menu-timeout 5000
# Ensure we have menu-default set to something
isset ${menu-default} || set menu-default exit
###################### MAIN MENU ####################################
:start
menu iPXE boot menu for NERSC Server Team
item --gap -- ------------------------- Operating systems ------------------------------
item
item
item --gap -- ------------------------- Advanced options -------------------------------
item --key c config (c)onfigure settings
item --key s shell Drop to iPXE (s)hell
item --key r reboot (r)eboot computer
item
item --key x exit E(x)it iPXE and continue BIOS boot
choose --timeout ${menu-timeout} --default ${menu-default} selected || goto cancel
set menu-timeout 0
goto ${selected}
:cancel
echo You cancelled the menu, dropping you to a shell
:shell
echo Type exit to get the back to the menu
shell
set menu-timeout 0
goto start
:failed
echo Booting failed, dropping to shell
goto shell
:reboot
reboot
:exit
exit
:config
config
goto start
Ah! I had an old version of undionly.kpxe . I am not sure what version I had, since I am not sure how to print the version string.
I updated to the latest version of iPXE from git://git.ipxe.org/ipxe.git , built from source, and the new version works.