Don't duplicate coretemp sensor readings #1822
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1708
@karabijavad I don't have a system that is affected by #1648 so I can't test that, but in theory this should handle both cases (duplicated coretemp hwmon directory entries and individual hwmon directory entries).
I chose to just to implement this as a simple string replacement / comparison since it's quicker and easier than doing a full stat() call on every temperature file to find duplicates.
On my Linux 5.7 system
/sys/class/hwmon/hwmon2
is a symlink to/sys/devices/platform/coretemp.0/hwmon/hwmon2
meaning if you replace the leading/sys/devices/platform/coretemp.*/hwmon/
with/sys/class/hwmon/
, you can quickly and easily check for duplicates.