summaryrefslogtreecommitdiffstats
path: root/etc/inc/pfsense-utils.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-07-06 14:38:21 -0400
committerjim-p <jimp@pfsense.org>2012-07-06 14:38:21 -0400
commitf60156f68f615dc137391f3a909a0ee7a0c3c003 (patch)
tree74b68111dd4378a00aacf3a22383aad24647815d /etc/inc/pfsense-utils.inc
parent0f03ae0fb50ff10e2e41566ee04ce974c05b2670 (diff)
downloadpfsense-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.inc17
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
OpenPOWER on IntegriCloud