vmatare / thinkfan

The minimalist fan control program
GNU General Public License v3.0
541 stars 62 forks source link

Recursive symlink in hwmon path is followed #154

Open ceaum opened 3 years ago

ceaum commented 3 years ago

I am using a Lenovo ThinkPad T420. I wish to use the temp file at

/sys/devices/virtual/thermal/thermal_zone0/hwmonX/temp_1input

where hwmonX fluctuates between boots, which means I can not specify a full path.

A hwmon name file (containing acpitz) is present in hwmonX. However, /sys/devices/virtual/thermal/thermal_zone0 contains a symlink device, which contains a symlink (named thermal_zone) back to thermal_zone0.

Hence, specifying

sensors:
  - hwmon: /sys/devices/virtual/thermal/thermal_zone0
    name: acpitz

gives error

ERROR: /etc/thinkfan.yaml:7:
    name: acpitz
          ^
Found multiple hwmons with this name:  /sys/devices/virtual/thermal/thermal_zone0//hwmonX /sys/devices/virtual/thermal/thermal_zone0//device/thermal_zone/hwmonX.

Is there a way to specify my desired temp file?

koutheir commented 3 years ago

I also encountered this error with the same semantics, on a Thinkpad P15 Gen 1.

Here is my work around the issue: instead of using /sys/devices/virtual/thermal/thermal_zone0 as the hwmon value, I used /sys/class/hwmon instead.