* mboot.c32: add "-solaris" option to pass DHCP information to
the Solaris kernel; required for automatic Solaris boot
without using Solaris' pxeboot program.
+ * New UI directive, which allows a more natural way to specify
+ a menu system (or not.) With the UI directive specifying
+ the menu system, the DEFAULT directive can be used to select
+ the default entry inside the menus.
Changes in 3.72:
* Include the pxechain.com module from Jeffery Hutzelman at
};
struct menu_entry {
- int entry; /* Entry number inside menu */
+ struct menu *menu; /* Parent menu */
const char *displayname;
const char *label;
const char *passwd;
const char *cmdline;
struct menu *submenu;
struct menu_entry *next; /* Linked list of all labels across menus */
+ int entry; /* Entry number inside menu */
enum menu_action action;
unsigned char hotkey;
};
int hiddenmenu = 0;
long long totaltimeout = 0;
+/* Keep track of global default */
+static int has_ui = 0; /* DEFAULT only counts if UI is found */
+static const char *globaldefault = NULL;
+
/* Linked list of all entires, hidden or not; used by unlabel() */
static struct menu_entry *all_entries;
static struct menu_entry **all_entries_end = &all_entries;
}
me = calloc(1, sizeof(struct menu_entry));
+ me->menu = m;
me->entry = m->nentries;
m->menu_entries[m->nentries++] = me;
*all_entries_end = me;
return current_menu->parent ? current_menu->parent : current_menu;
}
+static struct menu_entry *find_label(const char *str)
+{
+ const char *p;
+ struct menu_entry *me;
+ int pos;
+
+ p = str;
+ while ( *p && !my_isspace(*p) )
+ p++;
+
+ /* p now points to the first byte beyond the kernel name */
+ pos = p-str;
+
+ for (me = all_entries; me; me = me->next) {
+ if (!strncmp(str, me->label, pos) && !me->label[pos])
+ return me;
+ }
+
+ return NULL;
+}
+
static const char *unlabel(const char *str)
{
/* Convert a CLI-style command line to an executable command line */
ld.ipappend = atoi(skipspace(p+8));
else
ipappend = atoi(skipspace(p+8));
+ } else if ( looking_at(p, "default") ) {
+ refstr_put(globaldefault);
+ globaldefault = refstrdup(skipspace(p+7));
+ } else if ( looking_at(p, "ui") ) {
+ has_ui = 1;
}
}
}
{
const char *filename;
struct menu *m;
+ struct menu_entry *me;
empty_string = refstrdup("");
/* Common postprocessing */
resolve_gotos();
+ /* Handle global default */
+ if (has_ui && globaldefault) {
+ me = find_label(globaldefault);
+ if (me && me->menu != hide_menu) {
+ me->menu->defentry = me->entry;
+ start_menu = me->menu;
+ }
+ }
+
+ /* Final per-menu initialization, with all labels known */
for (m = menu_list; m; m = m->next) {
m->curentry = m->defentry; /* All menus start at their defaults */
initrd
config
default
+ui
display
font
implicit
keyword include, pc_opencmd, pc_include
keyword append, pc_append
keyword initrd, pc_filename, InitRD
- keyword default, pc_default
+ keyword default, pc_default, 1
+ keyword ui, pc_default, 2
keyword display, pc_opencmd, get_msg_file
keyword font, pc_opencmd, loadfont
keyword implicit, pc_setint16, AllowImplicit
section .text
;
-; "default" command
+; "default" or "ui" command, with level (1 = default, 2 = ui)
;
-pc_default: mov di,default_cmd
+pc_default: cmp ax,[DefaultLevel]
+ jb .skip
+ mov di,default_cmd
call getline
mov byte [di-1],0 ; null-terminate
- ret
+.skip: ret
;
; "ontimeout" command
AllowImplicit dw 1 ; Allow implicit kernels
AllowOptions dw 1 ; User-specified options allowed
IncludeLevel dw 1 ; Nesting level
+DefaultLevel dw 0 ; The current level of default
SerialPort dw 0 ; Serial port base (or 0 for no serial port)
VKernel db 0 ; Have we seen any "label" statements?
; Check whether or not we are supposed to display the boot prompt.
;
check_for_key:
- cmp word [ForcePrompt],0 ; Force prompt?
- jnz enter_command
test byte [KbdFlags],5Bh ; Shift Alt Caps Scroll
- jz auto_boot ; If neither, default boot
+ jnz enter_command
+ cmp word [ForcePrompt],0 ; Force prompt?
+ jz auto_boot
+ cmp word [DefaultLevel],1 ; Active UI statement?
+ ja auto_boot
enter_command:
cmp word [NoEscape],0 ; If NOESCAPE, no prompt,
directory as pxelinux.0 for PXELINUX), and put the following options
in your configuration file:
-DEFAULT menu.c32
-PROMPT 0
+UI menu.c32
-There are a few menu additions to the command line, all starting with
-the keywords MENU or TEXT; like the rest of the Syslinux config file
-language, it is case insensitive:
+There are a few menu additions to the configuration file, all starting
+with the keywords MENU or TEXT; like the rest of the Syslinux config
+file language, it is case insensitive:
+
MENU TITLE title
Give the menu a title. The title is presented at the top of
the menu.
+
MENU HIDDEN
Do not display the actual menu unless the user presses a key.
All that is displayed is a timeout message.
+
MENU SEPARATOR
Insert an empty line in the menu.
+
MENU LABEL label
(Only valid after a LABEL statement.)
(Only valid after a LABEL statement.)
Will add "count" spaces in front of the displayed menu entry.
+
MENU DISABLE
(Only valid after a LABEL statement.)
MENU DEFAULT
(Only valid after a LABEL statement.)
- Indicates that this entry should be the default. If no
- default is specified, use the first one.
+
+ Indicates that this entry should be the default for this
+ particular submenu. See also the DEFAULT directive below.
TEXT HELP
(Only valid inside MENU BEGIN ... MENU END)
Indicates that the menu system should start at the menu being
- defined instead of at the top-level menu.
+ defined instead of at the top-level menu. See also the
+ DEFAULT directive below.
+
+
+DEFAULT label
+
+ Set the global default. If "label" points into a submenu,
+ that menu becomes the start menu; in other words, this
+ directive has the same effect as both MENU DEFAULT and MENU
+ START.
+
+ For backwards compatibility with earlier versions of Syslinux,
+ this directive is ignored unless the configuration file also
+ contains a UI directive.
+
+ Note: the CLI accepts options after the label, or even a
+ non-label. The menu system does not support that.
INCLUDE filename [tagname]
true, as it caused problems when using a shell as a substitute
for "init." You may want to include this option manually.
+UI module options...
+ Selects a specific user interface module (typically menu.c32
+ or vesamenu.c32). The command-line interface treats this as a
+ directive that overrides the DEFAULT and PROMPT directives.
+
APPEND options...
Add one or more options to the kernel command line. These are
added both for automatic and manual boots. The options are