fancontrol: Deal with moving hwmon attributes Several kernel drivers have already moved their attributes from the hardware device to the hwmon class device, and others will follow. Teach fancontrol about this possibility and let it adjust the attribute paths transparently. Patch by Jean Delvare . See . --- lm-sensors/prog/pwm/fancontrol (revision 6172) +++ lm-sensors/prog/pwm/fancontrol (revision 6216) @@ -207,4 +207,63 @@ } +function FixupDeviceFiles +{ + local DEVICE="$1" + local fcvcount pwmo tsen fan + + let fcvcount=0 + while (( $fcvcount < ${#AFCPWM[@]} )) # go through all pwm outputs + do + pwmo=${AFCPWM[$fcvcount]} + AFCPWM[$fcvcount]=${pwmo//$DEVICE\/device/$DEVICE} + if [ "${AFCPWM[$fcvcount]}" != "$pwmo" ] + then + echo "Adjusing $pwmo -> ${AFCPWM[$fcvcount]}" + fi + let fcvcount=$fcvcount+1 + done + + let fcvcount=0 + while (( $fcvcount < ${#AFCTEMP[@]} )) # g
aboutsummaryrefslogtreecommitdiff
+365,8 @@ echo "Configuration appears to be outdated, please run pwmconfig again" >&2 exit 1 +fi +if [ "$DIR" = "/sys/class/hwmon" ] +then + FixupFiles "$DEVPATH" fi CheckFiles || exit 1