summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-04-03 15:21:11 +0200
committerSimon Rettberg2019-04-03 15:21:11 +0200
commitf6150477c558212418070ed97db34a7ed5940169 (patch)
tree97836e59a24ed5d0f43635851d70380d8662aa40
parent[serversetup-bwlp-ipxe] Use --nouser for OpenSLX iPXE (diff)
downloadslx-admin-f6150477c558212418070ed97db34a7ed5940169.tar.gz
slx-admin-f6150477c558212418070ed97db34a7ed5940169.tar.xz
slx-admin-f6150477c558212418070ed97db34a7ed5940169.zip
[serversetup-bwlp-ipxe] Reset bwlp bootentries on install
-rw-r--r--modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php6
-rw-r--r--modules-available/serversetup-bwlp-ipxe/install.inc.php2
2 files changed, 5 insertions, 3 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php
index 2aecd70f..856ecfb5 100644
--- a/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/inc/ipxe.inc.php
@@ -329,10 +329,10 @@ class IPxe
}
}
- private static function createDefaultEntries()
+ public static function createDefaultEntries()
{
Database::exec( 'INSERT IGNORE INTO serversetup_bootentry (entryid, hotkey, title, builtin, data)
- VALUES (:entryid, :hotkey, :title, 1, :data)',
+ VALUES (:entryid, :hotkey, :title, 1, :data) ON DUPLICATE KEY UPDATE data = VALUES(data)',
[
'entryid' => 'bwlp-default',
'hotkey' => 'B',
@@ -348,7 +348,7 @@ boot -a -r /boot/default/kernel initrd=initramfs-stage31 ${slxextra} slxbase=boo
]),
]);
$query = 'INSERT IGNORE INTO serversetup_bootentry (entryid, hotkey, title, builtin, data)
- VALUES (:entryid, :hotkey, :title, 1, :data)';
+ VALUES (:entryid, :hotkey, :title, 1, :data) ON DUPLICATE KEY UPDATE data = VALUES(data)';
Database::exec($query,
[
'entryid' => 'bwlp-default-dbg',
diff --git a/modules-available/serversetup-bwlp-ipxe/install.inc.php b/modules-available/serversetup-bwlp-ipxe/install.inc.php
index 5e7f2440..dc6d145e 100644
--- a/modules-available/serversetup-bwlp-ipxe/install.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/install.inc.php
@@ -110,4 +110,6 @@ if (Module::get('location') !== false) {
}
}
+IPxe::createDefaultEntries();
+
responseFromArray($res);