Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] My first menu. "menu: command not found"
2012-10-11, 18:40 (This post was last modified: 2012-10-12 21:34 by stefanlasiewski.)
Post: #1
[solved] My first menu. "menu: command not found"
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?

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.
Visit this user's website Find all posts by this user
Quote this message in a reply
2012-10-11, 20:54
Post: #2
RE: My first menu. "menu: command not found"
The menu command was introduced in commit https://git.ipxe.org/ipxe.git/commit/f5c...dec93eaf58 which is dated 2012-03-30, and slightly improved 2012-04-28 to support the --default parameter on choose. You also need to ensure #define MENU_CMD is on in src/config/general.h (which is the default).
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)