diff options
author | jim-p <jimp@pfsense.org> | 2012-07-06 14:38:21 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-07-06 14:38:21 -0400 |
commit | f60156f68f615dc137391f3a909a0ee7a0c3c003 (patch) | |
tree | 74b68111dd4378a00aacf3a22383aad24647815d /etc/inc/pfsense-utils.inc | |
parent | 0f03ae0fb50ff10e2e41566ee04ce974c05b2670 (diff) | |
download | pfsense-f60156f68f615dc137391f3a909a0ee7a0c3c003.zip pfsense-f60156f68f615dc137391f3a909a0ee7a0c3c003.tar.gz |
Add an option to System > Advanced, misc tab to enable loading thermal modules (amdtemp, coretemp)
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 17 |
1 files changed, 17 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 |