summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2022-05-02 13:09:08 +0200
committerSimon Rettberg2022-05-02 13:09:08 +0200
commit672ead2f9d19a1651f5a87e11c1c04db5edacd08 (patch)
treeea1ab2f5e0300d90c80a295b589445007b149ee5 /modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
parent[locations/remoteaccess] Add option to veto remoteaccess mode (diff)
downloadslx-admin-672ead2f9d19a1651f5a87e11c1c04db5edacd08.tar.gz
slx-admin-672ead2f9d19a1651f5a87e11c1c04db5edacd08.tar.xz
slx-admin-672ead2f9d19a1651f5a87e11c1c04db5edacd08.zip
[serversetup-bwlp-ipxe] Force default boot entry to MiniLinux for dedicated PVSmgr
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php')
-rw-r--r--modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
index 08b65ed6..0212e061 100644
--- a/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
@@ -12,6 +12,16 @@ abstract class BootEntry
/** Supports both via distinct entry */
const BOTH = 'PCBIOS-EFI';
+ /**
+ * @var string Internal ID - set to your liking, e.g. the MiniLinux version identifier
+ */
+ protected $internalId;
+
+ public function __construct(string $internalId)
+ {
+ $this->internalId = $internalId;
+ }
+
public abstract function supportsMode($mode);
/**
@@ -24,6 +34,11 @@ abstract class BootEntry
public abstract function addFormFields(&$array);
+ public function internalId(): string
+ {
+ return $this->internalId;
+ }
+
/*
*
*/
@@ -69,9 +84,9 @@ abstract class BootEntry
return new MenuBootEntry($menuId);
}
- public static function newStandardBootEntry($initData, $efi = false, $arch = false)
+ public static function newStandardBootEntry($initData, $efi = false, $arch = false, string $internalId = '')
{
- $ret = new StandardBootEntry($initData, $efi, $arch);
+ $ret = new StandardBootEntry($initData, $efi, $arch, $internalId);
$list = [];
if ($ret->arch() !== self::EFI) {
$list[] = self::BIOS;
@@ -149,8 +164,9 @@ class StandardBootEntry extends BootEntry
const KEYS = ['executable', 'initRd', 'commandLine', 'replace', 'imageFree', 'autoUnload', 'resetConsole', 'dhcpOptions'];
- public function __construct($data, $efi = false, $arch = false)
+ public function __construct($data, $efi = false, $arch = false, string $internalId = '')
{
+ parent::__construct($internalId);
$this->pcbios = new ExecData();
$this->efi = new ExecData();
if ($data instanceof PxeSection) {
@@ -306,6 +322,7 @@ class CustomBootEntry extends BootEntry
public function __construct($data)
{
+ parent::__construct('custom');
if (is_array($data)) {
$this->ipxe = $data['script'] ?? ''; // LEGACY
foreach (['bash', 'grub'] as $key) {
@@ -348,6 +365,7 @@ class MenuBootEntry extends BootEntry
public function __construct($menuId)
{
+ parent::__construct('menu-' . $menuId);
$this->menuId = $menuId;
}
@@ -379,6 +397,7 @@ class SpecialBootEntry extends BootEntry
public function __construct($type)
{
+ parent::__construct('special-' . $type);
$this->type = $type['type'] ?? $type;
}