summarylogtreecommitdiffstats
path: root/fancontrol-max-of-fctemps.patch
diff options
context:
space:
mode:
authorSaren Arterius2017-08-26 22:23:54 +0800
committerSaren Arterius2017-08-26 22:30:45 +0800
commitf531c94decbff759fa0a41fe5d505eba015449c3 (patch)
tree609e1fb21a0dfdd1b0f98f7090536869178d284d /fancontrol-max-of-fctemps.patch
downloadaur-lm_sensors-max_of_fctemps.tar.gz
First commit
Diffstat (limited to 'fancontrol-max-of-fctemps.patch')
-rw-r--r--fancontrol-max-of-fctemps.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/fancontrol-max-of-fctemps.patch b/fancontrol-max-of-fctemps.patch
new file mode 100644
index 00000000000..4c098edc8dd
--- /dev/null
+++ b/fancontrol-max-of-fctemps.patch
@@ -0,0 +1,68 @@
+Chusslove Illich (Часлав Илић)
+Index: doc/fancontrol.txt
+===================================================================
+--- doc/fancontrol.txt (revision 6037)
++++ doc/fancontrol.txt (working copy)
+@@ -37,6 +37,10 @@
+ Maps pwm outputs to temperature sensors so fancontrol knows which
+ temperature sensors should be used for calculation of new values for
+ the corresponding pwm outputs.
++ Several temperature sensors may be mapped to single pwm output
++ as a comma-separated list, in which case the maximum of all readings
++ is taken as the referent temperature. This is useful for a CPU fan
++ on a multi-core CPU with separate temperature sensors per core.
+
+ FCFANS
+ FCFANS records the association between a pwm and a fan.
+Index: prog/pwm/fancontrol
+===================================================================
+--- prog/pwm/fancontrol (revision 6037)
++++ prog/pwm/fancontrol (working copy)
+@@ -224,12 +224,14 @@
+ let fcvcount=0
+ while (( $fcvcount < ${#AFCTEMP[@]} )) # go through all temp inputs
+ do
+- tsen=${AFCTEMP[$fcvcount]}
+- if [ ! -r $tsen ]
+- then
+- echo "Error: file $tsen doesn't exist" >&2
+- outdated=1
+- fi
++ for tsen in $(echo ${AFCTEMP[$fcvcount]} | tr ',' ' ')
++ do
++ if [ ! -r $tsen ]
++ then
++ echo "Error: file $tsen doesn't exist" >&2
++ outdated=1
++ fi
++ done
+ let fcvcount=$fcvcount+1
+ done
+
+@@ -391,12 +393,20 @@
+ minpwm=${AFCMINPWM[$fcvcount]}
+ maxpwm=${AFCMAXPWM[$fcvcount]}
+
+- read tval < ${tsens}
+- if [ $? -ne 0 ]
+- then
+- echo "Error reading temperature from $DIR/$tsens"
+- restorefans 1
+- fi
++ tval=0
++ for tsen in $(echo ${tsens} | tr ',' ' ')
++ do
++ read tval1 < ${tsen}
++ if [ $? -ne 0 ]
++ then
++ echo "Error reading temperature from $DIR/$tsen"
++ restorefans 1
++ fi
++ if [ $tval -lt $tval1 ]
++ then
++ tval=$tval1
++ fi
++ done
+
+ read pwmpval < ${pwmo}
+ if [ $? -ne 0 ]