From 23ef39f786276e7e88fd4b035ef84c4f478c99e2 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 11 Mar 2019 15:02:13 +0100 Subject: [serversetup-bwlp-ipxe] Skip empty inird entries --- modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules-available/serversetup-bwlp-ipxe') diff --git a/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php index a66736b6..0248e0ea 100644 --- a/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php +++ b/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php @@ -146,6 +146,7 @@ class StandardBootEntry extends BootEntry if (!is_array($initrd)) { $initrd = [$initrd]; } + $initrd = array_filter($initrd, function($x) { return strlen(trim($x)) !== 0; }); } unset($initrd); if ($this->arch === null) { @@ -182,10 +183,13 @@ class StandardBootEntry extends BootEntry if ($this->resetConsole[$mode]) { $script .= "console ||\n"; } + // TODO: Checkbox + $script .= "imgfree ||\n"; $initrds = []; if (!empty($this->initRd[$mode])) { - $script .= "imgfree ||\n"; foreach (array_values($this->initRd[$mode]) as $i => $initrd) { + if (empty($initrd)) + continue; $script .= "initrd --name initrd$i $initrd || goto $failLabel\n"; $initrds[] = "initrd$i"; } -- cgit v1.2.3-55-g7522