From 8cdccaeb71a167c6a16b715e65967da3be8a040a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 10 Jul 2020 16:40:06 +0200 Subject: [serversetup-bwlp-ipxe] Progress on new structure (+bash) --- .../inc/scriptbuilderbase.inc.php | 33 ++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'modules-available/serversetup-bwlp-ipxe/inc/scriptbuilderbase.inc.php') diff --git a/modules-available/serversetup-bwlp-ipxe/inc/scriptbuilderbase.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/scriptbuilderbase.inc.php index c6adc953..b9867ed9 100644 --- a/modules-available/serversetup-bwlp-ipxe/inc/scriptbuilderbase.inc.php +++ b/modules-available/serversetup-bwlp-ipxe/inc/scriptbuilderbase.inc.php @@ -11,6 +11,8 @@ abstract class ScriptBuilderBase protected $clientIp; + protected $uuid; + /** * @var bool Running iPXE has slx-extensions */ @@ -26,6 +28,16 @@ abstract class ScriptBuilderBase return $this->platform; } + public function uuid() + { + return $this->uuid; + } + + public function clientIp() + { + return $this->clientIp; + } + public function getLabel() { return 'b' . mt_rand(100, 999) . 'x' . (++$this->lblId); @@ -42,11 +54,11 @@ abstract class ScriptBuilderBase if ($this->platform !== false) { $this->platform = strtoupper($this->platform); } - Header('X-Popo: ' . $this->platform); if ($this->platform !== 'EFI' && $this->platform !== 'PCBIOS') { $this->platform = ''; } $this->hasExtension = $slxExtensions ?? (bool)Request::any('slx-extensions', false, 'int'); + $this->uuid = Request::any('uuid', false, 'string'); } /** @@ -55,13 +67,24 @@ abstract class ScriptBuilderBase */ public abstract function output($string); - public abstract function getMenu($menuId); + public abstract function bootstrapLive(); - public abstract function getMenuEntry($menuEntryId); + public abstract function getMenu(IPxeMenu $menu, bool $bootstrap); - public abstract function getSpecial($special); + /** + * @param MenuEntry|null $menuEntry The according menu entry, or null if invalid. + * @param bool $honorPassword Whether we should generate a password dialog if protected, or skip + * @return string generated script/code/... + */ + public abstract function getMenuEntry($menuEntry, $honorPassword = true); - public abstract function fallback(); + /** + * @param BootEntry|null|false $bootEntry + * @return string + */ + public abstract function getBootEntry($bootEntry); + + public abstract function getSpecial($special); /** * @param IPxeMenu|null $menu -- cgit v1.2.3-55-g7522