lm_sensors-3.3.5-upstream_fixes-1.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. Submitted By: Fernando de Oliveira <famobr at yahoo dot com dot br>
  2. Date: 2014-05-21
  3. Initial Package Version: 3.3.5
  4. Upstream Status: Fixed
  5. Origin: Upstream
  6. URL: http://www.lm-sensors.org/changeset/6216
  7. http://www.lm-sensors.org/changeset/6237
  8. Description: sensors.conf.default: Add support for NCT6779 and NCT6791
  9. fancontrol: Deal with moving hwmon attributes
  10. diff -Naur lm_sensors-3.3.5.orig/etc/sensors.conf.default lm_sensors-3.3.5/etc/sensors.conf.default
  11. --- lm_sensors-3.3.5.orig/etc/sensors.conf.default 2012-01-31 11:25:29.057246000 -0300
  12. +++ lm_sensors-3.3.5/etc/sensors.conf.default 2014-05-21 09:35:56.110779242 -0300
  13. @@ -308,7 +308,7 @@
  14. # set in8_max 3.0 * 1.10
  15. -chip "w83627ehf-*" "w83627dhg-*" "w83667hg-*" "nct6775-*" "nct6776-*"
  16. +chip "w83627ehf-*" "w83627dhg-*" "w83667hg-*" "nct6775-*" "nct6776-*" "nct6779-*" "nct6791-*"
  17. label in0 "Vcore"
  18. label in2 "AVCC"
  19. diff -Naur lm_sensors-3.3.5.orig/prog/pwm/fancontrol lm_sensors-3.3.5/prog/pwm/fancontrol
  20. --- lm_sensors-3.3.5.orig/prog/pwm/fancontrol 2013-05-23 11:09:22.043242000 -0300
  21. +++ lm_sensors-3.3.5/prog/pwm/fancontrol 2014-05-21 09:35:56.109779277 -0300
  22. @@ -206,6 +206,65 @@
  23. return $outdated
  24. }
  25. +function FixupDeviceFiles
  26. +{
  27. + local DEVICE="$1"
  28. + local fcvcount pwmo tsen fan
  29. +
  30. + let fcvcount=0
  31. + while (( $fcvcount < ${#AFCPWM[@]} )) # go through all pwm outputs
  32. + do
  33. + pwmo=${AFCPWM[$fcvcount]}
  34. + AFCPWM[$fcvcount]=${pwmo//$DEVICE\/device/$DEVICE}
  35. + if [ "${AFCPWM[$fcvcount]}" != "$pwmo" ]
  36. + then
  37. + echo "Adjusing $pwmo -> ${AFCPWM[$fcvcount]}"
  38. + fi
  39. + let fcvcount=$fcvcount+1
  40. + done
  41. +
  42. + let fcvcount=0
  43. + while (( $fcvcount < ${#AFCTEMP[@]} )) # go through all temp inputs
  44. + do
  45. + tsen=${AFCTEMP[$fcvcount]}
  46. + AFCTEMP[$fcvcount]=${tsen//$DEVICE\/device/$DEVICE}
  47. + if [ "${AFCTEMP[$fcvcount]}" != "$tsen" ]
  48. + then
  49. + echo "Adjusing $tsen -> ${AFCTEMP[$fcvcount]}"
  50. + fi
  51. + let fcvcount=$fcvcount+1
  52. + done
  53. +
  54. + let fcvcount=0
  55. + while (( $fcvcount < ${#AFCFAN[@]} )) # go through all fan inputs
  56. + do
  57. + fan=${AFCFAN[$fcvcount]}
  58. + AFCFAN[$fcvcount]=${fan//$DEVICE\/device/$DEVICE}
  59. + if [ "${AFCFAN[$fcvcount]}" != "$fan" ]
  60. + then
  61. + echo "Adjusing $fan -> ${AFCFAN[$fcvcount]}"
  62. + fi
  63. + let fcvcount=$fcvcount+1
  64. + done
  65. +}
  66. +
  67. +# Some drivers moved their attributes from hard device to class device
  68. +function FixupFiles
  69. +{
  70. + local DEVPATH="$1"
  71. + local entry device
  72. +
  73. + for entry in $DEVPATH
  74. + do
  75. + device=`echo "$entry" | sed -e 's/=[^=]*$//'`
  76. +
  77. + if [ -e "$device/name" ]
  78. + then
  79. + FixupDeviceFiles "$device"
  80. + fi
  81. + done
  82. +}
  83. +
  84. # Check that all referenced sysfs files exist
  85. function CheckFiles
  86. {
  87. @@ -306,6 +365,10 @@
  88. echo "Configuration appears to be outdated, please run pwmconfig again" >&2
  89. exit 1
  90. fi
  91. +if [ "$DIR" = "/sys/class/hwmon" ]
  92. +then
  93. + FixupFiles "$DEVPATH"
  94. +fi
  95. CheckFiles || exit 1
  96. if [ -f "$PIDFILE" ]