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 e20bee6e31790a16153'>tests/base16.scm
s/mpd.scm?id=d6f773571d7292229b8d29e38ab50696eccbb64a&showmsg=1'>Expand)
AgeCommit message (Expand)Author
Author
2023-07-01gnu: mympd: Update to 10.3.3....Bruno Victal
2023-06-04gnu: mpd: Split outputs....Bruno Victal
2023-06-04gnu: mpd: Enable tests....Bruno Victal
2023-06-04gnu: mpd: Update to 0.23.13....Leo Famulari
2023-05-19gnu: mympd: Update to 10.3.2....Bruno Victal
2023-04-25gnu: mpdevil: Add missing input....Efraim Flashner
2023-04-23gnu: ncmpc: Update to 0.48....Leo Famulari
2023-04-21gnu: mpdevil: Update to 1.10.2....kiasoc5
2023-03-27gnu: mympd: Update to 10.2.6....Bruno Victal
2023-03-02gnu: mympd: Update to 10.2.4....Bruno Victal
2023-02-23gnu: mpdris2: Remove input labels and add inputs....Simon Streit
2023-02-12gnu: mympd: Update to 10.2.3....Bruno Victal
2023-02-11gnu: mympd: Update to 10.2.2....Bruno Victal
2023-02-05gnu: mpd: Update to 0.23.12....Bruno Victal
2023-02-05gnu: mpd: Add missing inputs....Bruno Victal
2023-02-03gnu: mympd: Update to 10.2.1....Bruno Victal
2023-01-29gnu: mpdevil: Update to 1.10.0...Simon Streit
2023-01-28gnu: mympd: Update to 10.2.0....Bruno Victal
2023-01-08gnu: Switch to default pipewire....Mathieu Othacehe