summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp/api.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/api.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/api.inc.php')
-rw-r--r--modules-available/serversetup-bwlp/api.inc.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/modules-available/serversetup-bwlp/api.inc.php b/modules-available/serversetup-bwlp/api.inc.php
index 36f9063c..52f30440 100644
--- a/modules-available/serversetup-bwlp/api.inc.php
+++ b/modules-available/serversetup-bwlp/api.inc.php
@@ -1,5 +1,7 @@
<?php
+// TODO: Check if required arguments are given; if not, spit out according script (identical to what is embedded)
+
$BOOT_METHODS = [
'EXIT' => 'exit 1',
'COMBOOT' => 'chain /tftp/chain.c32 hd0',
@@ -22,12 +24,14 @@ $platform = strtoupper(Request::any('platform', 'PCBIOS', 'string'));
$localboot = false;
$model = false;
if ($uuid !== false && Module::get('statistics') !== false) {
+ // If we have the machine table, we rather try to look up the system model from there, using the UUID
$row = Database::queryFirst('SELECT systemmodel FROM machine WHERE machineuuid = :uuid', ['uuid' => $uuid]);
if ($row !== false && !empty($row['systemmodel'])) {
$model = $row['systemmodel'];
}
}
if ($model === false) {
+ // Otherwise use what iPXE sent us
function modfilt($str)
{
if (empty($str) || preg_match('/product\s+name|be\s+filled|unknown|default\s+string/i', $str))
@@ -70,6 +74,8 @@ if (isset($BOOT_METHODS[$localboot])) {
$BOOT_METHODS = array_reverse($BOOT_METHODS);
}
+// TODO: Feature check for our own iPXE extensions, stay compatible to stock iPXE
+
$output = <<<HERE
#!ipxe
@@ -139,7 +145,7 @@ console --left 55 --top 88 --right 63 --bottom 64 --quick --keep --picture bg-me
HERE;
-$output .= $menu->getMenuDefinition('target');
+$output .= $menu->getMenuDefinition('target', $platform);
$output .= <<<HERE
@@ -151,7 +157,9 @@ goto start
HERE;
-$output .= $menu->getItemsCode();
+$output .= $menu->getItemsCode($platform);
+
+// TODO: Work out memtest stuff. Needs to be put on server (install/update script) -- PCBIOS only? Chain EFI -> BIOS?
/*
:i1