summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe/inc/pxelinux.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-25 17:12:49 +0100
committerSimon Rettberg2019-03-25 17:12:49 +0100
commitd76372a64f9f4fa60f0818e9e597613cfce7d496 (patch)
tree0f2b1ad8bc1467b7193c067ba6ccf12b6c2163fb /modules-available/serversetup-bwlp-ipxe/inc/pxelinux.inc.php
parent[serversetup-bwlp-ipxe] Fix type error (BootEntry vs PxeSection) (diff)
downloadslx-admin-d76372a64f9f4fa60f0818e9e597613cfce7d496.tar.gz
slx-admin-d76372a64f9f4fa60f0818e9e597613cfce7d496.tar.xz
slx-admin-d76372a64f9f4fa60f0818e9e597613cfce7d496.zip
[serversetup-bwlp-ipxe] Support DEFAULT directive of pxelinux
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;
+ }
+
}
/**