diff options
author | Simon Rettberg | 2021-09-21 16:52:06 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-03-09 15:06:54 +0100 |
commit | 67e6b6c9981207d7d658f2ad2bf1c39b75c099c7 (patch) | |
tree | d2f54c424dd983a1500acf0d3d0bc3bbfee6e9cd /modules-available/minilinux | |
parent | [statistics] Support new json-format of hardware info from client (diff) | |
download | slx-admin-67e6b6c9981207d7d658f2ad2bf1c39b75c099c7.tar.gz slx-admin-67e6b6c9981207d7d658f2ad2bf1c39b75c099c7.tar.xz slx-admin-67e6b6c9981207d7d658f2ad2bf1c39b75c099c7.zip |
[passthrough] New module for managing hardware passthrough for QEMU
Diffstat (limited to 'modules-available/minilinux')
-rw-r--r-- | modules-available/minilinux/inc/linuxbootentryhook.inc.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/modules-available/minilinux/inc/linuxbootentryhook.inc.php b/modules-available/minilinux/inc/linuxbootentryhook.inc.php index e57336f0..9e10bd6e 100644 --- a/modules-available/minilinux/inc/linuxbootentryhook.inc.php +++ b/modules-available/minilinux/inc/linuxbootentryhook.inc.php @@ -15,7 +15,7 @@ class LinuxBootEntryHook extends BootEntryHook return Dictionary::translateFileModule('minilinux', 'module', 'module_name', true); } - public function extraFields() + public function extraFields(): array { /* For translate module: * Dictionary::translate('ipxe-kcl-extra'); @@ -32,7 +32,7 @@ class LinuxBootEntryHook extends BootEntryHook /** * @return HookEntryGroup[] */ - protected function groupsInternal() + protected function groupsInternal(): array { /* * Dictionary::translate('default_boot_entry'); @@ -76,7 +76,7 @@ class LinuxBootEntryHook extends BootEntryHook * @param $localData * @return BootEntry the actual boot entry instance for given entry, false if invalid id */ - public function getBootEntryInternal($localData) + public function getBootEntryInternal($localData): BootEntry { $id = $localData['id']; if ($id === 'default') { // Special case @@ -125,7 +125,7 @@ class LinuxBootEntryHook extends BootEntryHook return BootEntry::newStandardBootEntry($bios, $efi, $arch); } - private function generateExecData($effectiveId, $remoteData, $localData) + private function generateExecData($effectiveId, $remoteData, $localData): ExecData { $exec = new ExecData(); // Defaults @@ -146,9 +146,7 @@ class LinuxBootEntryHook extends BootEntryHook if (!empty($localData['debug'])) { // Debug boot enabled $exec->commandLine = IPxe::modifyCommandLine($exec->commandLine, - isset($remoteData['debugCommandLineModifier']) - ? $remoteData['debugCommandLineModifier'] - : '-vga -quiet -splash -loglevel loglevel=7' + $remoteData['debugCommandLineModifier'] ?? '-vga -quiet -splash -loglevel loglevel=7' ); } // disable all CPU sidechannel attack mitigations etc. @@ -156,6 +154,14 @@ class LinuxBootEntryHook extends BootEntryHook $exec->commandLine = IPxe::modifyCommandLine($exec->commandLine, 'noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off mitigations=off'); } + // GVT, PCI Pass-thru etc. + if (Module::isAvailable('statistics')) { + $hwextra = HardwareInfo::getKclModifications(); + if (!empty($hwextra)) { + $exec->commandLine = IPxe::modifyCommandLine($exec->commandLine, $hwextra); + } + } + // User-supplied modifications if (!empty($localData['kcl-extra'])) { $exec->commandLine = IPxe::modifyCommandLine($exec->commandLine, $localData['kcl-extra']); } |