struct pxe_label *label;
struct list_head *pos;
struct menu *m;
+ char *label_override;
int err;
int i = 1;
char *default_num = NULL;
+ char *override_num = NULL;
/*
* Create a menu and add items for all the labels.
if (!m)
return NULL;
+ label_override = env_get("pxe_label_override");
+
list_for_each(pos, &cfg->labels) {
label = list_entry(pos, struct pxe_label, list);
if (cfg->default_label &&
(strcmp(label->name, cfg->default_label) == 0))
default_num = label->num;
+ if (label_override && !strcmp(label->name, label_override))
+ override_num = label->num;
+ }
+
+
+ if (label_override) {
+ if (override_num)
+ default_num = override_num;
+ else
+ printf("Missing override pxe label: %s\n",
+ label_override);
}
/*
fdtoverlay_addr_r - location in RAM at which 'pxe boot' will temporarily store
fdt overlay(s) before applying them to the fdt blob stored at 'fdt_addr_r'.
+ pxe_label_override - override label to be used, if exists, instead of the
+ default label. This will allow consumers to choose a pxe label at
+ runtime instead of having to prompt the user. If "pxe_label_override" is set
+ but does not exist in the pxe menu, pxe would fallback to the default label if
+ given, and no failure is returned but rather a warning message.
+
pxe file format
===============
The pxe file format is nearly a subset of the PXELINUX file format; see