Article 6QCEQ Stable hwmon Devices

Stable hwmon Devices

by
Valdin
from LinuxQuestions.org on (#6QCEQ)
I was reading this thread from three years ago about stable hwmon devices for monitoring programs:

fancontrol, hwmon devices change all the time


Quote:
Originally Posted by deNiro(Post 6216475)Since yesterday I'm on Slackware Current, and I really like it

However, I have an issue with the fancontrol config and hwmon links that are changing every boot, probably based on load order of the modules. This means i have to edit the config file at every bootand can not automatically run it.

At this boot session the hwmon devices are:
Code:henk@WOPR:~$ ls /sys/class/hwmon/ -al
total 0
drwxr-xr-x 2 root root 0 Feb 5 2021 ./
drwxr-xr-x 78 root root 0 Feb 5 2021 ../
lrwxrwxrwx 1 root root 0 Feb 5 14:50 hwmon0 -> ../../devices/virtual/thermal/thermal_zone0/hwmon0/
lrwxrwxrwx 1 root root 0 Feb 5 14:50 hwmon1 -> ../../devices/platform/coretemp.0/hwmon/hwmon1/
lrwxrwxrwx 1 root root 0 Feb 5 14:50 hwmon2 -> ../../devices/platform/eeepc-wmi/hwmon/hwmon2/
lrwxrwxrwx 1 root root 0 Feb 5 14:50 hwmon3 -> ../../devices/platform/nct6775.656/hwmon/hwmon3/Now I would like the order, for example, like this

Code:/sbin/modprobe thermal
/sbin/modprobe coretemp
/sbin/modprobe nct6775
/sbin/modprobe eeepc-wmi( I tried to place it in /etc/rc.d/rc.modules.local , but that's probably not the correct way to get the right sequence, because it did not work.)

So I see 2 solutions.
1.use the real device pathnames in the fancontrol config file. But this will make the config hard to read.
2. load the modules in order. But I don't know how to achieve this.

Well there is a third insane solution, which would be to create 16 fancontrol scripts, based on the 4 hwmon possibilities, and then create a bash script to do a check which is which, and then load the right fancontrolscript. But that would be pretty inefficient.

So basically is it possible to controle the module load order of these 4 modules, how can I do that?
Quote:
Originally Posted by Daedra(Post 6217474)I've also had this problem with basically all my machines. I wish they could figure out a way to make HWMON entries persistent across reboots. I read somewhere that it can de done with udev rules, but I can't confirm this.
Stable device path for Linux hwmon interfaces


Quote:
The problem
/sys/class/hwmon/hwmon2/temp1_input reports your CPU temperature.

But the next time you reboot, the path might be /sys/class/hwmon/hwmon1/temp1_input.

=> The path is not stable, so you cannot easily refer to it.

Example use case where you might need stable paths is use in i3status (itis the status bar in the animation on top of this article).
Quote:
The solution
Letis write a udev rule to make a stable device path to the CPU temperature.
It does not appear to work as is for Slackware - I don't see a name entry as referenced in the posted solution:

Code:$ cat /sys/class/hwmon/hwmon{0,1,2,3}/name
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments