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[@]} )) # go through all temp inputs + do + tsen=${AFCTEMP[$fcvcount]} + AFCTEMP[$fcvcount]=${tsen//$DEVICE\/device/$DEVICE} + if [ "${AFCTEMP[$fcvcount]}" != "$tsen" ] + then + echo "Adjusing $tsen -> ${AFCTEMP[$fcvcount]}" + fi + let fcvcount=$fcvcount+1 + done + + let fcvcount=0 + while (( $fcvcount < ${#AFCFAN[@]} )) # go through all fan inputs + do + fan=${AFCFAN[$fcvcount]} + AFCFAN[$fcvcount]=${fan//$DEVICE\/device/$DEVICE} + if [ "${AFCFAN[$fcvcount]}" != "$fan" ] + then + echo "Adjusing $fan -> ${AFCFAN[$fcvcount]}" + fi + let fcvcount=$fcvcount+1 + done +} + +# Some drivers moved their attributes from hard device to class device +function FixupFiles +{ + local DEVPATH="$1" + local entry device + + for entry in $DEVPATH + do + device=`echo "$entry" | sed -e 's/=[^=]*$//'` + + if [ -e "$device/name" ] + then + FixupDeviceFiles "$device" + fi + done +} + # Check that all referenced sysfs files exist function CheckFiles @@ -306,4 +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 f8a1baecdfe022373'>root/gnu/packages/gnu-pw-mgr.scm
AgeCommit message (Expand)Author
2016-05-22gnu: gnu-pw-mgr: Update to 2.0....Efraim Flashner
2015-10-21gnu: gnu-pw-mgr: Update to 1.6....Ludovic Courtès
2015-09-20gnu: gnu-pw-mgr: Update to 1.5....Eric Bavier
2015-06-02gnu: gnu-pw-mgr: Update to 1.4....Mark H Weaver
2015-03-04gnu: Move 'which' to (gnu packages base)....Ludovic Courtès
2015-03-01gnu: gnu-pw-mgr: Update to 1.3....Mark H Weaver
2014-03-26gnu: gnu-pw-mgr: Fix download location....Andreas Enge
2014-03-25gnu: gnu-pw-mgr: Upgrade to 1.2...Eric Bavier
2014-02-06gnu: gnu-pw-mgr: Upgrade to 1.1....Eric Bavier
2013-12-03gnu: Add gnu-pw-mgr...Eric Bavier