summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php4
-rw-r--r--modules-available/serversetup-bwlp-ipxe/inc/pxelinux.inc.php18
2 files changed, 21 insertions, 1 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php
index a78ad941..2aecd70f 100644
--- a/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php
@@ -162,8 +162,10 @@ class IPxe
if (!empty($pxe->title)) {
$menuTitle = $pxe->title;
}
- if ($pxe->timeoutLabel !== null) {
+ if ($pxe->timeoutLabel !== null && $pxe->hasLabel($pxe->timeoutLabel)) {
$defaultLabel = $pxe->timeoutLabel;
+ } elseif ($pxe->hasLabel($pxe->default)) {
+ $defaultLabel = $pxe->default;
}
$timeoutMs[] = $pxe->timeoutMs;
$timeoutMs[] = $pxe->totalTimeoutMs;
diff --git a/modules-available/serversetup-bwlp-ipxe/inc/pxelinux.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/pxelinux.inc.php
index a3826c2e..63fdf674 100644
--- a/modules-available/serversetup-bwlp-ipxe/inc/pxelinux.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/inc/pxelinux.inc.php
@@ -38,6 +38,7 @@ class PxeLinux
'menu clear' => ['true', 'menuClear'],
'menu immediate' => ['true', 'immediateHotkeys'],
'ontimeout' => ['string', 'timeoutLabel'],
+ 'default' => ['string', 'default'],
];
$lines = preg_split('/[\r\n]+/', $input);
$section = null;
@@ -159,6 +160,11 @@ class PxeMenu
* @var PxeSection[] list of sections the menu contains
*/
public $sections = [];
+ /**
+ * @var string The DEFAULT entry of the menu. Usually refers either to a
+ * LABEL, or a loadable module (like vesamenu.c32)
+ */
+ public $default;
public function hash($fuzzy)
{
@@ -193,6 +199,18 @@ class PxeMenu
return hash_final($ctx, false);
}
+ /**
+ * Check if any of the sections has the given label.
+ */
+ public function hasLabel($label)
+ {
+ foreach ($this->sections as $section) {
+ if ($section->label === $label)
+ return true;
+ }
+ return false;
+ }
+
}
/**