summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-07 18:37:12 +0100
committerSimon Rettberg2019-03-07 18:37:12 +0100
commitd957c1b2fcb2caf1920fa200c9d17863e1326ad5 (patch)
tree7dda385715177cfeb28ff818bf4ffe65e50781ef /modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php
parent[serversetup-bwlp-ipxe] Add clearfix to bootentry list (diff)
downloadslx-admin-d957c1b2fcb2caf1920fa200c9d17863e1326ad5.tar.gz
slx-admin-d957c1b2fcb2caf1920fa200c9d17863e1326ad5.tar.xz
slx-admin-d957c1b2fcb2caf1920fa200c9d17863e1326ad5.zip
[serversetup-bwlp-ipxe] Improve legacy PXELinux import
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php')
-rw-r--r--modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php23
1 files changed, 16 insertions, 7 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php
index 4320bb82..4683c843 100644
--- a/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php
@@ -207,7 +207,7 @@ class IPxe
'isdefault' => $isDefault,
]);
$menuId = Database::lastInsertId();
- if (!array_key_exists($defaultLabel, $menuEntries) && $timeoutMs > 0) {
+ if (($defaultLabel === false || !array_key_exists($defaultLabel, $menuEntries)) && $timeoutMs > 0) {
$defaultLabel = array_keys($menuEntries)[0];
}
// Link boot entries to menu
@@ -236,7 +236,10 @@ class IPxe
if ($entry instanceof PxeSection) {
$data['hidden'] = (int)$entry->isHidden;
// Prefer explicit data from this imported menu over the defaults
- $data['title'] = self::sanitizeIpxeString($entry->title);
+ $title = self::sanitizeIpxeString($entry->title);
+ if (!empty($title)) {
+ $data['title'] = $title;
+ }
if (MenuEntry::getKeyCode($entry->hotkey) !== false) {
$data['hotkey'] = $entry->hotkey;
}
@@ -266,22 +269,28 @@ class IPxe
private static function createDefaultEntries()
{
- $query = 'INSERT IGNORE INTO serversetup_bootentry (entryid, hotkey, title, builtin, data)
- VALUES (:entryid, :hotkey, :title, 1, :data)';
- Database::exec($query,
+ Database::exec( 'INSERT IGNORE INTO serversetup_bootentry (entryid, hotkey, title, builtin, data)
+ VALUES (:entryid, :hotkey, :title, 1, :data)',
[
- 'script' => '
+ 'entryid' => 'bwlp-default',
+ 'hotkey' => 'B',
+ 'title' => 'bwLehrpool-Umgebung starten',
+ 'data' => json_encode([
+ 'script' => '
imgfree ||
set slxextra ,logo ||
initrd /boot/default/initramfs-stage31 || goto fail
initrd --name logo /tftp/bwlp.ppm.gz /etc/splash.ppm.gz || clear slxextra
boot -a -r /boot/default/kernel initrd=initramfs-stage31${slxextra} slxbase=boot/default quiet splash loglevel=5 rd.systemd.show_status=auto intel_iommu=igfx_off ${ipappend1} ${ipappend2} || goto fail
',
+ ]),
]);
+ $query = 'INSERT IGNORE INTO serversetup_bootentry (entryid, hotkey, title, builtin, data)
+ VALUES (:entryid, :hotkey, :title, 1, :data)';
Database::exec($query,
[
'entryid' => 'bwlp-default-dbg',
- 'hotkey' => '',
+ 'hotkey' => 'D',
'title' => 'bwLehrpool-Umgebung starten (nosplash, debug)',
'data' => json_encode([
'executable' => '/boot/default/kernel',