Commit efb83c51 authored by Franco Fichtner's avatar Franco Fichtner

system: glxsb is only for i386, check for modules consistently

parent b41fc618
...@@ -38,14 +38,26 @@ require_once("pfsense-utils.inc"); ...@@ -38,14 +38,26 @@ require_once("pfsense-utils.inc");
require_once("services.inc"); require_once("services.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
$crypto_modules = array( function crypto_modules()
'aesni' => gettext('AES-NI CPU-based Acceleration'), {
'glxsb' => gettext('AMD Geode LX Security Block'), $crypto_modules = array(
'hifn' => gettext('Hifn 7751/7951/7811/7955/7956 Crypto Accelerator'), 'aesni' => gettext('AES-NI CPU-based Acceleration'),
'padlock' => gettext('Crypto and RNG in VIA C3, C7 and Eden Processors'), 'glxsb' => gettext('AMD Geode LX Security Block'),
'save' => gettext('SafeNet Crypto Accelerator'), 'hifn' => gettext('Hifn 7751/7951/7811/7955/7956 Crypto Accelerator'),
'ubsec' => gettext('Broadcom and BlueSteel uBsec 5x0x crypto accelerator'), 'padlock' => gettext('Crypto and RNG in VIA C3, C7 and Eden Processors'),
); 'safe' => gettext('SafeNet Crypto Accelerator'),
'ubsec' => gettext('Broadcom and BlueSteel uBsec 5x0x crypto accelerator'),
);
$available = array();
foreach ($crypto_modules as $name => $desc) {
if (file_exists("/boot/kernel/{$name}.ko")) {
$available[$name] = $desc;
}
}
return $available;
}
$thermal_hardware_modules = array( $thermal_hardware_modules = array(
'coretemp' => gettext('Intel Core* CPU on-die thermal sensor'), 'coretemp' => gettext('Intel Core* CPU on-die thermal sensor'),
...@@ -83,10 +95,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -83,10 +95,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$input_errors = array(); $input_errors = array();
$pconfig = $_POST; $pconfig = $_POST;
if (!empty($pconfig['crypto_hardware']) && !array_key_exists($pconfig['crypto_hardware'], $crypto_modules)) {
$input_errors[] = gettext("Please select a valid Cryptographic Accelerator.");
}
if (!empty($pconfig['thermal_hardware']) && !array_key_exists($pconfig['thermal_hardware'], $thermal_hardware_modules)) { if (!empty($pconfig['thermal_hardware']) && !array_key_exists($pconfig['thermal_hardware'], $thermal_hardware_modules)) {
$input_errors[] = gettext("Please select a valid Thermal Hardware Sensor."); $input_errors[] = gettext("Please select a valid Thermal Hardware Sensor.");
} }
...@@ -422,7 +430,7 @@ include("head.inc"); ...@@ -422,7 +430,7 @@ include("head.inc");
<select name="crypto_hardware" id="crypto_hardware" class="selectpicker" data-style="btn-default"> <select name="crypto_hardware" id="crypto_hardware" class="selectpicker" data-style="btn-default">
<option value=""><?=gettext("None"); ?></option> <option value=""><?=gettext("None"); ?></option>
<?php <?php
foreach ($crypto_modules as $cryptomod_name => $cryptomod_descr) :?> foreach (crypto_modules() as $cryptomod_name => $cryptomod_descr) :?>
<option value="<?=$cryptomod_name; ?>" <?=$pconfig['crypto_hardware'] == $cryptomod_name ? "selected=\"selected\"" :"";?>> <option value="<?=$cryptomod_name; ?>" <?=$pconfig['crypto_hardware'] == $cryptomod_name ? "selected=\"selected\"" :"";?>>
<?="{$cryptomod_descr} ({$cryptomod_name})"; ?> <?="{$cryptomod_descr} ({$cryptomod_name})"; ?>
</option> </option>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment