5487 Commits
Author SHA1 Message Date
Michal Suchanek cb9a02a340 sensors: Test that JSON is well-formed on read error
Fixes: #121 #513
2026-05-06 14:19:44 +00:00
Michal Suchanek 639e040445 sysfs: Allow file symlinks
To test behavior on read error the test file can be linked to something
like /proc/self/mem that does not support read() but currently all
symlinks are skipped. Use fstatat instead of the directory entry type to
determine file type.
2026-05-06 14:19:44 +00:00
Michal Suchanek 66c2951a47 README: Add information on saving sensor data 2026-05-06 14:19:44 +00:00
Michal Suchanek 9ba090310a GitHub tests: Remove debug print 2026-05-06 14:19:44 +00:00
Aurelien Jarno 927568e956 Makefile: do not use a temporary file to test iconv
Using a predictible temporary file name in /tmp is a security risk. It
could be used to overwrite or delete arbitrary files through a symlink,
possibly as root when running for instance "sudo make install".

Use "-o /dev/null" instead, which is supported by at least clang and
gcc.

Fixes: 68bda21952
2026-04-27 07:36:53 +00:00
Aurelien Jarno 039d0901bc sensors: remove duplicated LIBICONV definition from Module.mk
LIBICONV is already defined in the top level Makefile, so it does not
need to be redefined in prog/sensors/Module.mk.

In addition the latter version causes a.out file to be created when
running make targets, even "make clean".

Fixes: 68bda21952
2026-04-27 07:36:53 +00:00
Aurelien Jarno 9a17b6ec6a sensors.conf.5: editorial fixes
Submitted by Bjarni Ingi Gislason <bjarniig@simnet.is> via the Debian
BTS, bug #1051093.
2026-04-24 07:01:28 +00:00
Aurelien Jarno ed0ff3d18c sensors-detect.8: editorial fixes
Submitted by Bjarni Ingi Gislason <bjarniig@simnet.is> via the Debian
BTS, bug #1051123.
2026-04-24 07:01:28 +00:00
Aurelien Jarno 7d098e6af0 sensors-conf-convert.8: editorial fixes
Submitted by Bjarni Ingi Gislason <bjarniig@simnet.is> via the Debian
BTS, bug #1051117.
2026-04-24 07:01:28 +00:00
Aurelien Jarno 97ef21e5ef sensors.1: editorial fixes
Submitted by Bjarni Ingi Gislason <bjarniig@simnet.is> via the Debian
BTS, bug #1050985.
2026-04-24 07:01:28 +00:00
Aurelien Jarno 53b2e83051 isaset.8: editorial fixes
Submitted by Bjarni Ingi Gislason <bjarniig@simnet.is> via the Debian
BTS, bug #1051115.
2026-04-24 07:01:28 +00:00
Aurelien Jarno 4fd2346cf7 isadump.8: editorial fixes
Submitted by Bjarni Ingi Gislason <bjarniig@simnet.is> via the Debian
BTS, bug #1051114.
2026-04-24 07:01:28 +00:00
Alexander Krikun 8c2dd4996b sensors: add label for nct6799 to sensors.conf defaults 2026-04-23 13:53:19 +00:00
Alexander Krikun 4f00d78b0f sensors-detect: Add support for NCT6799D
Also adds support for NCT6796D-S
2026-04-23 13:53:19 +00:00
ilya guterman d81c79c578 Enable support for new kernel it87 devices
IT8623E - https://github.com/torvalds/linux/blob/5bc1018675ec28a8a60d83b378d8c3991faa5a27/drivers/hwmon/it87.c#L17
IT8732F - https://github.com/torvalds/linux/blob/5bc1018675ec28a8a60d83b378d8c3991faa5a27/drivers/hwmon/it87.c#L27
IT87952E - https://github.com/torvalds/linux/blob/5bc1018675ec28a8a60d83b378d8c3991faa5a27/drivers/hwmon/it87.c#L37
IT8628E - https://github.com/torvalds/linux/blob/5bc1018675ec28a8a60d83b378d8c3991faa5a27/drivers/hwmon/it87.c#L18
2026-04-23 13:48:02 +00:00
Michal Suchánek b2117ef3dc Merge pull request #566 from lm-sensors/development
Update with changes from hramrach/lm_sensors
2026-04-23 11:47:31 +00:00
Joe Orton 7f9c917b28 Rename README to README.md, update to markdown. 2026-04-23 13:45:07 +02:00
Joe Orton 13cc9a642f Rename README to README.md, update to markdown. 2026-04-23 12:27:04 +01:00
Michal Suchanek 2b8073674e GitHub tests: Add coverage report 2026-04-23 10:54:00 +02:00
Aurelien Jarno 6282f6925a Emit missing sensor warning only if SENSORS_SYSFS_ROOT is defined
The lm-sensors library is widely used in various software, which could
be run in VMs where HWMON support may be absent (e.g. cloud kernels in
Debian). To avoid a confusing "/sys: No sensors at /sys/class/hwmon" on
the console or in the logs, only emit the message if the user specifies
an alternative path through SENSORS_SYSFS_ROOT. This behavior mirrors
what is done for the "Not a sysfs mount" message.

Fixes: 89548dab2a ("Add SENSORS_SYSFS_ROOT environment support")
2026-04-21 13:43:41 +02:00
Michael Lettrich 01359701a2 [FIX] ISA sysfs address parsing allow dashes
The ISA sensor chip address is obtained by parsing the hwmon
 `/sysfs` device path. The regular expression extracting the
device address will fail if the device name contains dashes and
sets the address to 0. If  multiple instances of the same
board are plugged into the same system, cards can no longer be
distinguished, because their addresses will be set to 0 incorrectly.

This fix changes the address-parsing regular expression to recognize
device names with dashes.
2026-04-21 13:34:11 +02:00
graysky 68bda21952 Fix iconv linking detection for glibc-based builds
The current iconv detection checks if libiconv.so exists via ldconfig,
but fails on glibc systems where iconv is built into libc and doesn't
require separate linking. This causes build failures:

  ld: cannot find -liconv: No such file or directory

Replace the ldconfig check with a compile test that actually verifies
if iconv functions are available without additional libraries. This
correctly detects glibc's built-in iconv while still linking -liconv
on musl/uclibc systems that need it.

Fixes build on glibc-based systems including OpenWrt glibc targets.
2026-04-21 13:32:57 +02:00
xaizek 62a9553191 pwm: fix bad scaling due to use of integer type
This fixes commit c1a1f4ff20 ("pwm: Move
scaling factor from sensors prog to library") which didn't account for
return type of `get_type_scaling()` being `int` rather than `double` or
`float`, so the scaling was done by a factor of 2 instead of 2.55, thus
making the result off by quite a lot.

ms: adjust test
2026-04-21 13:24:21 +02:00
Michal Suchanek c297368a0e tests: Do not use config file in json test
Pass -c /dev/null when running tests

Fixes: e06d99df ("tests: Add trivial json formatting test")
2024-02-17 12:50:05 +01:00
Michal Suchanek 2d18c0952a fancontrol: Uplift the --check option
- do not duplicate the load code
 - add description to man page
2024-02-17 12:41:20 +01:00
Aurelien Jarno c2df8a4183 fancontrol: Add --check option to only check configuration syntax
References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582979
2024-02-17 12:41:20 +01:00
Michal Suchanek 5f35944bc4 sensors-detect: Try more locations of udevadm
References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852558
2024-02-17 12:06:28 +01:00
Micah Gersten 71fb47f1b5 sensors-detect: Recognize 2 digit kernel version
References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=630508
2024-02-17 12:06:28 +01:00
Aurelien Jarno b7b10c0065 sensors-detect: Recognize more chips
References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588355

ADT7466 -> lm85
SCH5524-NS -> none
2024-02-17 12:06:28 +01:00
Aurelien Jarno 0be39ad911 sensors-conf-convert: Convert voltage formulas correctly
References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=456774
2024-02-17 12:06:28 +01:00
Michal Suchanek 9e5156cb67 check: Check perl program syntax 2024-02-17 12:06:28 +01:00
Michal Suchanek 1c757b34a7 Fix build with extra libraries
Fixes: c829b4c7 ("Add LDFLAGS handling similar to CFLAGS")
2024-01-27 14:39:51 +01:00
Michal Suchanek 51f74751ae Add more junk files to .gitignore 2024-01-27 14:39:51 +01:00
Michal Suchanek c0c82d0bca Run test as GitHub Action 2024-01-17 22:00:49 +01:00
Michal Suchanek e06d99df7c tests: Add trivial json formatting test 2024-01-17 19:43:50 +01:00
Michal Suchanek 989f387a9a tests: shellcheck the debug progs 2024-01-17 19:41:20 +01:00
Michal Suchanek 06bd510ef7 Install troubleshooting tools 2024-01-17 19:39:46 +01:00
Michal Suchanek 9aa83ee190 sensors-save: New debug tool for saving sensor data from sysfs 2024-01-17 19:39:46 +01:00
Michal Suchanek 905634f182 sensors-find-driver: Convert README to man page 2024-01-17 19:39:46 +01:00
Michal Suchanek 3a5737fe7b Rename find-driver -> sensors-find-driver 2024-01-17 19:39:46 +01:00
Michal Suchanek 0b771017be Append the "+git" post-release marker to LM_VERSION 2024-01-13 17:05:48 +01:00
Michal Suchanek 5c3ba50f80 Release version 3.6.2 V3-6-2 2024-01-13 17:03:31 +01:00
Michal Suchanek 4bf8e37e0f Update API description
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2024-01-08 22:21:05 +01:00
Michal Suchanek 89548dab2a Add SENSORS_SYSFS_ROOT environment support
With this the hardcoded /sys location for reading sensor data can be
changed. In particular it makes it possible to tar up the /sys directory
when a problem is encountered, and then reproduce it on another system.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2024-01-07 21:20:39 +01:00
Michal Suchanek 25108fe4a4 More robust reading of labels
When the sysfs file is copied to a plain file it may contain trailing
zeroes which is not handled well by the label reading code.
2024-01-07 21:20:39 +01:00
Michal Suchanek 3bbd975860 quantity: Add enumeration type
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2024-01-06 23:05:07 +01:00
Michal Suchanek 502ce051fe sensors_temperature_type_name: New library function
Decode temperature sensor type to a string.

Add enum for temperature types.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2024-01-06 23:04:46 +01:00
Michal Suchanek 0c097bfca4 parser: Strip trailing whitespace 2024-01-06 20:26:05 +01:00
Michal Suchanek 6b5a19b708 rrd: drop useless cast
Cast of (const char **) to (char **) avoids one warning to introduce
another. Drop it. rrd upstream should not need the cast anymore.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2024-01-06 20:25:40 +01:00
Michal Suchanek 10c6068b3e sensors_parse_chip_name: Initialize path
sensors_parse_chip_name claims to overwrite all of result but path is
not set. This is generally not a problem when using statically allocated
data that is pre-zeroed but the parser uses dynamic allocation and the
chip name may contain garbage depending on the specific code flow
resulting from compiling the parser.
Setting the path was dropped when it was renamed from busname.

Fixes: 8896ba3b ("Rename sensors_chip_name.busname to path, as this is
		  what we are using it for by now.")
2023-12-30 19:05:13 +01:00