From 3425726cf33c2af84c9737a2501cd39517e42cdb Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 29 Mar 2012 00:05:22 +0100 Subject: [menu] Add menu commands Allow iPXE scripts to create menus. For example: #!ipxe menu iSCSI boot demonstration item install Install Fedora to ${root-path} item --default boot Boot from ${root-path} item shell Enter iPXE shell item exit Exit to BIOS choose label && goto ${label} :boot sanboot ${root-path} :install sanhook ${root-path} chain http://${next-server}/fedora.ipxe :shell shell :exit Inspired-by: Robin Smidsrød Tested-by: Robin Smidsrød Signed-off-by: Michael Brown --- src/include/ipxe/errfile.h | 1 + src/include/ipxe/features.h | 1 + src/include/ipxe/parseopt.h | 2 ++ 3 files changed, 4 insertions(+) (limited to 'src/include') diff --git a/src/include/ipxe/errfile.h b/src/include/ipxe/errfile.h index c72aeb7b8..77c2f8095 100644 --- a/src/include/ipxe/errfile.h +++ b/src/include/ipxe/errfile.h @@ -252,6 +252,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #define ERRFILE_cms ( ERRFILE_OTHER | 0x002a0000 ) #define ERRFILE_imgtrust ( ERRFILE_OTHER | 0x002b0000 ) #define ERRFILE_menu_ui ( ERRFILE_OTHER | 0x002c0000 ) +#define ERRFILE_menu_cmd ( ERRFILE_OTHER | 0x002d0000 ) /** @} */ diff --git a/src/include/ipxe/features.h b/src/include/ipxe/features.h index 660015cd2..498ec9441 100644 --- a/src/include/ipxe/features.h +++ b/src/include/ipxe/features.h @@ -52,6 +52,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #define DHCP_EB_FEATURE_EFI 0x24 /**< EFI format */ #define DHCP_EB_FEATURE_FCOE 0x25 /**< FCoE protocol */ #define DHCP_EB_FEATURE_VLAN 0x26 /**< VLAN support */ +#define DHCP_EB_FEATURE_MENU 0x27 /**< Menu support */ /** @} */ diff --git a/src/include/ipxe/parseopt.h b/src/include/ipxe/parseopt.h index b5fd2203b..b492a51e5 100644 --- a/src/include/ipxe/parseopt.h +++ b/src/include/ipxe/parseopt.h @@ -13,6 +13,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include struct net_device; +struct menu; /** A command-line option descriptor */ struct option_descriptor { @@ -116,6 +117,7 @@ struct command_descriptor { extern int parse_string ( const char *text, const char **value ); extern int parse_integer ( const char *text, unsigned int *value ); extern int parse_netdev ( const char *text, struct net_device **netdev ); +extern int parse_menu ( const char *text, struct menu **menu ); extern int parse_flag ( const char *text __unused, int *flag ); extern int parse_key ( const char *text, unsigned int *key ); extern void print_usage ( struct command_descriptor *cmd, char **argv ); -- cgit v1.2.3-55-g7522