summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe/inc/pxelinux.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/inc/pxelinux.inc.php')
-rw-r--r--modules-available/serversetup-bwlp-ipxe/inc/pxelinux.inc.php18
1 files changed, 18 insertions, 0 deletions
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;
+ }
+
}
/**