Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search for the first hwmon* directory #2888

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

imran1008
Copy link

Background and Motivation

When the hwmon-path-abs and the input-filename fields are used for the temperature module, we evaluated the following path:

[hwmon-path-abs] / [gap] / [input-filename]

where gap is the first file or directory in the hwmon-path-abs directory. This usually works but it doesn't seem to work for NVME or WiFi temperature sensors. For those cases, there are a bunch of other files in the hwmon-path-abs directory. In the bad case, the first selected file is not the one with the prefix hwmon and we end up checking the wrong location for the input-filename.

Change description

We are simply going through the hwmon-path-abs directory and searching for the first file/directory that begins with hwmon.

Test case

I tested this on a AMD based Framework 13 laptop.

Background and Motivation
-------------------------
When the `hwmon-path-abs` and the `input-filename` fields are used for
the temperature module, we evaluated the following path:

```
[hwmon-path-abs] / [gap] / [input-filename]
```

where `gap` is the first file or directory in the `hwmon-path-abs`
directory. This usually works but it doesn't seem to work for NVME or
WiFi temperature sensors. For those cases, there are a bunch of other
files in the `hwmon-path-abs` directory. In the bad case, the first
selected file is not the one with the prefix `hwmon` and we end up
checking the wrong location for the `input-filename`.

Change description
------------------
We are simply going through the `hwmon-path-abs` directory and searching
for the first file/directory that begins with `hwmon`.

Test case
---------
I tested this on a AMD based Framework 13 laptop.
@Alexays
Copy link
Owner

Alexays commented Feb 19, 2024

LGTM

@Alexays Alexays merged commit 6fbae3b into Alexays:master Feb 19, 2024
@imran1008 imran1008 deleted the hwmon-path-abs-subdir branch March 1, 2024 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants