Skip to content
Snippets Groups Projects
Commit 8577fec9 authored by Rob Herring's avatar Rob Herring Committed by Joe Hershberger
Browse files

pxe: add support for ontimeout token


ontimeout is similar to default, but is the selection on menu timeout.
This is how cobbler sets a default. The label default is supposed to be
the default selection when <enter> is pressed. If both default and
ontimeout are set, last one parsed wins.

Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
parent 32d2ffe7
No related branches found
No related tags found
No related merge requests found
...@@ -672,6 +672,7 @@ enum token_type { ...@@ -672,6 +672,7 @@ enum token_type {
T_PROMPT, T_PROMPT,
T_INCLUDE, T_INCLUDE,
T_FDT, T_FDT,
T_ONTIMEOUT,
T_INVALID T_INVALID
}; };
...@@ -700,6 +701,7 @@ static const struct token keywords[] = { ...@@ -700,6 +701,7 @@ static const struct token keywords[] = {
{"initrd", T_INITRD}, {"initrd", T_INITRD},
{"include", T_INCLUDE}, {"include", T_INCLUDE},
{"fdt", T_FDT}, {"fdt", T_FDT},
{"ontimeout", T_ONTIMEOUT,},
{NULL, T_INVALID} {NULL, T_INVALID}
}; };
...@@ -997,9 +999,7 @@ static int parse_label_menu(char **c, struct pxe_menu *cfg, ...@@ -997,9 +999,7 @@ static int parse_label_menu(char **c, struct pxe_menu *cfg,
switch (t.type) { switch (t.type) {
case T_DEFAULT: case T_DEFAULT:
if (cfg->default_label) if (!cfg->default_label)
free(cfg->default_label);
cfg->default_label = strdup(label->name); cfg->default_label = strdup(label->name);
if (!cfg->default_label) if (!cfg->default_label)
...@@ -1159,6 +1159,7 @@ static int parse_pxefile_top(char *p, struct pxe_menu *cfg, int nest_level) ...@@ -1159,6 +1159,7 @@ static int parse_pxefile_top(char *p, struct pxe_menu *cfg, int nest_level)
break; break;
case T_DEFAULT: case T_DEFAULT:
case T_ONTIMEOUT:
err = parse_sliteral(&p, &label_name); err = parse_sliteral(&p, &label_name);
if (label_name) { if (label_name) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment