diff options
-rw-r--r-- | etc/inc/pfsense-utils.inc | 17 | ||||
-rwxr-xr-x | etc/rc.bootup | 3 | ||||
-rw-r--r-- | usr/local/www/system_advanced_misc.php | 37 |
3 files changed, 57 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 3e5fa24..f809371 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1567,6 +1567,23 @@ function load_crypto() { } } +/* + * load_thermal_hardware() - Load temperature monitor kernel module + */ +function load_thermal_hardware() { + global $config, $g; + $thermal_hardware_modules = array('coretemp', 'amdtemp'); + + if (!in_array($config['system']['thermal_hardware'], $thermal_hardware_modules)) + return false; + + $is_loaded = `/sbin/kldstat | /usr/bin/grep -c {$config['system']['thermal_hardware']}`; + if (!empty($config['system']['thermal_hardware']) && ($is_loaded == 0)) { + log_error("Loading {$config['system']['thermal_hardware']} thermal monitor module."); + mwexec("/sbin/kldload {$config['system']['thermal_hardware']}"); + } +} + /****f* pfsense-utils/isvm * NAME * isvm diff --git a/etc/rc.bootup b/etc/rc.bootup index c21a4d5..b6dad33 100755 --- a/etc/rc.bootup +++ b/etc/rc.bootup @@ -223,6 +223,9 @@ echo "done.\n"; /* enable optional crypto modules */ load_crypto(); +/* enable optional thermal sensor modules */ +load_thermal_hardware(); + /* run any early shell commands specified in config.xml */ system_do_shell_commands(1); diff --git a/usr/local/www/system_advanced_misc.php b/usr/local/www/system_advanced_misc.php index d1d07aa..2309a4b 100644 --- a/usr/local/www/system_advanced_misc.php +++ b/usr/local/www/system_advanced_misc.php @@ -65,6 +65,7 @@ $pconfig['maxmss_enable'] = isset($config['system']['maxmss_enable']); $pconfig['maxmss'] = $config['system']['maxmss']; $pconfig['powerd_enable'] = isset($config['system']['powerd_enable']); $pconfig['crypto_hardware'] = $config['system']['crypto_hardware']; +$pconfig['thermal_hardware'] = $config['system']['thermal_hardware']; $pconfig['schedule_states'] = isset($config['system']['schedule_states']); $pconfig['kill_states'] = isset($config['system']['kill_states']); @@ -76,6 +77,9 @@ else $crypto_modules = array('glxsb' => gettext("AMD Geode LX Security Block"), 'aesni' => gettext("AES-NI CPU-based Acceleration")); +$thermal_hardware_modules = array( 'coretemp' => gettext("Intel Core* CPU on-die thermal sensor"), + 'amdtemp' => gettext("AMD K8, K10 and K11 CPU on-die thermal sensor")); + if ($_POST) { unset($input_errors); @@ -87,6 +91,9 @@ if ($_POST) { if (!empty($_POST['crypto_hardware']) && !array_key_exists($_POST['crypto_hardware'], $crypto_modules)) $input_errors[] = gettext("Please select a valid Cryptographic Accelerator."); + if (!empty($_POST['thermal_hardware']) && !array_key_exists($_POST['thermal_hardware'], $thermal_hardware_modules)) + $input_errors[] = gettext("Please select a valid Thermal Hardware Sensor."); + if (!$input_errors) { if($_POST['harddiskstandby'] <> "") { @@ -172,6 +179,11 @@ if ($_POST) { else unset($config['system']['crypto_hardware']); + if($_POST['thermal_hardware']) + $config['system']['thermal_hardware'] = $_POST['thermal_hardware']; + else + unset($config['system']['thermal_hardware']); + if($_POST['schedule_states'] == "yes") $config['system']['schedule_states'] = true; else @@ -194,6 +206,7 @@ if ($_POST) { activate_powerd(); load_crypto(); + load_thermal_hardware(); vpn_ipsec_configure_preferoldsa(); if ($need_racoon_restart) vpn_ipsec_force_reload(); @@ -392,6 +405,30 @@ function maxmss_checked(obj) { <td colspan="2" class="list" height="12"> </td> </tr> <tr> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Thermal Sensors"); ?></td> + </tr> + <tr> + <td width="22%" valign="top" class="vncell"><?=gettext("Thermal Sensors"); ?></td> + <td width="78%" class="vtable"> + <select name="thermal_hardware" id="thermal_hardware"> + <option value=""><?php echo gettext("None/ACPI"); ?></option> + <?php foreach ($thermal_hardware_modules as $themalmod_name => $themalmod_descr): ?> + <option value="<?php echo $themalmod_name; ?>" <?php if ($pconfig['thermal_hardware'] == $themalmod_name) echo " selected"; ?>><?php echo "{$themalmod_descr} ({$themalmod_name})"; ?></option> + <?php endforeach; ?> + </select> + <br /> + <?=gettext("If you have a supported CPU, selecting a themal sensor will load the appropirate " . + "driver to read its temperature. Setting this to 'None' will attempt to read the " . + "temperature from an ACPI-compliant motherboard sensor instead, if one is present."); ?> + <br/><br/> + <?=gettext("If you do not have a supported thermal sensor chip in your system, this option will have no " . + "effect. To unload the selected module, set this option to 'none' and then reboot."); ?> + </td> + </tr> + <tr> + <td colspan="2" class="list" height="12"> </td> + </tr> + <tr> <td colspan="2" valign="top" class="listtopic"><?=gettext("IP Security"); ?></td> </tr> <tr> |