summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp/inc/menuentry.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2018-09-19 11:27:22 +0200
committerSimon Rettberg2018-09-19 11:27:22 +0200
commit6da78493a0bb010a0fff50ac3cc23e018b15e979 (patch)
tree6baaa31e9d985e503e09cd669f11bce65355cd3d /modules-available/serversetup-bwlp/inc/menuentry.inc.php
parent[serversetup-bwlp] Pass initrd= on KCL for EFI mode (diff)
downloadslx-admin-6da78493a0bb010a0fff50ac3cc23e018b15e979.tar.gz
slx-admin-6da78493a0bb010a0fff50ac3cc23e018b15e979.tar.xz
slx-admin-6da78493a0bb010a0fff50ac3cc23e018b15e979.zip
[serversetup-bwlp] Differentiate between EFI/BIOS
Different executable/initrd etc. can be given for a simple boot entry of type "exec", or it can be specified that only one of them is supported. For bootentry type "script" there can still be only one entry, since you can just check the ${platform} variable within the script.
Diffstat (limited to 'modules-available/serversetup-bwlp/inc/menuentry.inc.php')
-rw-r--r--modules-available/serversetup-bwlp/inc/menuentry.inc.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules-available/serversetup-bwlp/inc/menuentry.inc.php b/modules-available/serversetup-bwlp/inc/menuentry.inc.php
index 9d9d4163..03b860e8 100644
--- a/modules-available/serversetup-bwlp/inc/menuentry.inc.php
+++ b/modules-available/serversetup-bwlp/inc/menuentry.inc.php
@@ -58,8 +58,10 @@ class MenuEntry
settype($this->menuentryid, 'int');
}
- public function getMenuItemScript($lblPrefix, $requestedDefaultId)
+ public function getMenuItemScript($lblPrefix, $requestedDefaultId, $mode)
{
+ if ($this->bootEntry !== null && !$this->bootEntry->supportsMode($mode))
+ return '';
$str = 'item ';
if ($this->gap) {
$str .= '--gap ';
@@ -81,9 +83,9 @@ class MenuEntry
return $str . " || prompt Could not create menu item for {$lblPrefix}_{$this->menuentryid}\n";
}
- public function getBootEntryScript($lblPrefix, $failLabel)
+ public function getBootEntryScript($lblPrefix, $failLabel, $mode)
{
- if ($this->bootEntry === null)
+ if ($this->bootEntry === null || !$this->bootEntry->supportsMode($mode))
return '';
$str = ":{$lblPrefix}_{$this->menuentryid}\n";
if (!empty($this->md5pass)) {
@@ -94,7 +96,7 @@ class MenuEntry
. "goto slx_pass_check || goto $failLabel\n"
. ":{$lblPrefix}_ok\n";
}
- return $str . $this->bootEntry->toScript($failLabel);
+ return $str . $this->bootEntry->toScript($failLabel, $mode);
}
/*