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 ='/guix/log/gnu?id=a8c1d812a030f07dbc22afa12f82539c3152a9e2'>gnu/packages/radio.scm
AgeCommit message (Expand)Author
2024-01-13gnu: sdrangel: Update to 7.17.3....* gnu/packages/radio.scm (sdrangel): Update to 7.17.3. Change-Id: Ib64a1cded8b7682eab97667036fbcdf38590ded2 Guillaume Le Vaillant
2024-01-13gnu: dsdcc: Update to 1.9.5....* gnu/packages/radio.scm (dsdcc): Update to 1.9.5. Change-Id: I47d787850932f5648aec267591e3102be86275ca Guillaume Le Vaillant
2024-01-13gnu: rtl-433: Update to 23.11....* gnu/packages/radio.scm (rtl-433): Update to 23.11. Change-Id: I06c5bdf4cffab5e27bbaa0621cb835c93656e6c2 Guillaume Le Vaillant
2023-12-12gnu: inspectrum: Update to 0.3.1....* gnu/packages/radio.scm (inspectrum): Update to 0.3.1. Change-Id: I51e81e328b332a32e19ab169c602875b21256c4c Guillaume Le Vaillant
2023-11-10gnu: sdrangel: Update to 7.17.0....* gnu/packages/radio.scm (sdrangel): Update to 7.17.0. Change-Id: I1ecd6e79c9622cba9160ece0814cdc370dd045d7 Guillaume Le Vaillant
2023-11-10gnu: multimon-ng: Update to 1.3.0....* gnu/packages/radio.scm (multimon-ng): Update to 1.3.0. Change-Id: Ibd5136b36f7bc911e47c6b3d1a6f6addc00aed9c Guillaume Le Vaillant
2023-11-10gnu: rtl-sdr: Update to 2.0.1....* gnu/packages/radio.scm (rtl-sdr): Update to 2.0.1. Change-Id: I6331ca544394ff413f123747f80c83efa7012515 Guillaume Le Vaillant
2023-11-08gnu: wsjtx: Only build html documentation on supported systems....* gnu/packages/radio.scm (wsjtx)[arguments]: Add configure-flag to skip html documentation on systems where ruby-asciidoctor isn't supported. [native-inputs]: Don't build with ruby-asciidoctor on systems where it isn't supported. Change-Id: I73436f887933e6b37033c8ba3ff32ba125a797f8 Efraim Flashner