From 468220837b33c5e0b0ca74f5816a7c8563cf7fff Mon Sep 17 00:00:00 2001 From: clipo1979 Date: Sat, 2 Nov 2019 15:00:08 +0000 Subject: [PATCH 001/116] Create GA-MA770-UD3.conf New file for GA-MA770-UD3 --- configs/Gigabyte/GA-MA770-UD3.conf | 92 ++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 configs/Gigabyte/GA-MA770-UD3.conf diff --git a/configs/Gigabyte/GA-MA770-UD3.conf b/configs/Gigabyte/GA-MA770-UD3.conf new file mode 100644 index 00000000..3b54b4f1 --- /dev/null +++ b/configs/Gigabyte/GA-MA770-UD3.conf @@ -0,0 +1,92 @@ +# Configuration file for Gigabyte GA-MA770-UD3 motherboard +# GA-MA770-UD3.conf + +# By Clipo +# 2/11/2019 + +# Based on config file for GA-MA770-DS3 contributed by Charles A. from India. + +chip "it8720-*" + + # Labels are copied from BIOS setup screens when value shown + + # Voltages + + label in0 "Vcore" + # No scaling so no compute + set in0_min 1.4 * 0.95 # 95% of nominal min + set in0_max 1.4 * 1.05 # 105% of nominal max + + label in1 "DDR2 1.8V" + # No scaling so no compute + set in1_min 1.8 * 0.95 # 95% of nominal + set in1_max 1.8 * 1.05 # 105% of nominal + + label in2 "+3.3V" + # No scaling so no compute + set in2_min 3.3 * 0.95 # 95% of nominal + set in2_max 3.3 * 1.05 # 105% of nominal + + label in3 "+5V" + # Assume standard Winbond scaling resistors + compute in3 @ * ((6.8/10)+1), @ / ((6.8/10)+1) + set in3_min 5 * 0.95 # 95% of nominal + set in3_max 5 * 1.05 # 105% of nominal + + ignore in4 # Value never changed from 3.10 + + ignore in5 # Value fluctuated by to much to be a valid voltage + + label in6 "+12V" + # Assume standard Winbond scaling resistors + compute in6 @ * ((28/10)+1), @ / ((28/10)+1) + set in6_min 12 * 0.95 # 95% of nominal + set in6_max 12 * 1.05 # 105% of nominal + + label in7 "VCCH5V" # dmesg reported In7 set from VCCH5V + compute in7 @ * ((6.8/10)+1), @ / ((6.8/10)+1) + set in7_min 5 * 0.95 # 95% of nominal + set in7_max 5 * 1.05 # 105% of nominal + + label in8 "Vbat 3V CR2032" + # Connected directly so no compute + #in8_min and _max not supported by chip + + ignore cpu0_vid # Not dynamic under lm-sensors 3.0.0 + + # Temperatures + + label temp1 "Current System Temperature" + # BIOS: 32 + compute temp1 @ -5, @ +5 # Correction for what seems to be an in accurate thermal sensor + set temp1_min 0 + set temp1_max 45 # Tropical ambient max plus a bit + + label temp2 "Current CPU Casing Temperature" + # BIOS: 30 + set temp2_min 0 + # Max is lowest available BIOS "CPU Warning Temperature" + set temp2_max 55 + + ignore temp3 + # Values seen: 77-81, rising from cold start. + # Fanning the Northbridge did not change value enough to indicate cooling. + + ignore intrusion0 + + # Fans + # The labels chosen are the ones printed on the motherboard + + label fan1 "CPU_FAN" + set fan1_min 250 # Low speeds are possible with large fans and cool cases + + label fan2 "SYS_FAN1" + set fan2_min 900 + + label fan3 "SYS_FAN2" + set fan3_min 900 + + ignore fan4 # "NB_FAN" does not send an RPM signal + + label fan5 "PWR_FAN" + set fan5_min 900 From e31cb3b2f8fa5f0a7a61b9bca919bb54e7c89eea Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Mon, 13 Jul 2020 11:30:36 +0200 Subject: [PATCH 002/116] Add support for static only build This patch adds support for a BUILD_SHARED_LIB variable that allows to enable/disable the build of the shared library, in order to support static-only builds. Signed-off-by: Thomas Petazzoni [Retrieved from: https://git.buildroot.net/buildroot/tree/package/lm-sensors/0001-static-build.patch] Signed-off-by: Fabrice Fontaine --- Makefile | 3 +++ lib/Module.mk | 8 ++++++++ prog/sensord/Module.mk | 2 +- prog/sensors/Module.mk | 4 ++-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 47ffe788..af5134ff 100644 --- a/Makefile +++ b/Makefile @@ -85,6 +85,9 @@ ARCH := $(firstword $(subst -, ,$(shell $(CC) -dumpmachine))) # Build and install static library BUILD_STATIC_LIB := 1 +# Build and install shared library +BUILD_SHARED_LIB := 1 + # Set these to add preprocessor or compiler flags, or use # environment variables # CFLAGS := diff --git a/lib/Module.mk b/lib/Module.mk index 77322420..ca25e7bb 100644 --- a/lib/Module.mk +++ b/lib/Module.mk @@ -43,8 +43,14 @@ LIBSHLIBNAME := libsensors.so.$(LIBVER) LIBSTLIBNAME := libsensors.a LIBSHSONAME := libsensors.so.$(LIBMAINVER) +ifeq ($(BUILD_SHARED_LIB),1) LIBTARGETS := $(MODULE_DIR)/$(LIBSHLIBNAME) \ $(MODULE_DIR)/$(LIBSHSONAME) $(MODULE_DIR)/$(LIBSHBASENAME) +LIBDEP_FOR_PROGS := $(LIBSHBASENAME) +else +LIBDEP_FOR_PROGS := $(LIBSTLIBNAME) +endif + ifeq ($(BUILD_STATIC_LIB),1) LIBTARGETS += $(MODULE_DIR)/$(LIBSTLIBNAME) endif @@ -131,9 +137,11 @@ install-lib: all-lib ifeq ($(BUILD_STATIC_LIB),1) $(INSTALL) -m 644 $(LIB_DIR)/$(LIBSTLIBNAME) $(DESTDIR)$(LIBDIR) endif +ifeq ($(BUILD_SHARED_LIB),1) $(INSTALL) -m 755 $(LIB_DIR)/$(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR) $(LN) $(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBSHSONAME) $(LN) $(LIBSHSONAME) $(DESTDIR)$(LIBDIR)/$(LIBSHBASENAME) +endif @if [ -z "$(DESTDIR)" -a "$(LIBDIR)" != "/usr/lib" -a "$(LIBDIR)" != "/lib" ] ; then \ if [ -e "/usr/lib/$(LIBSHSONAME)" -o -e "/usr/lib/$(LIBSHBASENAME)" ] ; then \ echo '******************************************************************************' ; \ diff --git a/prog/sensord/Module.mk b/prog/sensord/Module.mk index 9dcf9d27..b8a8c956 100644 --- a/prog/sensord/Module.mk +++ b/prog/sensord/Module.mk @@ -41,7 +41,7 @@ INCLUDEFILES += $(PROGSENSORDSOURCES:.c=.rd) REMOVESENSORDBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGSENSORDTARGETS)) REMOVESENSORDMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORDMAN8DIR)/%,$(PROGSENSORDMAN8FILES)) -$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBSHBASENAME) +$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBDEP_FOR_PROGS) $(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORDSOURCES:.c=.ro) -Llib -lsensors -lrrd all-prog-sensord: $(PROGSENSORDTARGETS) diff --git a/prog/sensors/Module.mk b/prog/sensors/Module.mk index b6564414..1480f2a9 100644 --- a/prog/sensors/Module.mk +++ b/prog/sensors/Module.mk @@ -39,8 +39,8 @@ REMOVESENSORSMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORSMAN1DIR)/% LIBICONV := $(shell if /sbin/ldconfig -p | grep -q '/libiconv\.so$$' ; then echo \-liconv; else echo; fi) -$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBSHBASENAME) - $(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors +$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBDEP_FOR_PROGS) + $(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors -lm all-prog-sensors: $(PROGSENSORSTARGETS) user :: all-prog-sensors From 8663290d28c7909f172666c00b67a9821cff90a9 Mon Sep 17 00:00:00 2001 From: Davide Depau Date: Thu, 13 Aug 2020 18:21:21 +0200 Subject: [PATCH 003/116] Add config for MSI X570-A Pro --- configs/MSI/X570-A-Pro.conf | 105 ++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 configs/MSI/X570-A-Pro.conf diff --git a/configs/MSI/X570-A-Pro.conf b/configs/MSI/X570-A-Pro.conf new file mode 100644 index 00000000..01f5cb7e --- /dev/null +++ b/configs/MSI/X570-A-Pro.conf @@ -0,0 +1,105 @@ +# lm-sensors configuration for MSI X570-A Pro - MS-7C37 +# Unverified/unknown values marked with a "?" + +chip "nct6797-*" + label fan1 "Pump" + label fan2 "CPU Fan" + label fan3 "System Fan 1" + label fan4 "System Fan 2" + label fan5 "System Fan 3" + label fan6 "System Fan 4" + + label fan7 "PCH Fan" + set fan7_min 0 + + label in0 "VCore" + set in0_min 0.40 + set in0_max 1.55 + + label in1 "+5V" + compute in1 @ * 5, @ / 5 + set in1_min 5 * 0.95 + set in1_max 5 * 1.15 + + label in2 "+3.3V (AVCC)" + set in2_min 3.3 * 0.95 + set in2_max 3.3 * 1.15 + + label in3 "+3.3V (3VCC)" + set in3_min 3.3 * 0.95 + set in3_max 3.3 * 1.15 + + label in4 "+12V" + compute in4 @ * 12 , @ / 12 + set in4_min 12 * 0.95 + set in4_max 12 * 1.05 + + # in5 - Unknown + set in5_min 0.15 * 0.95 + set in5_max 0.15 * 1.15 + + label in6 "CHIP CLDO" #? + compute in6 @ * 2, @ / 2 + set in6_min 1.2 * 0.95 + set in6_max 1.2 * 1.15 + + label in7 "3VSB" + set in7_min 3.3 * 0.95 + set in7_max 3.3 * 1.15 + + label in8 "VBAT" + set in8_min 3.3 * 0.95 + set in8_max 3.3 * 1.15 + + label in9 "VTT" + set in9_min 1.8 * 0.95 + set in9_max 1.8 * 1.15 + + ignore in10 # Always 0V + + label in11 "DRAM VREF" #? + set in11_min 0.12 + set in11_max 1.235 + + label in12 "CPU NB/SoC" + set in12_min 1.0 + set in12_max 1.2 + + label in13 "DIMM" + compute in13 @ * 2 , @ / 2 + set in13_min 0.8 + set in13_max 1.5 + + label in14 "5VSB" #? + compute in14 ((768 / 330) + 1) * @, @ / ((768 / 330) + 1) + set in14_min 5 * 0.95 + set in14_max 5 * 1.15 + + label temp1 "System" + + # Keeping default label because I'm really not sure about it + # label temp2 "M.2 1" #? + + label temp3 "VR MOS" + + # Always reports -128Β°C + ignore temp4 + + label temp5 "Chipset" + + # Always reports -1Β°C + ignore temp6 + + label temp7 "CPU (Tctl)" + + # Always report 0Β°C + ignore temp8 + ignore temp9 + ignore temp10 + + label intrusion0 "Chassis intrusion" + compute intrusion0 (intrusion0_alarm - 1) * -1, (@ - 1) * -1 + + # No header present on the board + ignore intrusion1 + From 7a55c269e632d927c9b336925c7c3981ef2e18b3 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 24 Sep 2020 13:26:13 +0300 Subject: [PATCH 004/116] sensord: Add support of emergency alarm Currently sensord supports temp alarm and temp max alarm. Add support of emergency alarm to allow alerting when an emergency alarm is signalled. Signed-off-by: Amit Cohen --- prog/sensord/chips.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prog/sensord/chips.c b/prog/sensord/chips.c index 16670343..01188dcd 100644 --- a/prog/sensord/chips.c +++ b/prog/sensord/chips.c @@ -221,7 +221,9 @@ static void fillChipTemperature(FeatureDescriptor *temperature, if ((sf = sensors_get_subfeature(name, feature, SENSORS_SUBFEATURE_TEMP_ALARM)) || (sf = sensors_get_subfeature(name, feature, - SENSORS_SUBFEATURE_TEMP_MAX_ALARM))) { + SENSORS_SUBFEATURE_TEMP_MAX_ALARM)) || + (sf = sensors_get_subfeature(name, feature, + SENSORS_SUBFEATURE_TEMP_EMERGENCY_ALARM))) { temperature->alarmNumber = sf->number; } else { temperature->alarmNumber = -1; From a8d4d1eaef59b368ff16a2882bfa8cf91733c330 Mon Sep 17 00:00:00 2001 From: Sir_Yaro Date: Wed, 30 Dec 2020 20:33:26 +0100 Subject: [PATCH 005/116] Update pwmconfig If sensor doesn't return any value (in my case it happen when fan got broken - look below) whole script gets messed up. "cut" latter in the script assume there are more values in $GOODFAN then there are really and "cut -d' ' -f$count" doesn't return proper value. root@yaro-desktop2:/sys/class/hwmon# cat hwmon0/fan1_input cat: hwmon0/fan1_input: Bad argument root@yaro-desktop2:/sys/class/hwmon# --- prog/pwm/pwmconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index edcbde9e..f12146e8 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -284,7 +284,7 @@ echo 'Found the following fan sensors:' for i in $FAN do S=$(cat $i) - if [ "$S" = "0" -o "$S" = "-1" ] + if [ "$S" = "0" -o "$S" = "-1" -o "$S" = "" ] then echo " $i current speed: 0 ... skipping!" else From c567724339906cd6b21a95848f6b9b26da8979b8 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Tue, 12 Jan 2021 01:56:25 +0000 Subject: [PATCH 006/116] sensors: Handle json trailing ',' when no features are listed The json format requires that the last entry of a dictionary does not have a trailing ','. To avoid generating invalid json output, check that there are features to list before emitting the trailing ','. This issue is present when a chip exists but all its sensors are ignored: { "example-device" : { "Adapter": "example adapter", } } The corrected output is: { "example-device" : { "Adapter": "example adapter" } } Signed-off-by: Nathan Rossi --- prog/sensors/main.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/prog/sensors/main.c b/prog/sensors/main.c index f535b665..7d7e70e1 100644 --- a/prog/sensors/main.c +++ b/prog/sensors/main.c @@ -178,11 +178,19 @@ static void do_a_json_print(const sensors_chip_name *name) { printf(" \"%s\":{\n", sprintf_chip_name(name)); if (!hide_adapter) { + int a = 0; const char *adap = sensors_get_adapter_name(&name->bus); - if (adap) - printf(" \"Adapter\": \"%s\",\n", adap); - else + if (adap) { + printf(" \"Adapter\": \"%s\"", adap); + /* only print trailing ',' if there are features to list */ + if (sensors_get_features(name, &a) != NULL) { + printf(",\n"); + } else { + printf("\n"); + } + } else { fprintf(stderr, "Can't get adapter name\n"); + } } print_chip_json(name); printf(" }"); From 7b6f926503ad9222c4d5111ca6532efe55f2a328 Mon Sep 17 00:00:00 2001 From: Benoit Istin Date: Tue, 12 Jan 2021 22:06:31 +0100 Subject: [PATCH 007/116] Add MS-7C91 confiruation --- configs/MSI/MS-7C91-B550-TOMAHAWK.conf | 45 ++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 configs/MSI/MS-7C91-B550-TOMAHAWK.conf diff --git a/configs/MSI/MS-7C91-B550-TOMAHAWK.conf b/configs/MSI/MS-7C91-B550-TOMAHAWK.conf new file mode 100644 index 00000000..985402dd --- /dev/null +++ b/configs/MSI/MS-7C91-B550-TOMAHAWK.conf @@ -0,0 +1,45 @@ +# MAG B550 TOMAHAWK (MS-7C91) config +# +# Tested on a MSI-MAG B550 TOMAHAWK (MS-7C91) + +chip "nct6687-isa-0a20" + + #Voltage + label in0 "System +12V" + compute in0 @*12,@/12 + + label in1 "System +5V" + compute in1 @*5,@/5 + + label in2 "CPU NB/SOC" + + label in3 "DRAM" + compute in3 @*2,@/2 + + label in4 "CPU VCore" + label in5 "Chipset" + ignore in6 + label in7 "CPU VDDP" + label in8 "System +3.3V" + label in9 "CPU 1P8" + + #Fan + label fan1 "CPU Fan" + label fan2 "Pump Fan" + label fan3 "System Fan #1" + label fan4 "System Fan #2" + label fan5 "System Fan #3" + label fan6 "System Fan #4" + label fan7 "System Fan #5" + label fan8 "System Fan #6" + ignore fan9 + ignore fan10 + + #Temp + label temp1 "CPU" + label temp2 "System" + label temp3 "VRM MOS" + label temp4 "PCM" + label temp5 "CPU Socket" + label temp6 "PCIe x1" + label temp7 "M2_1" From a18a70e4494abd4f5355ba0f7fd839a1f7620748 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sat, 27 Feb 2021 05:18:48 +0000 Subject: [PATCH 008/116] Add config for Gigabyte B550 Vision D --- configs/Gigabyte/GA-B550-VISION-D.conf | 61 ++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 configs/Gigabyte/GA-B550-VISION-D.conf diff --git a/configs/Gigabyte/GA-B550-VISION-D.conf b/configs/Gigabyte/GA-B550-VISION-D.conf new file mode 100644 index 00000000..71511dd4 --- /dev/null +++ b/configs/Gigabyte/GA-B550-VISION-D.conf @@ -0,0 +1,61 @@ +# Gigabyte B550 Vision D (rev 1.0) +# +# dmi: Board Manufacturer: Gigabyte Technology Co., Ltd. +# dmi: Board Product Name: B550 VISION D-CF +# dmi: BIOS Version: F13a +# +# 2021-02-27 Matt Turner +# Updates welcome + +# ITE IT8792E Super IO Sensors +chip "it8792-*" + + label in0 "VIN0" # so-called by hwinfo64 on Windows + label in1 "DDR VTT" + label in2 "Chipset Core" + label in3 "VIN3" # so-called by hwinfo64 on Windows + label in4 "CPU VDD 18" + label in5 "PM_CLDO12" + label in6 "six" # hwinfo64 is ignoring one input, I think it's this one + label in7 "3VSB" + label in8 "VBAT" + + label fan1 "SYS_FAN5_PUMP" + label fan2 "SYS_FAN6_PUMP" + label fan3 "SYS_FAN4" + + label temp1 "PCIEX4_1" + label temp2 "EC_TEMP2" # Will show -55C if open circuit (no thermistor plugged in) + label temp3 "System2" + + +# ITE IT8688E (Feb '21: currently needs out-of-tree it87 module) +chip "it8688-*" + + label in0 "Vcore" + label in1 "+3.3V" + # https://linux.die.net/man/5/sensors3.conf + # Total guess that it's even a resistor ladder, let alone the values, but this gives the correct voltages (ish) + compute in1 @*((6.8/10)+1), @/((6.8/10)+1) + label in2 "+12V" + compute in2 @*((50/10)+1), @/((50/10)+1) + label in3 "+5V" + compute in3 @*((15/10)+1), @/((15/10)+1) + label in4 "CPU VCORE SoC" + label in5 "CPU VDDP" + label in6 "DRAM" + label in7 "3VSB" + label in8 "VBAT" + + label fan1 "CPU_FAN" + label fan2 "SYS_FAN1" + label fan3 "SYS_FAN2" + label fan4 "SYS_FAN3" + label fan5 "CPU_OPT" + + label temp1 "System1" + label temp2 "EC_TEMP1" # Will show -55C if open circuit (no thermistor plugged in) + label temp3 "CPU" # type AMD AMDSI + label temp4 "PCIEX16" + label temp5 "VRM MOS" + label temp6 "PCH" From 404ec83966edefe652964334e9835b5ddb0ec3b8 Mon Sep 17 00:00:00 2001 From: SakiiCode Date: Fri, 2 Apr 2021 14:54:43 +0200 Subject: [PATCH 009/116] Add Gigabyte GA-990FXA-UD7 config --- configs/Gigabyte/GA-990FXA-UD7.conf | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 configs/Gigabyte/GA-990FXA-UD7.conf diff --git a/configs/Gigabyte/GA-990FXA-UD7.conf b/configs/Gigabyte/GA-990FXA-UD7.conf new file mode 100644 index 00000000..a4b30079 --- /dev/null +++ b/configs/Gigabyte/GA-990FXA-UD7.conf @@ -0,0 +1,43 @@ +# Configuration file contributed by Sakii. + + +# libsensors3 configuration file for the GA-990FXA-UD7 Rev. 3.0 +# Based on the info in this thread https://forum.gigabyte.us/thread/286/ga-990fxa-ud7-hardware-monitoring and my testings + +chip "it8728-isa-*" + +### Voltages + + + label in0 "Vcore" + label in1 "VDIMM" + label in2 "+12V" + label in3 "+5V" + label in4 "+3.3V" + ignore in5 # Shows the output current but the multiplier is unknown + ignore in6 # Unknown + #label in7 "3VSB" # Naming already set by sensors-detect + #label in8 "Vbat" # Naming already set by sensors-detect + + compute in2 @ * 6 , @ / 6 + compute in3 @ * 2.5, @ / 2.5 + compute in4 @ * 1.65, @ / 1.65 + +### Fan labels as found on the motherboard + + label fan1 "CPU Fan" # Controlled by temp3 + label fan2 "SYS Fan1" # Controlled by temp2 + label fan3 "SYS Fan2" # Max speed + label fan4 "PWR Fan" # Max speed + + +### Temperatures + + label temp1 "Case/Motherboard temp" + label temp2 "NB/VRM temp" + label temp3 "CPU temp2" # Same as k10temp just truncated to nearest integer + # Noisy values when idle + +chip "k10temp-pci-*" + + label temp1 "CPU temp1" # High precision but noisy values when idle From 81604984d072ea365b62008f30b40facc0d5e9a4 Mon Sep 17 00:00:00 2001 From: Alexander Kapshuna Date: Thu, 24 Dec 2020 21:07:28 +0300 Subject: [PATCH 010/116] Add config for Gigabyte B550M AORUS PRO --- configs/Gigabyte/GA-B550M-AORUS-PRO.conf | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 configs/Gigabyte/GA-B550M-AORUS-PRO.conf diff --git a/configs/Gigabyte/GA-B550M-AORUS-PRO.conf b/configs/Gigabyte/GA-B550M-AORUS-PRO.conf new file mode 100644 index 00000000..11425eba --- /dev/null +++ b/configs/Gigabyte/GA-B550M-AORUS-PRO.conf @@ -0,0 +1,32 @@ +# Requires it87 driver with support for IT8688E Super I/O chip +# Tested with https://github.com/frankcrawford/it87 on B550M AORUS PRO (rev. 1.0) + +chip "it8688-isa-0a40" + + label in0 "Vcore" + ignore in1 # +3.3V always around 2.0 + ignore in2 # +12V always around 2.0 + ignore in3 # +5V always around 2.0 + label in4 "CPU VCORE SoC" + label in5 "CPU VDDP" + label in6 "DRAM" + label in7 "3VSB" + label in8 "VBAT" + # AVCC3 is missing + + # Labeled as marked on board + label fan1 "CPU_FAN" + label fan2 "SYS_FAN1" + label fan3 "SYS_FAN2" + label fan4 "SYS_FAN3" + label fan5 "CPU_OPT" + + # Labeled according to names in UEFI "Smart Fan" utility + label temp1 "System 1" + label temp2 "System 2" + label temp3 "CPU" + label temp4 "PCIEX16" + label temp5 "VRM MOS" + label temp6 "PCH" + + ignore intrusion0 From d93606df94f9e0ed103c9099cfb5e3f2d3a3ec35 Mon Sep 17 00:00:00 2001 From: Soeren Grunewald Date: Wed, 14 Apr 2021 17:57:00 +0200 Subject: [PATCH 011/116] Add config for MSI B550-A Pro This is basically a copy of the settings from MS-7C91 aka MSI-MAG B550 TOMAHAWK. --- configs/MSI/MS-7C56-B550-A-Pro.conf | 53 +++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 configs/MSI/MS-7C56-B550-A-Pro.conf diff --git a/configs/MSI/MS-7C56-B550-A-Pro.conf b/configs/MSI/MS-7C56-B550-A-Pro.conf new file mode 100644 index 00000000..10327054 --- /dev/null +++ b/configs/MSI/MS-7C56-B550-A-Pro.conf @@ -0,0 +1,53 @@ +# lm-sensors configuration for the MSI B550-A PRO motherboard +# +# Manufacturer: Micro-Star International (MSI) +# Product Name: B550-A PRO +# Code Name: MS-7C56 +# Version: Ver 1.1 +# Super I/O: NCT6683R +# UEFI BIOS tested: A.63 03/03/2021 +# +# Recommended drivers: k10temp, nct6683 + +chip "nct6687-isa-0a20" + + #Voltage + label in0 "System +12V" + compute in0 @*12,@/12 + + label in1 "System +5V" + compute in1 @*5,@/5 + + label in2 "CPU NB/SOC" + + label in3 "DRAM" + compute in3 @*2,@/2 + + label in4 "CPU VCore" + label in5 "Chipset" + ignore in6 + label in7 "CPU VDDP" + label in8 "System +3.3V" + label in9 "CPU 1P8" + + #Fan + label fan1 "CPU Fan" + label fan2 "Pump Fan" + label fan3 "System Fan #1" + label fan4 "System Fan #2" + label fan5 "System Fan #3" + label fan6 "System Fan #4" + label fan7 "System Fan #5" + label fan8 "System Fan #6" + ignore fan9 + ignore fan10 + + #Temp + label temp1 "CPU" + label temp2 "System" + label temp3 "VRM MOS" + label temp4 "PCM" + label temp5 "CPU Socket" + label temp6 "PCIe x1" + label temp7 "M2_1" + From fbdb3ad663c9b620c3c923bb5e92cb635afb0c70 Mon Sep 17 00:00:00 2001 From: clipo1979 Date: Sun, 16 May 2021 20:41:58 +0100 Subject: [PATCH 012/116] Create GA-Z68AP-D3.conf --- configs/Gigabyte/GA-Z68AP-D3.conf | 93 +++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 configs/Gigabyte/GA-Z68AP-D3.conf diff --git a/configs/Gigabyte/GA-Z68AP-D3.conf b/configs/Gigabyte/GA-Z68AP-D3.conf new file mode 100644 index 00000000..3e57f056 --- /dev/null +++ b/configs/Gigabyte/GA-Z68AP-D3.conf @@ -0,0 +1,93 @@ +# Configuration file for the Gigabyte GA-Z68AP-D3 +# Contributed by Clipo. +# 17-05-2021 +# Updates welcome. + +################ +# CPU sensor +chip "coretemp-*" + +label temp1 "CPU Package temp" +label temp2 "Core 0" +label temp3 "Core 1" +label temp4 "Core 2" +label temp5 "Core 3" + +################ +# Motherboard sensors +chip "it8728-*" + +################ +# Fans + +# Labels are chosen to match the silk screen on the motherboard, these also match the BIOS names but shorter. + +label fan1 "CPU_FAN" +set fan1_min 200 + +label fan2 "SYS_FAN_2" +set fan2_min 200 + +label fan3 "PWR_FAN" +set fan3_min 200 + +label fan4 "SYS_FAN_1" +set fan4_min 200 + +################ +# Temperatures +label temp1 "System Temperature" +set temp1_min 10 +set temp1_max 60 + +ignore temp2 +#label temp2 "Unknown" # Does not seem to give sensible data (Always shows 25) + +label temp3 "CPU Temperature" +set temp3_min 10 +set temp3_max 55 +# Adding 10 to correct wrong BIOS values. +compute temp3 @+10,@-10 + +############ +# Voltages +label in0 "Vtt" +set in0_min 1.020 +set in0_max 1.080 + +label in1 "+3.3V" +set in1_min 3.3 * 0.95 +set in1_max 3.3 * 1.05 +compute in1 1.635*@,@/1.635 + +label in2 "+12V" +set in2_min 12.0 * 0.95 +set in2_max 12.0 * 1.05 +compute in2 4.090*@,@/4.090 + +label in3 "+5V" +set in3_min 5.0 * 0.95 +set in3_max 5.0 * 1.05 +compute in3 1.74*@,@/1.74 + +label in4 "Vaxg IGD" +set in4_min 0.800 +set in4_max 1.000 + +label in5 "CPU Vcore" +set in5_min 0.750 +set in5_max 1.150 + +label in6 "Dram Voltage" +set in6_min 1.450 +set in6_max 1.550 + +label in7 "3.3 VSB" +set in7_min 3.3 * 0.95 +set in7_max 3.3 * 1.05 + +label in8 "Vbat" + +# Other sensor readings +label intrusion0 "Chassis Open" +#set intrusion0_alarm 0 From 49b6ae283de52f66720d4e0db7faf6baf0c1c45d Mon Sep 17 00:00:00 2001 From: Aleksandr Mezin Date: Fri, 18 Jun 2021 11:52:19 +0600 Subject: [PATCH 013/116] pwmconfig, fancontrol: Allow read-only pwm*_enable Don't fail if pwm*_enable is read-only, but already set to 1. --- prog/pwm/fancontrol | 4 ++-- prog/pwm/pwmconfig | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/prog/pwm/fancontrol b/prog/pwm/fancontrol index 886a7367..89c66687 100755 --- a/prog/pwm/fancontrol +++ b/prog/pwm/fancontrol @@ -489,8 +489,8 @@ function pwmenable() PWM_ORIG_STATE[${1}]=$PWM_ORIG fi # enable manual control by fancontrol - echo 1 > $ENABLE 2> /dev/null - if [ $? -ne 0 ] + (echo 1 > $ENABLE) 2> /dev/null + if [ "$(cat $ENABLE)" -ne 1 ] then return 1 fi diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index edcbde9e..cc1139f9 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -214,14 +214,12 @@ function pwmenable() { local ENABLE=${1}_enable - if [ -w $ENABLE ] + (echo 1 > $ENABLE) 2>/dev/null + if [ "$(cat $ENABLE)" -ne 1 ] then - echo 1 2>/dev/null > $ENABLE - if [ $? -ne 0 ] - then - return 1 - fi + return 1 fi + echo $MAX > $1 } From 543632712ec9e8239228236832a6406719260f1b Mon Sep 17 00:00:00 2001 From: thomb Date: Mon, 21 Jun 2021 16:56:33 +0200 Subject: [PATCH 014/116] libsensors + sensors: Add freq_input support --- lib/sensors.h | 2 ++ lib/sysfs.c | 8 ++++++++ prog/sensors/chips.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/lib/sensors.h b/lib/sensors.h index 94f6f230..62ce22cd 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -148,6 +148,7 @@ typedef enum sensors_feature_type { SENSORS_FEATURE_INTRUSION = 0x11, SENSORS_FEATURE_MAX_OTHER, SENSORS_FEATURE_BEEP_ENABLE = 0x18, + SENSORS_FEATURE_FREQ, SENSORS_FEATURE_MAX, SENSORS_FEATURE_UNKNOWN = INT_MAX, } sensors_feature_type; @@ -251,6 +252,7 @@ typedef enum sensors_subfeature_type { SENSORS_SUBFEATURE_BEEP_ENABLE = SENSORS_FEATURE_BEEP_ENABLE << 8, + SENSORS_SUBFEATURE_FREQ_INPUT = SENSORS_FEATURE_FREQ << 8, SENSORS_SUBFEATURE_UNKNOWN = INT_MAX, } sensors_subfeature_type; diff --git a/lib/sysfs.c b/lib/sysfs.c index 9516cec4..2c11a436 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -152,6 +152,7 @@ int get_type_scaling(sensors_subfeature_type type) return 1; case SENSORS_SUBFEATURE_POWER_AVERAGE: case SENSORS_SUBFEATURE_ENERGY_INPUT: + case SENSORS_SUBFEATURE_FREQ_INPUT: return 1000000; } @@ -181,6 +182,7 @@ char *get_feature_name(sensors_feature_type ftype, char *sfname) case SENSORS_FEATURE_CURR: case SENSORS_FEATURE_HUMIDITY: case SENSORS_FEATURE_INTRUSION: + case SENSORS_FEATURE_FREQ: underscore = strchr(sfname, '_'); name = strndup(sfname, underscore - sfname); if (!name) @@ -329,6 +331,11 @@ static const struct subfeature_type_match intrusion_matches[] = { { "beep", SENSORS_SUBFEATURE_INTRUSION_BEEP }, { NULL, 0 } }; + +static const struct subfeature_type_match freq_matches[] = { + { "input", SENSORS_SUBFEATURE_FREQ_INPUT }, + { NULL, 0 } +}; static struct feature_type_match matches[] = { { "temp%d%c", temp_matches }, { "in%d%c", in_matches }, @@ -339,6 +346,7 @@ static struct feature_type_match matches[] = { { "energy%d%c", energy_matches }, { "intrusion%d%c", intrusion_matches }, { "humidity%d%c", humidity_matches }, + { "freq%d%c", freq_matches }, }; /* Return the subfeature type and channel number based on the subfeature diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 0eb07418..82136618 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -833,6 +833,33 @@ static void print_chip_curr(const sensors_chip_name *name, printf("\n"); } +static void print_chip_freq(const sensors_chip_name *name, + const sensors_feature *feature, + int label_size) +{ + const sensors_subfeature *sf; + double val; + char *label; + + if (!(label = sensors_get_label(name, feature))) { + fprintf(stderr, "ERROR: Can't get label of feature %s!\n", + feature->name); + return; + } + print_label(label, label_size); + free(label); + + sf = sensors_get_subfeature(name, feature, + SENSORS_SUBFEATURE_FREQ_INPUT); + if (sf && get_input_value(name, sf, &val) == 0) { + printf("%4.0f %s", val, "MHz"); + } else { + printf(" N/A "); + } + + printf("\n"); +} + static void print_chip_intrusion(const sensors_chip_name *name, const sensors_feature *feature, int label_size) @@ -894,6 +921,9 @@ void print_chip(const sensors_chip_name *name) case SENSORS_FEATURE_HUMIDITY: print_chip_humidity(name, feature, label_size); break; + case SENSORS_FEATURE_FREQ: + print_chip_freq(name, feature, label_size); + break; default: continue; } From 88f6c5ec9b1838823fa21126a7ad27d6d6500a4d Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Thu, 12 Aug 2021 15:07:38 +1200 Subject: [PATCH 015/116] sensors: Add support for rated values Sysfs attributes for rated values were recently added to the kernel[1]. This adds support for displaying them in lm-sensors. [1] - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e8e61235 Signed-off-by: Chris Packham --- lib/sensors.h | 6 ++++++ lib/sysfs.c | 6 ++++++ prog/sensors/chips.c | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/lib/sensors.h b/lib/sensors.h index 94f6f230..99373be9 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -163,6 +163,8 @@ typedef enum sensors_subfeature_type { SENSORS_SUBFEATURE_IN_AVERAGE, SENSORS_SUBFEATURE_IN_LOWEST, SENSORS_SUBFEATURE_IN_HIGHEST, + SENSORS_SUBFEATURE_IN_RATED_MIN, + SENSORS_SUBFEATURE_IN_RATED_MAX, SENSORS_SUBFEATURE_IN_ALARM = (SENSORS_FEATURE_IN << 8) | 0x80, SENSORS_SUBFEATURE_IN_MIN_ALARM, SENSORS_SUBFEATURE_IN_MAX_ALARM, @@ -217,6 +219,8 @@ typedef enum sensors_subfeature_type { SENSORS_SUBFEATURE_POWER_CRIT, SENSORS_SUBFEATURE_POWER_MIN, SENSORS_SUBFEATURE_POWER_LCRIT, + SENSORS_SUBFEATURE_POWER_RATED_MIN, + SENSORS_SUBFEATURE_POWER_RATED_MAX, SENSORS_SUBFEATURE_POWER_AVERAGE_INTERVAL = (SENSORS_FEATURE_POWER << 8) | 0x80, SENSORS_SUBFEATURE_POWER_ALARM, SENSORS_SUBFEATURE_POWER_CAP_ALARM, @@ -235,6 +239,8 @@ typedef enum sensors_subfeature_type { SENSORS_SUBFEATURE_CURR_AVERAGE, SENSORS_SUBFEATURE_CURR_LOWEST, SENSORS_SUBFEATURE_CURR_HIGHEST, + SENSORS_SUBFEATURE_CURR_RATED_MIN, + SENSORS_SUBFEATURE_CURR_RATED_MAX, SENSORS_SUBFEATURE_CURR_ALARM = (SENSORS_FEATURE_CURR << 8) | 0x80, SENSORS_SUBFEATURE_CURR_MIN_ALARM, SENSORS_SUBFEATURE_CURR_MAX_ALARM, diff --git a/lib/sysfs.c b/lib/sysfs.c index 9516cec4..c81663dd 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -251,6 +251,8 @@ static const struct subfeature_type_match in_matches[] = { { "lcrit_alarm", SENSORS_SUBFEATURE_IN_LCRIT_ALARM }, { "crit_alarm", SENSORS_SUBFEATURE_IN_CRIT_ALARM }, { "beep", SENSORS_SUBFEATURE_IN_BEEP }, + { "rated_min", SENSORS_SUBFEATURE_IN_RATED_MIN }, + { "rated_max", SENSORS_SUBFEATURE_IN_RATED_MAX }, { NULL, 0 } }; @@ -288,6 +290,8 @@ static const struct subfeature_type_match power_matches[] = { { "crit_alarm", SENSORS_SUBFEATURE_POWER_CRIT_ALARM }, { "lcrit_alarm", SENSORS_SUBFEATURE_POWER_LCRIT_ALARM }, { "average_interval", SENSORS_SUBFEATURE_POWER_AVERAGE_INTERVAL }, + { "rated_min", SENSORS_SUBFEATURE_POWER_RATED_MIN }, + { "rated_max", SENSORS_SUBFEATURE_POWER_RATED_MAX }, { NULL, 0 } }; @@ -311,6 +315,8 @@ static const struct subfeature_type_match curr_matches[] = { { "lcrit_alarm", SENSORS_SUBFEATURE_CURR_LCRIT_ALARM }, { "crit_alarm", SENSORS_SUBFEATURE_CURR_CRIT_ALARM }, { "beep", SENSORS_SUBFEATURE_CURR_BEEP }, + { "rated_min", SENSORS_SUBFEATURE_CURR_RATED_MIN }, + { "rated_max", SENSORS_SUBFEATURE_CURR_RATED_MAX }, { NULL, 0 } }; diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 0eb07418..63c255f9 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -428,6 +428,8 @@ static const struct sensor_subfeature_list voltage_sensors[] = { { SENSORS_SUBFEATURE_IN_AVERAGE, NULL, 0, "avg" }, { SENSORS_SUBFEATURE_IN_LOWEST, NULL, 0, "lowest" }, { SENSORS_SUBFEATURE_IN_HIGHEST, NULL, 0, "highest" }, + { SENSORS_SUBFEATURE_IN_RATED_MIN, NULL, 0, "rated min" }, + { SENSORS_SUBFEATURE_IN_RATED_MAX, NULL, 0, "rated max" }, { -1, NULL, 0, NULL } }; @@ -584,6 +586,8 @@ static const struct sensor_subfeature_list power_common_sensors[] = { { SENSORS_SUBFEATURE_POWER_LCRIT, NULL, 0, "lcrit" }, { SENSORS_SUBFEATURE_POWER_CRIT, NULL, 0, "crit" }, { SENSORS_SUBFEATURE_POWER_CAP, NULL, 0, "cap" }, + { SENSORS_SUBFEATURE_POWER_RATED_MIN, NULL, 0, "rated min" }, + { SENSORS_SUBFEATURE_POWER_RATED_MAX, NULL, 0, "rated max" }, { -1, NULL, 0, NULL } }; @@ -788,6 +792,8 @@ static const struct sensor_subfeature_list current_sensors[] = { { SENSORS_SUBFEATURE_CURR_AVERAGE, NULL, 0, "avg" }, { SENSORS_SUBFEATURE_CURR_LOWEST, NULL, 0, "lowest" }, { SENSORS_SUBFEATURE_CURR_HIGHEST, NULL, 0, "highest" }, + { SENSORS_SUBFEATURE_CURR_RATED_MIN, NULL, 0, "rated min" }, + { SENSORS_SUBFEATURE_CURR_RATED_MAX, NULL, 0, "rated max" }, { -1, NULL, 0, NULL } }; From 488d20b783e9bc0420c132ec62923a4528ce1b9b Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Fri, 13 Aug 2021 17:05:28 +1200 Subject: [PATCH 016/116] prog/sensors: Only do conversion to Fahrenheit on temperatures Only apply conversion from Celsius to Fahrenheit on temperature values. Leave other sensor readings as they were returned. Fixes #357 Signed-off-by: Chris Packham --- prog/sensors/chips.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 0eb07418..17ada742 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -46,6 +46,7 @@ void print_chip_raw(const sensors_chip_name *name) const sensors_subfeature *sub; char *label; double val; + int is_temp; a = 0; while ((feature = sensors_get_features(name, &a))) { @@ -59,6 +60,8 @@ void print_chip_raw(const sensors_chip_name *name) b = 0; while ((sub = sensors_get_all_subfeatures(name, feature, &b))) { if (sub->flags & SENSORS_MODE_R) { + is_temp = feature->type == SENSORS_FEATURE_TEMP; + if ((err = sensors_get_value(name, sub->number, &val))) fprintf(stderr, "ERROR: Can't get " @@ -66,7 +69,7 @@ void print_chip_raw(const sensors_chip_name *name) sub->name, sensors_strerror(err)); else { - if (fahrenheit) + if (is_temp && fahrenheit) val = deg_ctof(val); printf(" %s: %.3f\n", sub->name, val); } @@ -84,6 +87,7 @@ void print_chip_json(const sensors_chip_name *name) const sensors_subfeature *sub; char *label; double val; + int is_temp; a = 0; cnt = 0; @@ -101,6 +105,8 @@ void print_chip_json(const sensors_chip_name *name) subCnt = 0; while ((sub = sensors_get_all_subfeatures(name, feature, &b))) { if (sub->flags & SENSORS_MODE_R) { + is_temp = feature->type == SENSORS_FEATURE_TEMP; + if ((err = sensors_get_value(name, sub->number, &val))) { fprintf(stderr, "ERROR: Can't get " @@ -110,7 +116,7 @@ void print_chip_json(const sensors_chip_name *name) } else { if (subCnt > 0) printf(",\n"); - if (fahrenheit) + if (is_temp && fahrenheit) val = deg_ctof(val); printf(" \"%s\": %.3f", sub->name, val); subCnt++; From 6128b9e8eb58d6a12d4c8a8d6a635a3f066a0127 Mon Sep 17 00:00:00 2001 From: a1346054 <36859588+a1346054@users.noreply.github.com> Date: Tue, 24 Aug 2021 22:09:11 +0000 Subject: [PATCH 017/116] COPYING: use identical license file as distributed by GNU License file obtained from: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt --- COPYING | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/COPYING b/COPYING index d511905c..d159169d 100644 --- a/COPYING +++ b/COPYING @@ -1,12 +1,12 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it From fe0a24357d26546a9c3d6d2000ab802e618cd134 Mon Sep 17 00:00:00 2001 From: a1346054 <36859588+a1346054@users.noreply.github.com> Date: Tue, 24 Aug 2021 22:17:50 +0000 Subject: [PATCH 018/116] README: fix spelling --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index 694b47be..010c7e25 100644 --- a/README +++ b/README @@ -105,7 +105,7 @@ TROUBLESHOOTING lm-sensors is blamed for all kinds of problems on a regular basis. While it is always possible that lm-sensors does in fact have a problem, almost everytime the problem will be elsewhere. The most likely culprit -for a problem is one of the kernel drivers prividing data to lm-sensors +for a problem is one of the kernel drivers providing data to lm-sensors or, rather, the sensors command (and libsensors). If you encounter problems, the following tests are recommended. @@ -121,7 +121,7 @@ the following tests are recommended. with the sensors command first). Again, after identifying the offending driver, record and report your results to the driver maintainer. - If this does not help, try to run ptrace on the sensors command and/or - the application using libsensors. If you find any anormalies, record + the application using libsensors. If you find any anomalies, record your results and report. From 92e1538a19e8313a19b596e6a1920fe22938fc5e Mon Sep 17 00:00:00 2001 From: a1346054 <36859588+a1346054@users.noreply.github.com> Date: Tue, 24 Aug 2021 22:19:37 +0000 Subject: [PATCH 019/116] Trim trailing whitespace Making sure that none of the actual test files were touched. --- CHANGES | 8 ++++---- Makefile | 8 ++++---- doc/developers/lm_sensors.lsm | 2 +- doc/fan-divisors | 2 +- doc/fancontrol.txt | 1 - doc/git | 2 +- doc/temperature-sensors | 2 +- etc/sensors-conf-convert | 2 +- etc/sensors.conf.default | 2 +- lib/test/Module.mk | 2 +- lib/test/test-scanner.c | 21 ++++++++++----------- lib/test/test-scanner.pl | 1 - 12 files changed, 25 insertions(+), 28 deletions(-) diff --git a/CHANGES b/CHANGES index 93cbd086..be4a3259 100644 --- a/CHANGES +++ b/CHANGES @@ -86,7 +86,7 @@ git HEAD and LM95235 Add detection of NCT7802Y Print kernel version and processor information - Add detection of NCT6792D + Add detection of NCT6792D Add reference to nct6683 driver Show that NCT6102D/6104D/6106D are supported by nct6775 driver Show NCT5573D as compatible to NCT6776F with same chip ID @@ -379,7 +379,7 @@ git HEAD Move help section to sensors.conf.5 Add a section for the Asus/Fintek F8000 sensors-detect: Fix detection of ADT7463 and LM96000 - Add VIA VX800/VX820 SMBus support + Add VIA VX800/VX820 SMBus support Fix detection of Intel 5000 series FB-DIMM AMB Fix detection of ADT7462 Fix detection of SMSC LPC47M292 @@ -529,7 +529,7 @@ git HEAD Mention the f75375s driver Add SMSC LPC47B367-NC detection (no sensors) Reduce w83781d/lm78 I2C address probing range - Add Intel Celeron 4xx and Penryn (CPU on 45nm) detection + Add Intel Celeron 4xx and Penryn (CPU on 45nm) detection 3.0.0-rc3 (2007-10-28) libsensors: Add a default configuration file @@ -562,7 +562,7 @@ git HEAD Better handling of the fault flags sensors-conf-convert: Add a short help text sensors-detect: Fix SMSC SCH311x detection - Add AMD K10 CPU sensor detection + Add AMD K10 CPU sensor detection 3.0.0-rc1 (2007-09-25) Initial release diff --git a/Makefile b/Makefile index 47ffe788..95d9a080 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ BINDIR := $(PREFIX)/bin SBINDIR := $(PREFIX)/sbin # You should not need to change this. It is the basic directory into which -# include files will be installed. The actual directory will be +# include files will be installed. The actual directory will be # $(INCLUDEDIR)/sensors for library include files. INCLUDEDIR := $(PREFIX)/include LIBINCLUDEDIR := $(INCLUDEDIR)/sensors @@ -103,9 +103,9 @@ BUILD_STATIC_LIB := 1 # Within each Module.mk, rules and dependencies can be added to targets # all, install and clean. Use double colons instead of single ones -# to do this. +# to do this. -# The subdirectories we need to build things in +# The subdirectories we need to build things in SRCDIRS := lib prog/detect prog/pwm \ prog/sensors ${PROG_EXTRA:%=prog/%} etc # Only build isadump and isaset on x86 machines. @@ -166,7 +166,7 @@ LIBCFLAGS := -fpic -D_REENTRANT $(ALL_CFLAGS) all:: # Include all makefiles for sub-modules -INCLUDEFILES := +INCLUDEFILES := include $(patsubst %,%/Module.mk,$(SRCDIRS)) ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),uninstall) diff --git a/doc/developers/lm_sensors.lsm b/doc/developers/lm_sensors.lsm index 84898115..599b85e0 100644 --- a/doc/developers/lm_sensors.lsm +++ b/doc/developers/lm_sensors.lsm @@ -2,7 +2,7 @@ Begin4 Title: lm_sensors Version: 3.6.0 Entered-date: 2019-10-18 -Description: Hardware health monitoring package for Linux. It consists of +Description: Hardware health monitoring package for Linux. It consists of a library to allow applications to read sensors data more easily, and of an example program to pretty print this data. Also included is a fan speed control script. diff --git a/doc/fan-divisors b/doc/fan-divisors index 978f5a30..c2486bfb 100644 --- a/doc/fan-divisors +++ b/doc/fan-divisors @@ -20,7 +20,7 @@ Does my monitoring chip use fan divisors? 16 bits, so divisors are no longer required. In that case, you won't see "div" values in the output of sensors, and nothing needs to be configured: - + CPU1 Fan: 2160 RPM (min = 800 RPM) CPU2 Fan: 0 RPM (min = 799 RPM) ALARM Front3 Fan: 0 RPM (min = 0 RPM) diff --git a/doc/fancontrol.txt b/doc/fancontrol.txt index 337460e8..f422d9ab 100644 --- a/doc/fancontrol.txt +++ b/doc/fancontrol.txt @@ -1,4 +1,3 @@ - fancontrol - automated software based fan speed regulation diff --git a/doc/git b/doc/git index beeaedd8..2d442d88 100644 --- a/doc/git +++ b/doc/git @@ -1,4 +1,4 @@ -Git Repository +Git Repository Anonymous access to our git repository is available. This means that users can have direct access to up-to-the-minute code. diff --git a/doc/temperature-sensors b/doc/temperature-sensors index 2eccb98e..560c5289 100644 --- a/doc/temperature-sensors +++ b/doc/temperature-sensors @@ -77,7 +77,7 @@ For diodes, voltage is linear with temperature. Winbond W83782D and W83783S --------------------------- These chips default to thermistors with Beta = 3435. -Each sensor on the chip can be individually set to be +Each sensor on the chip can be individually set to be a diode, transistor, or thermistor. If the temperature reading changes much less than expected, the sensor type probably needs to be changed to a diode. diff --git a/etc/sensors-conf-convert b/etc/sensors-conf-convert index 8e8a03e0..dac398c6 100755 --- a/etc/sensors-conf-convert +++ b/etc/sensors-conf-convert @@ -425,7 +425,7 @@ if (m/^([\s#]*bus\s+"?i2c-\d+"?\s+"([^"]+)")\s+"[^"]*"/) { print STDERR "Processing bus statement: $2\n" if $debug; if ($2 eq "ISA main adapter") { - $_ = ''; # Drop entirely + $_ = ''; # Drop entirely } else { $_ = "$1\n"; # Drop algorithm name } diff --git a/etc/sensors.conf.default b/etc/sensors.conf.default index 693a66b4..fd4e2269 100644 --- a/etc/sensors.conf.default +++ b/etc/sensors.conf.default @@ -227,7 +227,7 @@ chip "smsc47m192-*" chip "lm85-*" "lm85b-*" "lm85c-*" "adm1027-*" "adt7463-*" "adt7468-*" \ - "emc6d100-*" "emc6d102-*" "emc6d103-*" "emc6d103s-*" + "emc6d100-*" "emc6d102-*" "emc6d103-*" "emc6d103s-*" label in1 "Vcore" label in2 "+3.3V" diff --git a/lib/test/Module.mk b/lib/test/Module.mk index 2a9f6edc..d1e953c6 100644 --- a/lib/test/Module.mk +++ b/lib/test/Module.mk @@ -19,6 +19,6 @@ user :: all-lib-test $(LIB_TEST_DIR)/test-scanner.ro: $(LIB_DIR)/data.h $(LIB_DIR)/conf.h $(LIB_DIR)/conf-parse.h $(LIB_DIR)/scanner.h clean-lib-test: - $(RM) $(LIB_TEST_DIR)/*.rd $(LIB_TEST_DIR)/*.ro + $(RM) $(LIB_TEST_DIR)/*.rd $(LIB_TEST_DIR)/*.ro $(RM) $(LIB_TEST_TARGETS) clean :: clean-lib-test diff --git a/lib/test/test-scanner.c b/lib/test/test-scanner.c index 4b4c7584..011255db 100644 --- a/lib/test/test-scanner.c +++ b/lib/test/test-scanner.c @@ -49,44 +49,44 @@ int main(void) case NEG: printf("NEG\n"); break; - + case EOL: printf("EOL\n"); break; - + case BUS: printf("BUS\n"); break; - + case LABEL: printf("LABEL\n"); break; - + case SET: printf("SET\n"); break; - + case CHIP: printf("CHIP\n"); break; - + case COMPUTE: printf("COMPUTE\n"); break; - + case IGNORE: printf("IGNORE\n"); break; - + case FLOAT: printf("FLOAT: %f\n", sensors_yylval.value); break; - + case NAME: printf("NAME: %s\n", sensors_yylval.name); free(sensors_yylval.name); break; - + case ERROR: printf("ERROR\n"); break; @@ -103,4 +103,3 @@ int main(void) return 0; } - diff --git a/lib/test/test-scanner.pl b/lib/test/test-scanner.pl index 6d163a8e..ca11f044 100755 --- a/lib/test/test-scanner.pl +++ b/lib/test/test-scanner.pl @@ -98,4 +98,3 @@ foreach $scenario (@scenarios) { ok($test->diff_exact(\@stderr, \@experr, \@diff), "stderr: " . $scenario->{"desc"}) or print @diff; } - From 109b988f1aaddbfb8e1c0f4ae67a8fd9e9670703 Mon Sep 17 00:00:00 2001 From: Armin Wolf Date: Fri, 27 Aug 2021 23:26:13 +0200 Subject: [PATCH 020/116] libsensors: Add support for pwm Add support for the pwm sensor interface. This includes support for pwm[1-*], pwm[1-*]_enable, pwm[1-*]_mode and pwm[1-*]_freq. --- CHANGES | 1 + doc/libsensors-API.txt | 3 +++ lib/sensors.h | 8 +++++++- lib/sysfs.c | 27 +++++++++++++++++++++++++-- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 93cbd086..827ac1ea 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ lm-sensors CHANGES file ----------------------- git HEAD + Add PWM sensor support 3.6.0 (2019-10-18) configs: Added a number of new configuration files diff --git a/doc/libsensors-API.txt b/doc/libsensors-API.txt index 70b8e6a6..7832d979 100644 --- a/doc/libsensors-API.txt +++ b/doc/libsensors-API.txt @@ -6,6 +6,9 @@ over time. This document summarizes these evolutions so that application authors can quickly figure out how to test for the availability of a given new feature. +0x501 +* Added support for pwm sensors + 0x500 lm-sensors 3.5.0 * Added support for power min, lcrit, min_alarm and lcrit_alarm enum sensors_subfeature_type SENSORS_SUBFEATURE_POWER_MIN diff --git a/lib/sensors.h b/lib/sensors.h index 94f6f230..644a4a9a 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -31,7 +31,7 @@ when the API or ABI breaks), the third digit is incremented to track small API additions like new flags / enum values. The second digit is for tracking larger additions like new methods. */ -#define SENSORS_API_VERSION 0x500 +#define SENSORS_API_VERSION 0x501 #define SENSORS_CHIP_NAME_PREFIX_ANY NULL #define SENSORS_CHIP_NAME_ADDR_ANY (-1) @@ -143,6 +143,7 @@ typedef enum sensors_feature_type { SENSORS_FEATURE_ENERGY = 0x04, SENSORS_FEATURE_CURR = 0x05, SENSORS_FEATURE_HUMIDITY = 0x06, + SENSORS_FEATURE_PWM = 0x07, SENSORS_FEATURE_MAX_MAIN, SENSORS_FEATURE_VID = 0x10, SENSORS_FEATURE_INTRUSION = 0x11, @@ -244,6 +245,11 @@ typedef enum sensors_subfeature_type { SENSORS_SUBFEATURE_HUMIDITY_INPUT = SENSORS_FEATURE_HUMIDITY << 8, + SENSORS_SUBFEATURE_PWM_IO = SENSORS_FEATURE_PWM << 8, + SENSORS_SUBFEATURE_PWM_FREQ, + SENSORS_SUBFEATURE_PWM_ENABLE = (SENSORS_FEATURE_PWM << 8) | 0x80, + SENSORS_SUBFEATURE_PWM_MODE, + SENSORS_SUBFEATURE_VID = SENSORS_FEATURE_VID << 8, SENSORS_SUBFEATURE_INTRUSION_ALARM = SENSORS_FEATURE_INTRUSION << 8, diff --git a/lib/sysfs.c b/lib/sysfs.c index 9516cec4..13624448 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -149,6 +149,7 @@ int get_type_scaling(sensors_subfeature_type type) case SENSORS_SUBFEATURE_HUMIDITY_INPUT: return 1000; case SENSORS_SUBFEATURE_FAN_INPUT: + case SENSORS_SUBFEATURE_PWM_IO: return 1; case SENSORS_SUBFEATURE_POWER_AVERAGE: case SENSORS_SUBFEATURE_ENERGY_INPUT: @@ -186,6 +187,13 @@ char *get_feature_name(sensors_feature_type ftype, char *sfname) if (!name) sensors_fatal_error(__func__, "Out of memory"); + break; + case SENSORS_FEATURE_PWM: + /* Not all pwm subfeatures have a underscore in there name */ + name = strndup(sfname, 4); + if (!name) + sensors_fatal_error(__func__, "Out of memory"); + break; default: name = strdup(sfname); @@ -319,6 +327,13 @@ static const struct subfeature_type_match humidity_matches[] = { { NULL, 0 } }; +static const struct subfeature_type_match pwm_matches[] = { + { "enable", SENSORS_SUBFEATURE_PWM_ENABLE }, + { "mode", SENSORS_SUBFEATURE_PWM_MODE }, + { "freq", SENSORS_SUBFEATURE_PWM_FREQ }, + { NULL, 0 } +}; + static const struct subfeature_type_match cpu_matches[] = { { "vid", SENSORS_SUBFEATURE_VID }, { NULL, 0 } @@ -339,6 +354,7 @@ static struct feature_type_match matches[] = { { "energy%d%c", energy_matches }, { "intrusion%d%c", intrusion_matches }, { "humidity%d%c", humidity_matches }, + { "pwm%d%c", pwm_matches }, }; /* Return the subfeature type and channel number based on the subfeature @@ -356,9 +372,15 @@ sensors_subfeature_type sensors_subfeature_get_type(const char *name, int *nr) return SENSORS_SUBFEATURE_BEEP_ENABLE; } - for (i = 0; i < ARRAY_SIZE(matches); i++) - if ((count = sscanf(name, matches[i].name, nr, &c))) + for (i = 0; i < ARRAY_SIZE(matches); i++) { + if ((count = sscanf(name, matches[i].name, nr, &c))) { + /* Needed for matching pwm[1-*] */ + if (count == 1 && matches[i].submatches == pwm_matches) + return SENSORS_SUBFEATURE_PWM_IO; + break; + } + } if (i == ARRAY_SIZE(matches) || count != 2 || c != '_') return SENSORS_SUBFEATURE_UNKNOWN; /* no match */ @@ -468,6 +490,7 @@ static int sensors_read_dynamic_chip(sensors_chip_features *chip, case SENSORS_FEATURE_ENERGY: case SENSORS_FEATURE_CURR: case SENSORS_FEATURE_HUMIDITY: + case SENSORS_FEATURE_PWM: nr--; break; default: From a6ec549ed68ba9ea2a13963cd713831c47701a5e Mon Sep 17 00:00:00 2001 From: Armin Wolf Date: Sat, 28 Aug 2021 01:04:13 +0200 Subject: [PATCH 021/116] sensors: Add support for pwm sensors Add print_chip_pwm for displaying SENSORS_FEATURE_PWM. --- prog/sensors/chips.c | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 0eb07418..c50f9a97 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -754,6 +754,59 @@ static void print_chip_humidity(const sensors_chip_name *name, free(label); } +static void print_chip_pwm(const sensors_chip_name *name, + const sensors_feature *feature, + int label_size) +{ + const sensors_subfeature *sfio, *sffreq, *sfenable, *sfmode; + char *label; + double val; + + if (!(label = sensors_get_label(name, feature))) { + fprintf(stderr, "ERROR: Can't get label of feature %s!\n", + feature->name); + return; + } + print_label(label, label_size); + free(label); + + sfio = sensors_get_subfeature(name, feature, + SENSORS_SUBFEATURE_PWM_IO); + if (sfio && !get_input_value(name, sfio, &val)) + printf(" %3.0f%%", val / 2.55); + else + printf(" N/A"); + + sffreq = sensors_get_subfeature(name, feature, + SENSORS_SUBFEATURE_PWM_FREQ); + sfmode = sensors_get_subfeature(name, feature, + SENSORS_SUBFEATURE_PWM_MODE); + if (sffreq || sfmode) { + printf(" ("); + if (sffreq) + printf("freq = %.0f Hz", get_value(name, sffreq)); + + if (sfmode) { + if (!get_input_value(name, sfmode, &val)) + printf("%smode = %s", sffreq ? ", " : "", + (int) val ? "pwm" : "dc"); + else + printf("%smode = N/A", sffreq ? ", " : ""); + } + + printf(")"); + } + + sfenable = sensors_get_subfeature(name, feature, + SENSORS_SUBFEATURE_PWM_ENABLE); + + if (sfenable && !get_input_value(name, sfenable, &val) && + (int) val == 1) + printf(" MANUAL CONTROL"); + + printf("\n"); +} + static void print_chip_beep_enable(const sensors_chip_name *name, const sensors_feature *feature, int label_size) @@ -894,6 +947,9 @@ void print_chip(const sensors_chip_name *name) case SENSORS_FEATURE_HUMIDITY: print_chip_humidity(name, feature, label_size); break; + case SENSORS_FEATURE_PWM: + print_chip_pwm(name, feature, label_size); + break; default: continue; } From 73e3e5e9f40df10371de33c1615f81fe0e6229e6 Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Tue, 9 Nov 2021 21:11:14 +0100 Subject: [PATCH 022/116] configs: Add ASUS M5A97 motherboard This patch adds support for the ASUS M5A97 (not R2.0, the original) motherboard. The labels map exactly to the BIOS labels for consistency sake. The CPU and VDDA voltage limits are the absolute minimum and maximum values the motherboard regulators can supply. Users can always fine-tune these to their own preference if so desired. Found values where compared against bios values. The bios does have some extra settable voltages, but those are not affecting the ignore sensors. Maybe the Asus software has names/formulas for them, but as this is Windows only software, not usable. Signed-off-by: Olliver Schinagl --- configs/Asus/M5A97.conf | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 configs/Asus/M5A97.conf diff --git a/configs/Asus/M5A97.conf b/configs/Asus/M5A97.conf new file mode 100644 index 00000000..bd1bd9c4 --- /dev/null +++ b/configs/Asus/M5A97.conf @@ -0,0 +1,48 @@ +# lm-sensors configuration fo rthe ASUS M5A97 +# +# Manufacturer: ASUSTeK COMPUTER INC. +# Product Name: M5A97\ +# Version: Rev 1.xx +# Super I/O: IT8721F +# Bios Version: 1605 + +chip "it8721-*" + label in0 "12V Voltage" + label in1 "5V Voltage" + label in2 "VCORE Voltage" + label in3 "3.3 Voltage" + ignore in4 # Not available in BIOS + label in5 "VDDA2.5 Voltage" + ignore in6 # Not available in BIOS + ignore in7 # Not available in BIOS + label in8 "Vbat Voltage" + + compute in0 @ * (515 / 120), @ / (515 / 120) + compute in1 @ * (215 / 120), @ / (215 / 120) + + set in0_min 12 * 0.95 + set in0_max 12 * 1.05 + set in1_min 5 * 0.95 + set in1_max 5 * 1.05 + set in2_min 1.075 + set in2_max 1.875 + set in3_min 3.3 * 0.95 + set in3_max 3.3 * 1.05 + set in5_min 2.2 + set in5_max 2.8 + + label fan1 "CPU FAN Speed" + label fan2 "CHASSIS FAN 1 Speed" + label fan3 "CHASSIS FAN 2 Speed" + ignore fan4 # No connector present + label fan5 "POWER FAN Speed" + + set fan1_min 100 + set fan2_min 100 + set fan3_min 100 + set fan4_min 100 + set fan5_min 100 + + label temp1 "CPU Temperature" + label temp2 "MB Temperature" + ignore temp3 # Not available in BIOS From 25381608cb2009032c23d669ca449ee236f65a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20M=C3=BCller?= Date: Thu, 3 Feb 2022 16:34:59 +0100 Subject: [PATCH 023/116] add nct6106 Specs from here: https://www.nuvoton.com/export/resource-files/NCT6102D_NCT6106D_Datasheet_V1_0.pdf Chapter 8.5.2.1 (page 73 of pdf) The calculation for 3VSB (in6) is necessary as observed by BIOS output on Supermicro A2SAP-H board. This observation is also true for the output dump for Supermicro X10SLV in the last comment of #77).. --- etc/sensors.conf.default | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/etc/sensors.conf.default b/etc/sensors.conf.default index 693a66b4..e13793ed 100644 --- a/etc/sensors.conf.default +++ b/etc/sensors.conf.default @@ -311,6 +311,17 @@ chip "w83627thf-*" # set in8_max 3.0 * 1.10 +chip "nct6106-isa-*" + + label in0 "Vcore" + label in2 "AVCC" + label in3 "+3.3V" + label in6 "3VSB" + label in7 "Vbat" + + compute in6 @*2, @/2 + + chip "w83627ehf-*" "w83627dhg-*" "w83667hg-*" "nct6775-*" "nct6776-*" \ "nct6779-*" "nct6791-*" "nct6795-*" "nct6796-*" From 68e7948414a6595ebb3ae481a81e3602f42d9273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20M=C3=BCller?= Date: Thu, 3 Feb 2022 16:45:28 +0100 Subject: [PATCH 024/116] add config for SuperMicro A2SAP Tested with SuperMicro A2SAP-H board in SuperServer E50-9AP. --- configs/SuperMicro/A2SAP.conf | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 configs/SuperMicro/A2SAP.conf diff --git a/configs/SuperMicro/A2SAP.conf b/configs/SuperMicro/A2SAP.conf new file mode 100644 index 00000000..bd6e6544 --- /dev/null +++ b/configs/SuperMicro/A2SAP.conf @@ -0,0 +1,3 @@ +chip "nct6106-isa-*" + + label in5 "Vdimm" From 5e2e1fff53ec1cef408b22dc966db133d34a699b Mon Sep 17 00:00:00 2001 From: Michal Pomorski Date: Thu, 10 Feb 2022 02:01:30 +0100 Subject: [PATCH 025/116] Deal with relative paths for the config file. --- prog/pwm/pwmconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index edcbde9e..e4f05131 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -31,6 +31,7 @@ LM_VERSION='3.6.0+git' PIDFILE="/var/run/fancontrol.pid" +USERDIR=$(pwd) if [ -f "$PIDFILE" ] then @@ -614,6 +615,10 @@ function AskPath() then FCCONFIG="/etc/fancontrol" fi + if [ ${FCCONFIG::1} != "/" ] + then + FCCONFIG=$(readlink -f $USERDIR/$FCCONFIG) + fi } AskPath From 9943682a8021d95ce17a07f088fe38624a7ff96d Mon Sep 17 00:00:00 2001 From: Michal Pomorski Date: Thu, 10 Feb 2022 02:39:26 +0100 Subject: [PATCH 026/116] Add quotes over path variables. --- prog/pwm/pwmconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index e4f05131..f7bb0334 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -617,7 +617,7 @@ function AskPath() fi if [ ${FCCONFIG::1} != "/" ] then - FCCONFIG=$(readlink -f $USERDIR/$FCCONFIG) + FCCONFIG=$(readlink -f "$USERDIR"/"$FCCONFIG") fi } @@ -668,7 +668,7 @@ function LoadConfig() fi } -LoadConfig $FCCONFIG +LoadConfig "$FCCONFIG" # $1 = pwm value below which the fan is stopped function TestMinStart() @@ -820,8 +820,8 @@ function SaveConfig() echo "MINSTOP=$MINSTOP" >>$tmpfile [ -n "$MINPWM" ] && echo "MINPWM=$MINPWM" >>$tmpfile [ -n "$MAXPWM" ] && echo "MAXPWM=$MAXPWM" >>$tmpfile - mv $tmpfile $FCCONFIG - chmod +r $FCCONFIG + mv $tmpfile "$FCCONFIG" + chmod +r "$FCCONFIG" #check if file was written correctly echo 'Configuration saved' } From 17479e357891b32d740467c9c41384a471b4d8c4 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 11 May 2022 20:30:02 +0100 Subject: [PATCH 027/116] Changes as per PR review --- configs/Gigabyte/GA-B550-VISION-D.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/Gigabyte/GA-B550-VISION-D.conf b/configs/Gigabyte/GA-B550-VISION-D.conf index 71511dd4..6678d1ee 100644 --- a/configs/Gigabyte/GA-B550-VISION-D.conf +++ b/configs/Gigabyte/GA-B550-VISION-D.conf @@ -10,13 +10,13 @@ # ITE IT8792E Super IO Sensors chip "it8792-*" - label in0 "VIN0" # so-called by hwinfo64 on Windows + label in0 "VIN0" label in1 "DDR VTT" label in2 "Chipset Core" - label in3 "VIN3" # so-called by hwinfo64 on Windows + # label in3 "VIN3" # it87 module default is "+3.3V" label in4 "CPU VDD 18" label in5 "PM_CLDO12" - label in6 "six" # hwinfo64 is ignoring one input, I think it's this one + # label in6 "six" # hwinfo64 is ignoring one input, I think it's this one label in7 "3VSB" label in8 "VBAT" From eafabbf13fa6a1a22a19b070acf0a12c78f1768a Mon Sep 17 00:00:00 2001 From: petersulyok Date: Fri, 10 Jun 2022 17:12:25 +0200 Subject: [PATCH 028/116] Add config for ASRock Z690 Extreme motherboard --- configs/ASRock/Z690_Extreme.conf | 111 +++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 configs/ASRock/Z690_Extreme.conf diff --git a/configs/ASRock/Z690_Extreme.conf b/configs/ASRock/Z690_Extreme.conf new file mode 100644 index 00000000..de106516 --- /dev/null +++ b/configs/ASRock/Z690_Extreme.conf @@ -0,0 +1,111 @@ +# +# Z690_Extreme.conf +# lm-sensors configuration file for ASRock Z690 Extreme (WiFi 6E) motherboards. +# +# Vendor website: https://www.asrock.com/mb/Intel/Z690%20Extreme/index.asp +# Original github project: https://github.com/petersulyok/asrock_z690_extreme +# +# dmidecode: +# Manufacturer: ASRock +# Product Name: Z690 Extreme +# dmesg: nct6775: Found NCT6798D or compatible chip at 0x2e:0x2a0 +# + +# Nuvoton NCT6796D-E super IO chip (recognized diffently by lm-sensors) -> driver nct6775 needs to be loaded +chip "nct6798-isa-02a0" + + # 1. voltages + label in0 "CPU Vcore" + compute in0 @*2, @/2 + set in0_min 0.9 + set in0_max 2.1 + set in0_beep 1 + + label in1 "+5.0V" + compute in1 @*(24/8), @/(24/8) + set in1_min 5 * 0.9 + set in1_max 5 * 1.1 + set in1_beep 1 + + ignore in2 + + label in3 "+3.3V" + set in3_min 3.3 * 0.9 + set in3_max 3.3 * 1.1 + set in3_beep 1 + + label in4 "+12V" + compute in4 @*12, @/12 + set in4_min 12 * 0.95 + set in4_max 12 * 1.05 + set in4_beep 1 + + label in5 "VCCIN_AUX" + compute in5 @*2, @/2 + set in5_min 1.7 + set in5_max 2.5 + set in5_beep 1 + + label in6 "DRAM" + set in6_min 1.1 + set in6_max 1.65 + set in6_beep 1 + + ignore in7 + ignore in8 + ignore in9 + + label in10 "+1.05V PROC" + compute in10 @*2, @/2 + set in10_min 0.95 + set in10_max 1.8 + set in10_beep 1 + + label in11 "+0.82V PCH" + compute in11 @*2, @/2 + set in11_min 0.72 + set in11_max 1.3 + set in11_beep 1 + + label in12 "+1.05V PCH" + set in12_min 0.95 + set in12_max 1.5 + set in12_beep 1 + + label in13 "VCCSA" + compute in13 @*2, @/2 + set in13_min 0.95 + set in13_max 2.0 + set in13_beep 1 + + ignore in14 + + # 2. fans + label fan1 "Chassis fan3" + label fan2 "CPU fan1" + set fan2_min 200 + set fan2_beep 1 + label fan3 "CPU fan2" + label fan4 "Chassis fan4" + label fan5 "Chassis fan2" + label fan6 "Chassis fan1" + label fan7 "Chassis fan5" + + # 3. temperatures + label temp1 "Motherboard" # SYSTIN + ignore temp2 # CPUTIN + ignore temp3 # AUXTIN0 + ignore temp4 # AUXTIN1 + ignore temp5 # AUXTIN2 + ignore temp6 # AUXTIN3 + label temp7 "CPU" # PECI Agent 0 + ignore temp8 # PCH_CHIP_CPU_MAX_TEMP + ignore temp9 # PCH_CHIP_TEMP + ignore temp10 # PCH_CPU_TEMP + + # 4. other + set beep_enable 1 + ignore intrusion0 + ignore intrusion1 + +# End From f63be94d93adc80840d80fa0c52844a986d958e9 Mon Sep 17 00:00:00 2001 From: petersulyok Date: Fri, 10 Jun 2022 18:19:12 +0200 Subject: [PATCH 029/116] Add config for ASRock Z390 Taichi motherboard --- configs/ASRock/Z390_Taichi.conf | 161 ++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 configs/ASRock/Z390_Taichi.conf diff --git a/configs/ASRock/Z390_Taichi.conf b/configs/ASRock/Z390_Taichi.conf new file mode 100644 index 00000000..34c6bf8e --- /dev/null +++ b/configs/ASRock/Z390_Taichi.conf @@ -0,0 +1,161 @@ +# +# Z390_Taichi.conf +# lm-sensors configuration file for ASRock Z390 Taichi motherboards. +# +# Vendor site: https://www.asrock.com/mb/Intel/Z390%20Taichi/index.asp +# Original github project: https://github.com/petersulyok/asrock_z390_taichi +# + +# Primary Nuvoton NCT6791D SIO chip +chip "nct6791-isa-0290" + + # 1. voltages + label in0 "Vcore" + compute in0 @*2, @/2 + set in0_min 0.9 + set in0_max 2.1 + set in0_beep 1 + + label in1 "+5V" + compute in1 @*(24/8), @/(24/8) + set in1_min 5 * 0.9 + set in1_max 5 * 1.1 + set in1_beep 1 + + ignore in2 + + label in3 "+3.3V" + set in3_min 3.3 * 0.9 + set in3_max 3.3 * 1.1 + set in3_beep 1 + + label in4 "+12V" + compute in4 @*12, @/12 + set in4_min 12 * 0.95 + set in4_max 12 * 1.05 + set in4_beep 1 + + label in5 "CPU PLL2" + set in5_min 0.936 + set in5_max 2.613 + set in5_beep 1 + + label in6 "PCH +1.0V" + set in6_min 0.95 + set in6_max 1.5 + set in6_beep 1 + + ignore in7 + ignore in8 + ignore in9 + ignore in10 + + label in11 "VCCIO" + set in11_min 0.85 + set in11_max 2.0 + set in11_beep 1 + + label in12 "DRAM" + set in12_min 1.0 + set in12_max 2.3 + set in12_beep 1 + + label in13 "DRAM VPP" + compute in13 @*2, @/2 + set in13_min 2.4 + set in13_max 2.8 + set in13_beep 1 + + label in14 "VCCSA" + set in14_min 0.95 + set in14_max 2.613 + set in14_beep 1 + + # 2. fans + label fan1 "Chassis fan3" + label fan2 "CPU fan1" + set fan2_min 200 + set fan2_beep 1 + label fan3 "CPU fan2" + label fan4 "Chassis fan1" + label fan5 "Chassis fan2" + + # 3. temperatures + label temp1 "Motherboard" + set temp1_max 60 + set temp1_beep 1 + + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + + # 4. other + set beep_enable 1 + ignore intrusion0 + ignore intrusion1 + + +# Secondary Nuvoton NCT5567D SIO chip +chip "nct6793-isa-0a10" + + # 1. voltages + ignore in0 + ignore in1 + ignore in2 + ignore in3 + ignore in4 + ignore in5 + ignore in6 + ignore in7 + ignore in8 + ignore in9 + ignore in10 + ignore in11 + + label in12 "Cold Bug Killer" + set in12_min 0.936 + set in12_max 2.613 + set in12_beep 1 + + label in13 "DMI" + set in13_min 0.864 + set in13_max 2.016 + set in13_beep 1 + + ignore in14 + + # 2. fans + label fan1 "Chassis fan5" + label fan2 "Chassis fan6" + ignore fan3 + ignore fan4 + label fan5 "Chassis fan4" + + # 3. temperatures + ignore temp1 + + label temp2 "CPU" + set temp2_max 90 + set temp2_beep 1 + + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + + # 4. other + set beep_enable 1 + ignore intrusion0 + ignore intrusion1 + +# End From 76e1d45abd287f4ab823cba88d7babdcf8e0021e Mon Sep 17 00:00:00 2001 From: clipo1979 Date: Fri, 17 Jun 2022 18:39:37 +0100 Subject: [PATCH 030/116] Update GA-MA770-UD3.conf Comment out ignore intrusion0 as per recommendation. --- configs/Gigabyte/GA-MA770-UD3.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/Gigabyte/GA-MA770-UD3.conf b/configs/Gigabyte/GA-MA770-UD3.conf index 3b54b4f1..dfa0c203 100644 --- a/configs/Gigabyte/GA-MA770-UD3.conf +++ b/configs/Gigabyte/GA-MA770-UD3.conf @@ -72,7 +72,7 @@ chip "it8720-*" # Values seen: 77-81, rising from cold start. # Fanning the Northbridge did not change value enough to indicate cooling. - ignore intrusion0 + # ignore intrusion0 # Fans # The labels chosen are the ones printed on the motherboard From ad8490240e855c7e08a64de06e96bf2ed7d7725a Mon Sep 17 00:00:00 2001 From: Sam James Date: Mon, 27 Jun 2022 10:22:54 +0100 Subject: [PATCH 031/116] Makefile: drop usage of 'which' `which` is an external command which isn't required by POSIX. Debian and other distributions (like Gentoo!) are looking to drop it from their base set of packages. Switch to `command -v` which should always work instead. Signed-off-by: Sam James --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 47ffe788..92ce9348 100644 --- a/Makefile +++ b/Makefile @@ -267,7 +267,7 @@ manhtml: # Flex and Bison %.c: %.y - @if ! which $(BISON) 2> /dev/null ; then \ + @if ! command -v $(BISON) 2> /dev/null ; then \ echo "Please install $(BISON), then run \"make clean\" and try again" ; \ false ; \ fi @@ -280,7 +280,7 @@ FLEX_FLAGS := -Psensors_yy -t -Cfe -8 endif %.c: %.l - @if ! which $(FLEX) 2> /dev/null ; then \ + @if ! command -v $(FLEX) 2> /dev/null ; then \ echo "Please install $(FLEX), then run \"make clean\" and try again" ; \ false ; \ fi From 3e82636733c3250d90e7f539ad00fcf41a0722a1 Mon Sep 17 00:00:00 2001 From: Arvid Norlander Date: Mon, 18 Jul 2022 17:54:14 +0200 Subject: [PATCH 032/116] ZSH completion for sensors and sensors-detect --- Makefile | 8 ++++++++ prog/detect/Module.mk | 6 +++++- prog/detect/_sensors-detect | 10 ++++++++++ prog/sensors/Module.mk | 6 +++++- prog/sensors/_sensors | 29 +++++++++++++++++++++++++++++ 5 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 prog/detect/_sensors-detect create mode 100644 prog/sensors/_sensors diff --git a/Makefile b/Makefile index 47ffe788..a0f4fe74 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,14 @@ ETCDIR := /etc # library files (both static and shared) will be installed. LIBDIR := $(PREFIX)/lib +# You should not need to change this. It is the directory into which the +# data files will be installed. +DATADIR := $(PREFIX)/share + +# You should not need to change this. It is the directory into which the +# ZSH completion files will be installed. +ZSHCOMPDIR := $(DATADIR)/zsh/site-functions + EXLDFLAGS := -Wl,-rpath,$(LIBDIR) # You should not need to change this. It is the directory into which the diff --git a/prog/detect/Module.mk b/prog/detect/Module.mk index d2526d80..1b2cac6d 100644 --- a/prog/detect/Module.mk +++ b/prog/detect/Module.mk @@ -24,6 +24,7 @@ PROGDETECTDIR := $(MODULE_DIR) PROGDETECTMAN8DIR := $(MANDIR)/man8 PROGDETECTMAN8FILES := $(MODULE_DIR)/sensors-detect.8 +PROGDETECTZSHCOMPFILES := $(MODULE_DIR)/_sensors-detect # Regrettably, even 'simply expanded variables' will not put their currently # defined value verbatim into the command-list of rules... @@ -31,19 +32,22 @@ PROGDETECTSBININSTALL := $(MODULE_DIR)/sensors-detect REMOVEDETECTBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGDETECTSBININSTALL)) REMOVEDETECTMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGDETECTMAN8DIR)/%,$(PROGDETECTMAN8FILES)) +REMOVEDETECTZSH := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(ZSHCOMPDIR)/%,$(PROGDETECTZSHCOMPFILES)) all-prog-detect: user :: all-prog-detect install-prog-detect: all-prog-detect - $(MKDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(PROGDETECTMAN8DIR) + $(MKDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(PROGDETECTMAN8DIR) $(DESTDIR)$(ZSHCOMPDIR) $(INSTALL) -m 755 $(PROGDETECTSBININSTALL) $(DESTDIR)$(SBINDIR) $(INSTALL) -m 644 $(PROGDETECTMAN8FILES) $(DESTDIR)$(PROGDETECTMAN8DIR) + $(INSTALL) -m 644 $(PROGDETECTZSHCOMPFILES) $(DESTDIR)$(ZSHCOMPDIR) user_install :: install-prog-detect user_uninstall:: $(RM) $(REMOVEDETECTBIN) $(RM) $(REMOVEDETECTMAN) + $(RM) $(REMOVEDETECTZSH) clean-prog-detect: clean :: clean-prog-detect diff --git a/prog/detect/_sensors-detect b/prog/detect/_sensors-detect new file mode 100644 index 00000000..fb34fd57 --- /dev/null +++ b/prog/detect/_sensors-detect @@ -0,0 +1,10 @@ +#compdef sensors-detect + +typeset -a args + +args=( + '--auto[run in automatic mode, assuming default answers to all questions (may not be safe)]' + '--stat[display i2c address statistics]' +) + +_arguments $args diff --git a/prog/sensors/Module.mk b/prog/sensors/Module.mk index b6564414..011be2d3 100644 --- a/prog/sensors/Module.mk +++ b/prog/sensors/Module.mk @@ -24,6 +24,7 @@ PROGSENSORSDIR := $(MODULE_DIR) PROGSENSORSMAN1DIR := $(MANDIR)/man1 PROGSENSORSMAN1FILES := $(MODULE_DIR)/sensors.1 +PROGSENSORSZSHCOMPFILES := $(MODULE_DIR)/_sensors # Regrettably, even 'simply expanded variables' will not put their currently # defined value verbatim into the command-list of rules... @@ -36,6 +37,7 @@ INCLUDEFILES += $(PROGSENSORSSOURCES:.c=.rd) REMOVESENSORSBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGSENSORSTARGETS)) REMOVESENSORSMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORSMAN1DIR)/%,$(PROGSENSORSMAN1FILES)) +REMOVESENSORSZSH := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(ZSHCOMPDIR)/%,$(PROGSENSORSZSHCOMPFILES)) LIBICONV := $(shell if /sbin/ldconfig -p | grep -q '/libiconv\.so$$' ; then echo \-liconv; else echo; fi) @@ -46,14 +48,16 @@ all-prog-sensors: $(PROGSENSORSTARGETS) user :: all-prog-sensors install-prog-sensors: all-prog-sensors - $(MKDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(PROGSENSORSMAN1DIR) + $(MKDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(PROGSENSORSMAN1DIR) $(DESTDIR)$(ZSHCOMPDIR) $(INSTALL) -m 755 $(PROGSENSORSTARGETS) $(DESTDIR)$(BINDIR) $(INSTALL) -m 644 $(PROGSENSORSMAN1FILES) $(DESTDIR)$(PROGSENSORSMAN1DIR) + $(INSTALL) -m 644 $(PROGSENSORSZSHCOMPFILES) $(DESTDIR)$(ZSHCOMPDIR) user_install :: install-prog-sensors user_uninstall:: $(RM) $(REMOVESENSORSBIN) $(RM) $(REMOVESENSORSMAN) + $(RM) $(REMOVESENSORSZSH) clean-prog-sensors: $(RM) $(PROGSENSORSDIR)/*.rd $(PROGSENSORSDIR)/*.ro diff --git a/prog/sensors/_sensors b/prog/sensors/_sensors new file mode 100644 index 00000000..f42202f6 --- /dev/null +++ b/prog/sensors/_sensors @@ -0,0 +1,29 @@ +#compdef sensors + +# List of adapters. This depends on jq to parse the json output. +_sensors_adapaters() { + declare -a adapters + eval set -A adapters "$(sensors -j | jq -r 'keys|@sh')" + _values adapter $adapters +} + +_sensors() { + typeset -a args + + args=( + '--bus-list[generate bus statements for sensors.conf]' + '--no-adapter[do not show adapter for each chip]' + '-A[do not show adapter for each chip]' + '-j[json output]' + '-u[raw output]' + '(--allow-no-sensors -n)'{--allow-no-sensors,-n}'[do not fail if no sensors found]' + '(--config-file -c)'{--config-file,-c}'[specify a config file]:file:_files' + '(--fahrenheit -f)'{--fahrenheit,-f}'[show temperatures in degrees fahrenheit]' + '(--set -s)'{--set,-s}'[execute `set'\'' statements (root only)]' + '(-)'{--help,-h}'[display help text]' + '(-)'{--version,-v}'[display the program version]' + '*:chip:_sensors_adapaters' + ) + + _arguments $args +} From 4b0fa3340a443a8eda944ecd93fcc431794b32d3 Mon Sep 17 00:00:00 2001 From: petersulyok Date: Wed, 10 Aug 2022 17:25:22 +0200 Subject: [PATCH 033/116] Fix: CPU Vcore calculation and swapped fans are fixed --- configs/ASRock/Z690_Extreme.conf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configs/ASRock/Z690_Extreme.conf b/configs/ASRock/Z690_Extreme.conf index de106516..502d0253 100644 --- a/configs/ASRock/Z690_Extreme.conf +++ b/configs/ASRock/Z690_Extreme.conf @@ -7,17 +7,17 @@ # # dmidecode: # Manufacturer: ASRock -# Product Name: Z690 Extreme +# Product Name: Z690 Extreme # dmesg: nct6775: Found NCT6798D or compatible chip at 0x2e:0x2a0 # -# Nuvoton NCT6796D-E super IO chip (recognized diffently by lm-sensors) -> driver nct6775 needs to be loaded +# Nuvoton NCT6796D-E super IO chip (recognized diffently by lm-sensors) chip "nct6798-isa-02a0" # 1. voltages label in0 "CPU Vcore" - compute in0 @*2, @/2 - set in0_min 0.9 + compute in0 @*1, @/1 + set in0_min 0.2 set in0_max 2.1 set in0_beep 1 @@ -26,7 +26,7 @@ chip "nct6798-isa-02a0" set in1_min 5 * 0.9 set in1_max 5 * 1.1 set in1_beep 1 - + ignore in2 label in3 "+3.3V" @@ -86,9 +86,9 @@ chip "nct6798-isa-02a0" set fan2_min 200 set fan2_beep 1 label fan3 "CPU fan2" - label fan4 "Chassis fan4" + label fan4 "Chassis fan1" label fan5 "Chassis fan2" - label fan6 "Chassis fan1" + label fan6 "Chassis fan4" label fan7 "Chassis fan5" # 3. temperatures From 6da486d7415e426ec983baa5f8edafe0ff4c4171 Mon Sep 17 00:00:00 2001 From: 7217043955 <85880133+7217043955@users.noreply.github.com> Date: Tue, 6 Sep 2022 15:48:11 +0800 Subject: [PATCH 034/116] Add support for dev_name formatted like "a000000.wifi" --- lib/sysfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index 9516cec4..c1d43465 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -663,8 +663,9 @@ static int classify_device(const char *dev_name, if ((!subsys || !strcmp(subsys, "platform") || !strcmp(subsys, "of_platform"))) { /* must be new ISA (platform driver) */ - if (sscanf(dev_name, "%*[a-zA-Z0-9_]%*1[.:]%d", &entry->chip.addr) != 1) - entry->chip.addr = 0; + if (sscanf(dev_name, "%*[a-zA-Z0-9_]%*1[.:]%d", &entry->chip.addr) == 1); + else if (sscanf(dev_name, "%x.%*s", &entry->chip.addr) == 1); + else entry->chip.addr = 0; entry->chip.bus.type = SENSORS_BUS_TYPE_ISA; entry->chip.bus.nr = 0; } else if (subsys && !strcmp(subsys, "acpi")) { From bac3d5d0bb41bf937da528fa6503f2eb3ce6504e Mon Sep 17 00:00:00 2001 From: Reiner Buehl Date: Sun, 18 Sep 2022 16:15:36 +0200 Subject: [PATCH 035/116] Create IONITX-U Zotac IONITX-U Series configuration --- configs/Zotac/IONITX-U | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 configs/Zotac/IONITX-U diff --git a/configs/Zotac/IONITX-U b/configs/Zotac/IONITX-U new file mode 100644 index 00000000..f18521ca --- /dev/null +++ b/configs/Zotac/IONITX-U @@ -0,0 +1,37 @@ +# libsensors configuration file for Zotac IONITX-U-E mainboard + +chip "w83667hg-*" + + label in0 "Vcore" + label in1 "Memory Voltage" + label in2 "3VCC" + label in4 "V1.05" + label in5 "V1.50" + label in7 "3VSB" + label in8 "Vbat" + label fan1 "SYS Fan" + label fan2 "CPU Fan" + label temp1 "M/B Temp" + label temp2 "CPU Temp" + ignore in3 + ignore fan3 + ignore fan4 + ignore fan5 + ignore temp3 + ignore intrusion0 + ignore cpu0_vid + + set in1_min 1.5 * 0.90 + set in1_max 1.5 * 1.10 + set in2_min 3.3 * 0.90 + set in2_max 3.3 * 1.10 + set in4_min 1.0 * 0.90 + set in4_max 1.0 * 1.10 + set in5_min 1.5 * 0.90 + set in5_max 1.5 * 1.10 + set in7_min 3.3 * 0.90 + set in7_max 3.3 * 1.10 + set in8_min 3.0 * 0.90 + set in8_max 3.3 * 1.10 + set temp1_max 55 + set temp1_max_hyst 52 From f24ed9de230f8ca85bb891d95b8ddd38e0677cdc Mon Sep 17 00:00:00 2001 From: lilinjie Date: Mon, 12 Dec 2022 11:01:54 +0800 Subject: [PATCH 036/116] fix spelling error Signed-off-by: lilinjie --- prog/pwm/pwmconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index edcbde9e..2d1c358c 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -35,7 +35,7 @@ PIDFILE="/var/run/fancontrol.pid" if [ -f "$PIDFILE" ] then echo "File $PIDFILE exists. This typically means that the" - echo "fancontrol deamon is running. You should stop it before running pwmconfig." + echo "fancontrol daemon is running. You should stop it before running pwmconfig." echo "If you are certain that fancontrol is not running, then you can delete" echo "$PIDFILE manually." exit 1 From 56dfb9ca245b36d7628121ec4a9feb6749ef7476 Mon Sep 17 00:00:00 2001 From: petersulyok Date: Thu, 5 Jan 2023 12:54:57 +0100 Subject: [PATCH 037/116] Removed computation for voltage in0. --- configs/ASRock/Z690_Extreme.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/ASRock/Z690_Extreme.conf b/configs/ASRock/Z690_Extreme.conf index 502d0253..136e0b52 100644 --- a/configs/ASRock/Z690_Extreme.conf +++ b/configs/ASRock/Z690_Extreme.conf @@ -16,7 +16,6 @@ chip "nct6798-isa-02a0" # 1. voltages label in0 "CPU Vcore" - compute in0 @*1, @/1 set in0_min 0.2 set in0_max 2.1 set in0_beep 1 From 820e6f75fb51192112c01586af210c20008d61f7 Mon Sep 17 00:00:00 2001 From: Armin Wolf Date: Mon, 9 Jan 2023 02:53:52 +0100 Subject: [PATCH 038/116] Add Fujitsu D3402-B1 config Create config for the Fujitsu D3402-B1 motherboard. The config was provided by github user @rcmcronny, see #421 for details. Signed-off-by: Armin Wolf --- .../FujitsuTechnologySolutions/D3402-B1.conf | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 configs/FujitsuTechnologySolutions/D3402-B1.conf diff --git a/configs/FujitsuTechnologySolutions/D3402-B1.conf b/configs/FujitsuTechnologySolutions/D3402-B1.conf new file mode 100644 index 00000000..3f694401 --- /dev/null +++ b/configs/FujitsuTechnologySolutions/D3402-B1.conf @@ -0,0 +1,43 @@ +# Fujitsu Technology Solutions D3402-B1, "Teutates"-Chip +# Contributed by Armin Wolf + +chip "ftsteutates-*" + +# Temperatures + label temp1 "PECI" + label temp2 "Graphics" + label temp3 "Ambient" + label temp4 "Core" + label temp5 "Memory" + label temp6 "PCH" + label temp7 "Teutates" + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + +# Fans + label fan1 "CPU" + label fan2 "SYS" + label fan3 "OEM" + label fan4 "PSU" + ignore fan5 + ignore fan6 + ignore fan7 + ignore fan8 + +# Voltages + label in1 "VCC 3.3V" + label in2 "3.3V AUX" + label in3 "V_IN (12V)" + label in4 "VBAT 3.0V" + + compute in1 @*1.1, @/1.1 + compute in2 @*1.1, @/1.1 + compute in3 @*3.9, @/3.9 + compute in4 @*1.0, @/1.0 From 1d7409ce556193c57c41c8127f81d63e0c0495d5 Mon Sep 17 00:00:00 2001 From: Sergei Bulatov Date: Fri, 3 Mar 2023 21:01:51 +0700 Subject: [PATCH 039/116] Create X8DTL-I.conf We just wrote a configuration for Supermicro X8DTL-I with @Steve-Tech --- configs/X8DTL-I.conf | 113 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 configs/X8DTL-I.conf diff --git a/configs/X8DTL-I.conf b/configs/X8DTL-I.conf new file mode 100644 index 00000000..6bb5584e --- /dev/null +++ b/configs/X8DTL-I.conf @@ -0,0 +1,113 @@ +# Config for a Supermicro X8DTL-I +# Authors: Steve-Tech, renardein +# Based on Supremicro X8DTN, C7X58 and HP N40L configurations +# Also compatible with all X8DTL-* motherboards +# Created: 3 March 2023 + +# Modules: +# w83795 +# coretemp +# jc42 + +# Board has two sensor chips, w83627dhg is not used for temperature, +# fans or voltage sensing. sensors-detect will suggest that you load the +# w83627ehf driver but you shouldn't. + +# config for w83795adg chip +bus "i2c-0" "SMBus I801 adapter at 0400" +chip "w83795adg-i2c-0-2f" + label in0 "CPU1 VDD" + label in1 "CPU2 VDD" + label in2 "CPU1 DIMM" + label in3 "CPU2 DIMM" + label in4 "+5V" + label in5 "5VSB" + label in6 "+12V" + label in7 "-12V" + label in11 "VTT" + label in12 "+3.3V" + label in13 "3VSB" + label in14 "VBAT" + label fan1 "FAN 1" + label fan2 "FAN 2" + label fan3 "FAN 3" + label fan4 "FAN 4" + label fan5 "FAN 5" + label fan6 "FAN 6" + label beep_enable "Beep" + label intrusion0 "Intrusion" + label temp5 "Motherboard" + + ignore temp1 # Chipset temperature taken from PECI + ignore temp7 + ignore temp8 + + compute in4 @*4, @/4 + compute in5 @*4, @/4 + compute in6 @*6.62, @/6.62 + compute in7 -@*8, -@/8 + + # Voltage Limits + # CPU + set in0_min 0.82 + set in0_max 1.35 + set in1_min 0.82 + set in1_max 1.35 + #DIMM + set in2_min 1.35 + set in2_max 1.5 + set in3_min 1.35 + set in3_max 1.5 + #+3.3V + set in12_min 3.135 + set in12_max 3.465 + #+5V and +5VSB + set in4_min 4.750 + set in4_max 5.250 + set in5_min 4.750 + set in5_max 5.250 + #+12V and -12V + set in6_min 11.400 + set in6_max 12.600 + set in7_min 10.800 + set in7_max 13.200 + + #FAN Limits + set fan1_min 700 + set fan2_min 700 + set fan3_min 700 + set fan4_min 700 + set fan5_min 700 + set fan6_min 700 + +#config for coretemp 1 +chip "coretemp-isa-0000" + label temp2 "CPU 1 Core 1" + label temp3 "CPU 1 Core 2" + label temp4 "CPU 1 Core 3" + label temp5 "CPU 1 Core 4" + label temp6 "CPU 1 Core 5" + label temp7 "CPU 1 Core 6" + +#config for coretemp 2 +chip "coretemp-isa-0001" + label temp2 "CPU 2 Core 1" + label temp3 "CPU 2 Core 2" + label temp4 "CPU 2 Core 3" + label temp5 "CPU 2 Core 4" + label temp6 "CPU 2 Core 5" + label temp7 "CPU 2 Core 6" + +#config for intel5500 +chip "intel5500-pci-00a3" + label temp1 "Chipset" + +#config for DIMM's +chip "jc42-i2c-0-1a" + label temp1 "DIMM A Temp" + +chip "jc42-i2c-0-18" + label temp1 "DIMM B Temp" + +chip "jc42-i2c-0-1c" + label temp1 "DIMM C Temp" From 1378c599484fefc93d9ab38a55fcf5a70d0919a2 Mon Sep 17 00:00:00 2001 From: Sergei Bulatov Date: Sat, 4 Mar 2023 08:07:02 +0700 Subject: [PATCH 040/116] Rename configs/X8DTL-I.conf to configs/SuperMicro/X8DTL-I.conf --- configs/{ => SuperMicro}/X8DTL-I.conf | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename configs/{ => SuperMicro}/X8DTL-I.conf (100%) diff --git a/configs/X8DTL-I.conf b/configs/SuperMicro/X8DTL-I.conf similarity index 100% rename from configs/X8DTL-I.conf rename to configs/SuperMicro/X8DTL-I.conf From 3d87ec8f4dee2409f07b83f2e239209aa56726b8 Mon Sep 17 00:00:00 2001 From: Sergei Bulatov Date: Sat, 4 Mar 2023 08:09:50 +0700 Subject: [PATCH 041/116] remove coretemp and jc42 chips --- configs/SuperMicro/X8DTL-I.conf | 34 --------------------------------- 1 file changed, 34 deletions(-) diff --git a/configs/SuperMicro/X8DTL-I.conf b/configs/SuperMicro/X8DTL-I.conf index 6bb5584e..8be5258a 100644 --- a/configs/SuperMicro/X8DTL-I.conf +++ b/configs/SuperMicro/X8DTL-I.conf @@ -6,8 +6,6 @@ # Modules: # w83795 -# coretemp -# jc42 # Board has two sensor chips, w83627dhg is not used for temperature, # fans or voltage sensing. sensors-detect will suggest that you load the @@ -79,35 +77,3 @@ chip "w83795adg-i2c-0-2f" set fan4_min 700 set fan5_min 700 set fan6_min 700 - -#config for coretemp 1 -chip "coretemp-isa-0000" - label temp2 "CPU 1 Core 1" - label temp3 "CPU 1 Core 2" - label temp4 "CPU 1 Core 3" - label temp5 "CPU 1 Core 4" - label temp6 "CPU 1 Core 5" - label temp7 "CPU 1 Core 6" - -#config for coretemp 2 -chip "coretemp-isa-0001" - label temp2 "CPU 2 Core 1" - label temp3 "CPU 2 Core 2" - label temp4 "CPU 2 Core 3" - label temp5 "CPU 2 Core 4" - label temp6 "CPU 2 Core 5" - label temp7 "CPU 2 Core 6" - -#config for intel5500 -chip "intel5500-pci-00a3" - label temp1 "Chipset" - -#config for DIMM's -chip "jc42-i2c-0-1a" - label temp1 "DIMM A Temp" - -chip "jc42-i2c-0-18" - label temp1 "DIMM B Temp" - -chip "jc42-i2c-0-1c" - label temp1 "DIMM C Temp" From c381db5ee74bf2f3a559020313dc32cd8ff5f31f Mon Sep 17 00:00:00 2001 From: Sergei Bulatov Date: Sat, 4 Mar 2023 08:15:51 +0700 Subject: [PATCH 042/116] add intel5500 temp --- configs/SuperMicro/X8DTL-I.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configs/SuperMicro/X8DTL-I.conf b/configs/SuperMicro/X8DTL-I.conf index 8be5258a..1cc426be 100644 --- a/configs/SuperMicro/X8DTL-I.conf +++ b/configs/SuperMicro/X8DTL-I.conf @@ -77,3 +77,7 @@ chip "w83795adg-i2c-0-2f" set fan4_min 700 set fan5_min 700 set fan6_min 700 + +#config for intel5500 +chip "intel5500-pci-00a3" + label temp1 "Chipset" From 03f637a8119e4dd701dd140d2ec63586b4d15ee7 Mon Sep 17 00:00:00 2001 From: Sergei Bulatov Date: Tue, 14 Mar 2023 22:15:57 +0700 Subject: [PATCH 043/116] release --- configs/SuperMicro/X8DTL-I.conf | 46 ++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/configs/SuperMicro/X8DTL-I.conf b/configs/SuperMicro/X8DTL-I.conf index 1cc426be..b6c17a39 100644 --- a/configs/SuperMicro/X8DTL-I.conf +++ b/configs/SuperMicro/X8DTL-I.conf @@ -1,11 +1,14 @@ # Config for a Supermicro X8DTL-I -# Authors: Steve-Tech, renardein +# Sensors guessed from HWiNFO +# Originally written by Steve-Tech and renardein # Based on Supremicro X8DTN, C7X58 and HP N40L configurations # Also compatible with all X8DTL-* motherboards -# Created: 3 March 2023 +# 2 March 2023 # Modules: # w83795 +# coretemp +# jc42 # Board has two sensor chips, w83627dhg is not used for temperature, # fans or voltage sensing. sensors-detect will suggest that you load the @@ -44,7 +47,6 @@ chip "w83795adg-i2c-0-2f" compute in5 @*4, @/4 compute in6 @*6.62, @/6.62 compute in7 -@*8, -@/8 - # Voltage Limits # CPU set in0_min 0.82 @@ -53,9 +55,9 @@ chip "w83795adg-i2c-0-2f" set in1_max 1.35 #DIMM set in2_min 1.35 - set in2_max 1.5 + set in2_max 1.55 set in3_min 1.35 - set in3_max 1.5 + set in3_max 1.55 #+3.3V set in12_min 3.135 set in12_max 3.465 @@ -68,8 +70,11 @@ chip "w83795adg-i2c-0-2f" set in6_min 11.400 set in6_max 12.600 set in7_min 10.800 - set in7_max 13.200 - + set in7_max 13.200 + #VTT Fix + # The BIOS does not set the correct limits for VTT, but it is wired. + set in11_min 1.00 + set in11_max 1.25 #FAN Limits set fan1_min 700 set fan2_min 700 @@ -78,6 +83,33 @@ chip "w83795adg-i2c-0-2f" set fan5_min 700 set fan6_min 700 +#config for coretemp 1 +chip "coretemp-isa-0000" + label temp2 "CPU 1 Core 1" + label temp3 "CPU 1 Core 2" + label temp4 "CPU 1 Core 3" + label temp5 "CPU 1 Core 4" + label temp6 "CPU 1 Core 5" + label temp7 "CPU 1 Core 6" + +#config for coretemp 2 +chip "coretemp-isa-0001" + label temp2 "CPU 2 Core 1" + label temp3 "CPU 2 Core 2" + label temp4 "CPU 2 Core 3" + label temp5 "CPU 2 Core 4" + label temp6 "CPU 2 Core 5" + label temp7 "CPU 2 Core 6" + #config for intel5500 chip "intel5500-pci-00a3" label temp1 "Chipset" +#config for DIMM's +chip "jc42-i2c-0-1a" + label temp1 "DIMM0 Temp" + +chip "jc42-i2c-0-18" + label temp1 "DIMM2 Temp" + +chip "jc42-i2c-0-1c" + label temp1 "DIMM4 Temp" \ No newline at end of file From 2568fc10734265c7e35c269fe2368a3639cf17c1 Mon Sep 17 00:00:00 2001 From: Maciej Grela Date: Sun, 26 Mar 2023 17:02:22 +0200 Subject: [PATCH 044/116] Allow configurations with MINPWM > MAXPWM These configurations would drive the PWM outputs in an "inverted mode" where the 0 value is full fan speed and 255 stops the fan. The PWM output adjustment algorithm works correctly in this situation. --- prog/pwm/fancontrol | 97 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 73 insertions(+), 24 deletions(-) diff --git a/prog/pwm/fancontrol b/prog/pwm/fancontrol index 886a7367..94e3bc48 100755 --- a/prog/pwm/fancontrol +++ b/prog/pwm/fancontrol @@ -118,30 +118,79 @@ function LoadConfig echo "MINTEMP must be less than MAXTEMP" >&2 exit 1 fi - if [ "${AFCMAXPWM[$fcvcount]}" -gt 255 ] - then - echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 - echo "MAXPWM must be at most 255" >&2 - exit 1 - fi - if [ "${AFCMINSTOP[$fcvcount]}" -ge "${AFCMAXPWM[$fcvcount]}" ] - then - echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 - echo "MINSTOP must be less than MAXPWM" >&2 - exit 1 - fi - if [ "${AFCMINSTOP[$fcvcount]}" -lt "${AFCMINPWM[$fcvcount]}" ] - then - echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 - echo "MINSTOP must be greater than or equal to MINPWM" >&2 - exit 1 - fi - if [ "${AFCMINPWM[$fcvcount]}" -lt 0 ] - then - echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 - echo "MINPWM must be at least 0" >&2 - exit 1 - fi + + if [ "${AFCMINPWM[$fvcount]}" -lt "${AFCMAXPWM[$fvcount]}" ]; then + # Normal drive: + # PWM value 0 -> Fan not spinning + # PWM value 255 -> Fan spinning at full speed + + if [ "${AFCMAXPWM[$fcvcount]}" -gt $MAX ] + then + echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 + echo "For normal drive MAXPWM must be at most $MAX" >&2 + exit 1 + fi + + if [ "${AFCMINSTOP[$fcvcount]}" -ge "${AFCMAXPWM[$fcvcount]}" ] + then + echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 + echo "For normal drive MINSTOP must be less than MAXPWM" >&2 + exit 1 + fi + + if [ "${AFCMINSTOP[$fcvcount]}" -lt "${AFCMINPWM[$fcvcount]}" ] + then + echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 + echo "For normal drive MINSTOP must be greater than or equal to MINPWM" >&2 + exit 1 + fi + + if [ "${AFCMINPWM[$fcvcount]}" -lt 0 ] + then + echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 + echo "For normal drive MINPWM must be at least 0" >&2 + exit 1 + fi + + elif [ "${AFCMINPWM[$fvcount]}" -gt "${AFCMAXPWM[$fvcount]}" ]; then + # Inverted drive: + # PWM value 255 -> Fan not spinning + # PWM value 0 -> Fan spinning at full speed + + if [ "${AFCMINPWM[$fcvcount]}" -gt $MAX ] + then + echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 + echo "For inverted drive MINPWM must be at most $MAX" >&2 + exit 1 + fi + + if [ "${AFCMINSTOP[$fcvcount]}" -lt "${AFCMAXPWM[$fcvcount]}" ] + then + echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 + echo "For inverted drive MINSTOP must be larger than MAXPWM" >&2 + exit 1 + fi + + if [ "${AFCMINSTOP[$fcvcount]}" -ge "${AFCMINPWM[$fcvcount]}" ] + then + echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 + echo "For inverted drive MINSTOP must be less than MINPWM" >&2 + exit 1 + fi + + if [ "${AFCMAXPWM[$fcvcount]}" -lt 0 ] + then + echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 + echo "For inverted drive MAXPWM must be at least 0" >&2 + exit 1 + fi + + else + echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 + echo "MINPWM and MAXPWM cannot be equal" >&2 + exit 1 + fi + if [ "${AFCAVERAGE[$fcvcount]}" -lt 1 ] then echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 From 315f2c22f0d1f4d6bee32064633b2883f3fc2a20 Mon Sep 17 00:00:00 2001 From: Maciej Grela Date: Sun, 26 Mar 2023 17:21:10 +0200 Subject: [PATCH 045/116] New configuration for Netgear RN3138 / RNR-4B NAS - Labels, expressions and settings for most power rails - Labels for fans - Labels for temperature sensors --- configs/Netgear/RN3138.conf | 95 +++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 configs/Netgear/RN3138.conf diff --git a/configs/Netgear/RN3138.conf b/configs/Netgear/RN3138.conf new file mode 100644 index 00000000..5b358179 --- /dev/null +++ b/configs/Netgear/RN3138.conf @@ -0,0 +1,95 @@ +# Configuration for the Netgear RN3138 / RNR-4B NAS +# +# Chassis identification labels: +# NETGEAR Advanced Network Storage Model No. RNR-4B +# Model Name: RN3138 +# +# Identification from DMI: +# dmidecode -s system-manufacturer: NETGEAR +# dmidecode -s system-product-name: ReadyNAS 3138 +# dmidecode -s system-version: 03/05/2015 ReadyNAS 3130 V0.9 +# dmidecode -s system-sku-number: RN3138 +# +# BIOS: +# +# dmidecode -s bios-version: 5.6.5 +# dmidecode -s bios-release-date: 03/05/2015 +# +# Monitoring chipset +# Chip: IT8732F +# Driver: it87 +# + +chip "it8732-isa-*" + + ### Voltage sense + ### The labels and equations reverse-engineered by measuring voltages on the board, finding + ### voltage dividers and comparing the voltages to what is reported in the BIOS. + ### + ### No datasheet for IT8732F has been discovered so its unknown what the recommended wiring is. + ### VIN[0-7] pinout has been taken from IT8782F datasheet it seems to match. + + # These go straight to the IT8732F, confirmed in BIOS Setup + label in0 "Vcore" + label in1 "DDR 1.5V" + + # These looks to be a second 3.3V input with a 10k/20k divider + label in2 "+3.3V_2" + compute in2 @*((10/20)+1), @/((10/20)+1) + + # in3 is labeled as +3.3V by the it87 driver, supposedly wired internally inside the chip + # The reported value is halved + compute in3 @*2, @/2 + + # Resistors could not be reverse engineered from the board, a simple scaling factor was calculated + label in4 "+12V" + compute in4 @*6.59, @/6.59 + + # in5 and in6 are unknown, one of them is most likely the +5V rail but the +5V divider voltage + # and the measured voltages do not match. + # Specifically, the +5V divider outputs 1.86V but in5 reads 1.44V and in6 reads 2.78V + + # in7 is labeled as 3VSB by the it87 driver + # The reported value is halved + compute in7 @*2, @/2 + + # in8 is labeled as Vbat by the it87 driver, probably wired internally inside the chip + # The reported value looks to be nonsense as it reports 1.6V without a battery inserted. + # Ignore for now + ignore in8 + + # Establish a 10% tolerance range for alarms + set in0_min 1.0 * 0.95 + set in0_max 1.0 * 1.05 + set in1_min 1.5 * 0.95 + set in1_max 1.5 * 1.05 + set in2_min 3.3 * 0.95 + set in2_max 3.3 * 1.05 + set in3_min 3.3 * 0.95 + set in3_max 3.3 * 1.05 + set in4_min 12 * 0.95 + set in4_max 12 * 1.05 + + set in7_min 3.3 * 0.95 + set in7_max 3.3 * 1.05 + + + ### Temperatures + ### The BIOS reports only one temperature sensors and labels it "System temperature3", it's obviously temp3 + ### Other temp inputs are not wired + ignore temp1 + ignore temp2 + label temp3 "System temperature" + + set temp3_max 50 + + + ### + ### System contains only chassis fans, confirmed in BIOS + ### The RPM reported for PWM value of 128 is around 5500 RPM + label fan1 "Chassis fan 1" + label fan2 "Chassis fan 2" + label fan3 "Chassis fan 3" + + # Not wired + ignore intrusion0 From ecb97792434a8a599718e62630ce84c731b12e2b Mon Sep 17 00:00:00 2001 From: Camille019 Date: Sat, 1 Apr 2023 17:01:14 +0200 Subject: [PATCH 046/116] Fix sensors.conf syntax documentation Removes an extra third NAME in the bus syntax description to match the Bus statement documentation and implementation. --- lib/sensors.conf.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sensors.conf.5 b/lib/sensors.conf.5 index 843a2113..eaf1b25e 100644 --- a/lib/sensors.conf.5 +++ b/lib/sensors.conf.5 @@ -465,7 +465,7 @@ or .RS bus -.B NAME NAME NAME +.B NAME NAME .sp 0 chip .B NAME\-LIST From 61981134ed61248ec06479bc8d3ad329e1cf3bc9 Mon Sep 17 00:00:00 2001 From: Maciej Grela Date: Wed, 5 Apr 2023 11:41:27 +0200 Subject: [PATCH 047/116] Netgear RN3138: Add one of the missing chassis labels --- configs/Netgear/RN3138.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/Netgear/RN3138.conf b/configs/Netgear/RN3138.conf index 5b358179..b19d7d12 100644 --- a/configs/Netgear/RN3138.conf +++ b/configs/Netgear/RN3138.conf @@ -2,6 +2,7 @@ # # Chassis identification labels: # NETGEAR Advanced Network Storage Model No. RNR-4B +# NETGEAR RN3184E-100NES # Model Name: RN3138 # # Identification from DMI: From d6dced050369e62bfd4909cad520cd4918739b50 Mon Sep 17 00:00:00 2001 From: xloem <0xloem@gmail.com> Date: Sat, 29 Apr 2023 17:25:21 -0400 Subject: [PATCH 048/116] fancontrol: Executable commands as temp sensors. --- prog/pwm/fancontrol | 22 ++++++++++++++++++---- prog/pwm/fancontrol.8 | 4 +++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/prog/pwm/fancontrol b/prog/pwm/fancontrol index 886a7367..0e1e9d79 100755 --- a/prog/pwm/fancontrol +++ b/prog/pwm/fancontrol @@ -297,10 +297,19 @@ function CheckFiles while (( $fcvcount < ${#AFCTEMP[@]} )) # go through all temp inputs do tsen=${AFCTEMP[$fcvcount]} - if [ ! -r $tsen ] + if [ ${tsen::1} == "!" ] then - echo "Error: file $tsen doesn't exist or isn't readable" >&2 - outdated=1 + if ! [ -x ${tsen:1} ] + then + echo "Error: file ${tsen:1} doesn't exist or isn't executable" >&2 + outdated=1 + fi + else + if ! [ -r $tsen ] + then + echo "Error: file $tsen doesn't exist or isn't readable" >&2 + outdated=1 + fi fi let fcvcount=$fcvcount+1 done @@ -541,7 +550,12 @@ function UpdateFanSpeeds maxpwm=${AFCMAXPWM[$fcvcount]} avg=${AFCAVERAGE[$fcvcount]} - read tlastval < ${tsens} + if [ ${tsens::1} == "!" ] + then + tlastval="$(${tsens:1})" + else + read tlastval < ${tsens} + fi if [ $? -ne 0 ] then echo "Error reading temperature from $DIR/$tsens" diff --git a/prog/pwm/fancontrol.8 b/prog/pwm/fancontrol.8 index 43325903..48190bc2 100644 --- a/prog/pwm/fancontrol.8 +++ b/prog/pwm/fancontrol.8 @@ -49,7 +49,9 @@ the configuration file is still up-to-date. .B FCTEMPS Maps PWM outputs to temperature sensors so \fBfancontrol\fP knows which temperature sensors should be used for calculation of new values for -the corresponding PWM outputs. +the corresponding PWM outputs. A prefix of ! can be used to execute a +command as a temperature sensor. + .TP .B FCFANS Records the association between a PWM output and a fan input. From e5e053bbb72681e16560cfe9d1f24bf8e63e522e Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Mon, 8 May 2023 14:38:41 +0800 Subject: [PATCH 049/116] libsensors: Avoid non-symlink sysfs device entries Devices under the MMC / SDIO bus have a "device" entry that is not a symbolic link; instead it contains the device ID of the SDIO device. This causes the sysfs parsing code in libsensors to error out, as it expects all "device" entries be symbolic links to the underlying device. Check for non-symlink entries before calling realpath() to avoid using it as a valid device link. Signed-off-by: Chen-Yu Tsai --- lib/sysfs.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index 9516cec4..ad8f1696 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -700,6 +700,26 @@ static int classify_device(const char *dev_name, return ret; } +/* realpath(3) that returns NULL for a path that isn't a symlink. + This is needed to deal with devices that have a "device" sysfs + entry that has the device ID, such as SDIO devices. */ +static char* realpath_no_symlink(const char *restrict path, + char *restrict resolved_path) +{ + struct stat st; + int ret; + + if (lstat(path, &st) < 0) + return NULL; + + if (!S_ISLNK(st.st_mode)) { + errno = -EINVAL; + return NULL; + } + + return realpath(path, resolved_path); +} + static int find_bus_type(const char *dev_path, const char *dev_name, sensors_chip_features *entry) @@ -740,7 +760,7 @@ static int find_bus_type(const char *dev_path, if (!ret) { snprintf(linkpath, NAME_MAX, "%s/device", my_dev_path); free(my_dev_path); - my_dev_path = realpath(linkpath, NULL); + my_dev_path = realpath_no_symlink(linkpath, NULL); if (my_dev_path != NULL) dev_name = strrchr(my_dev_path, '/') + 1; else if (errno == ENOMEM) @@ -838,7 +858,7 @@ static int sensors_add_hwmon_device(const char *path, const char *classdev) (void)classdev; /* hide warning */ snprintf(linkpath, NAME_MAX, "%s/device", path); - dev_path = realpath(linkpath, NULL); + dev_path = realpath_no_symlink(linkpath, NULL); if (dev_path == NULL) { if (errno == ENOMEM) { sensors_fatal_error(__func__, "Out of memory"); From c3ce1320aac25604a4b1c3a74a2862d6343f0227 Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Mon, 8 May 2023 15:03:26 +0800 Subject: [PATCH 050/116] libsensors: Add support for SENSORS_BUS_TYPE_SDIO Some SDIO drivers, namely WiFi adapter drivers, include hwmon support. Add support for parsing the device name, so they don't get treated as platform / virtual devices. Signed-off-by: Chen-Yu Tsai --- lib/access.c | 2 ++ lib/data.c | 6 ++++++ lib/sensors.h | 1 + lib/sysfs.c | 7 +++++++ 4 files changed, 16 insertions(+) diff --git a/lib/access.c b/lib/access.c index c9124339..997814e5 100644 --- a/lib/access.c +++ b/lib/access.c @@ -371,6 +371,8 @@ const char *sensors_get_adapter_name(const sensors_bus_id *bus) return "MDIO adapter"; case SENSORS_BUS_TYPE_SCSI: return "SCSI adapter"; + case SENSORS_BUS_TYPE_SDIO: + return "SDIO adapter"; } /* bus types with several instances */ diff --git a/lib/data.c b/lib/data.c index c5aea429..a8fd6b6d 100644 --- a/lib/data.c +++ b/lib/data.c @@ -127,6 +127,8 @@ int sensors_parse_chip_name(const char *name, sensors_chip_name *res) res->bus.type = SENSORS_BUS_TYPE_MDIO; else if (!strncmp(name, "scsi", dash - name)) res->bus.type = SENSORS_BUS_TYPE_SCSI; + else if (!strncmp(name, "sdio", dash - name)) + res->bus.type = SENSORS_BUS_TYPE_SDIO; else goto ERROR; name = dash + 1; @@ -204,6 +206,10 @@ int sensors_snprintf_chip_name(char *str, size_t size, case SENSORS_BUS_TYPE_SCSI: return snprintf(str, size, "%s-scsi-%hd-%x", chip->prefix, chip->bus.nr, chip->addr); + case SENSORS_BUS_TYPE_SDIO: + return snprintf(str, size, "%s-sdio-%x:%04x:%x", chip->prefix, + chip->bus.nr, (chip->addr >> 3), + (chip->addr & 0x7)); } return -SENSORS_ERR_CHIP_NAME; diff --git a/lib/sensors.h b/lib/sensors.h index 94f6f230..777eeb2a 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -46,6 +46,7 @@ #define SENSORS_BUS_TYPE_HID 6 #define SENSORS_BUS_TYPE_MDIO 7 #define SENSORS_BUS_TYPE_SCSI 8 +#define SENSORS_BUS_TYPE_SDIO 9 #define SENSORS_BUS_NR_ANY (-1) #define SENSORS_BUS_NR_IGNORE (-2) diff --git a/lib/sysfs.c b/lib/sysfs.c index ad8f1696..f46a6cc3 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -692,6 +692,13 @@ static int classify_device(const char *dev_name, entry->chip.addr = (bus << 8) + (slot << 4) + fn; entry->chip.bus.type = SENSORS_BUS_TYPE_SCSI; entry->chip.bus.nr = domain; + } else + if (subsys && !strcmp(subsys, "sdio") && + sscanf(dev_name, "mmc%hx:%x:%x", &entry->chip.bus.nr, &slot, &fn) == 3) { + /* mmc host(bus), address, function */ + /* adapter(host), channel(bus), id(target), lun */ + entry->chip.addr = (slot << 3) + fn; + entry->chip.bus.type = SENSORS_BUS_TYPE_SDIO; } else { /* Unknown device */ ret = 0; From 88eeffcb50a6c83073fdc8e8982e37f135adcbd1 Mon Sep 17 00:00:00 2001 From: Miigon Date: Wed, 14 Jun 2023 08:33:58 +0800 Subject: [PATCH 051/116] pwmconfig: change usage of 'egrep' to 'grep -E' GNU grep warns 'egrep' as obsolescent since grep-3.8 --- prog/pwm/pwmconfig | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index edcbde9e..fed43c0b 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -642,17 +642,17 @@ function LoadConfig() fi echo "Loading configuration from $1 ..." - INTERVAL=$(egrep '^INTERVAL=.*$' $1 | sed -e 's/INTERVAL= *//g') - OLD_DEVPATH=$(egrep '^DEVPATH=.*$' $1 | sed -e 's/DEVPATH= *//g') - OLD_DEVNAME=$(egrep '^DEVNAME=.*$' $1 | sed -e 's/DEVNAME= *//g') - FCTEMPS=$(egrep '^FCTEMPS=.*$' $1 | sed -e 's/FCTEMPS= *//g') - FCFANS=$(egrep '^FCFANS=.*$' $1 | sed -e 's/FCFANS= *//g') - MINTEMP=$(egrep '^MINTEMP=.*$' $1 | sed -e 's/MINTEMP= *//g') - MAXTEMP=$(egrep '^MAXTEMP=.*$' $1 | sed -e 's/MAXTEMP= *//g') - MINSTART=$(egrep '^MINSTART=.*$' $1 | sed -e 's/MINSTART= *//g') - MINSTOP=$(egrep '^MINSTOP=.*$' $1 | sed -e 's/MINSTOP= *//g') - MINPWM=$(egrep '^MINPWM=.*$' $1 | sed -e 's/MINPWM= *//g') - MAXPWM=$(egrep '^MAXPWM=.*$' $1 | sed -e 's/MAXPWM= *//g') + INTERVAL=$(grep -E '^INTERVAL=.*$' $1 | sed -e 's/INTERVAL= *//g') + OLD_DEVPATH=$(grep -E '^DEVPATH=.*$' $1 | sed -e 's/DEVPATH= *//g') + OLD_DEVNAME=$(grep -E '^DEVNAME=.*$' $1 | sed -e 's/DEVNAME= *//g') + FCTEMPS=$(grep -E '^FCTEMPS=.*$' $1 | sed -e 's/FCTEMPS= *//g') + FCFANS=$(grep -E '^FCFANS=.*$' $1 | sed -e 's/FCFANS= *//g') + MINTEMP=$(grep -E '^MINTEMP=.*$' $1 | sed -e 's/MINTEMP= *//g') + MAXTEMP=$(grep -E '^MAXTEMP=.*$' $1 | sed -e 's/MAXTEMP= *//g') + MINSTART=$(grep -E '^MINSTART=.*$' $1 | sed -e 's/MINSTART= *//g') + MINSTOP=$(grep -E '^MINSTOP=.*$' $1 | sed -e 's/MINSTOP= *//g') + MINPWM=$(grep -E '^MINPWM=.*$' $1 | sed -e 's/MINPWM= *//g') + MAXPWM=$(grep -E '^MAXPWM=.*$' $1 | sed -e 's/MAXPWM= *//g') # Check for configuration change if ! ValidateDevices "$OLD_DEVPATH" "$OLD_DEVNAME" @@ -831,7 +831,7 @@ DEFMINSTOP=100 function filter_cfgvar() { echo "$1" | sed -e 's/ /\n/g' \ - | egrep "$2" \ + | grep -E "$2" \ | sed -e 's/.*=//g' } @@ -877,7 +877,7 @@ select pwms in $pwmactive "Change INTERVAL" "Just quit" "Save and quit" "Show co echo break ;; - "$(echo ${pwmactive} |sed -e 's/ /\n/g' | egrep "${pwms}")" ) + "$(echo ${pwmactive} |sed -e 's/ /\n/g' | grep -E "${pwms}")" ) pwmsed=$(echo ${pwms} | sed -e 's/\//\\\//g') #escape / for sed echo From 7e97220c2fc4cf130f070b10d39d665672105dc2 Mon Sep 17 00:00:00 2001 From: Alexander Kruppa Date: Sun, 20 Aug 2023 17:10:22 +0200 Subject: [PATCH 052/116] Config for ASRock B550 Steel Legend --- configs/ASRock/B550-Steel-Legend.conf | 129 ++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 configs/ASRock/B550-Steel-Legend.conf diff --git a/configs/ASRock/B550-Steel-Legend.conf b/configs/ASRock/B550-Steel-Legend.conf new file mode 100644 index 00000000..a27891b3 --- /dev/null +++ b/configs/ASRock/B550-Steel-Legend.conf @@ -0,0 +1,129 @@ +# +# B550_Steel_Legend.conf +# lm-sensors configuration file for ASRock B550 Steel Legend motherboards. +# +# Vendor website: https://www.asrock.com/mb/AMD/B550%20Steel%20Legend/index.asp +# +# dmidecode: +# Manufacturer: ASRock +# Product Name: B550 Steel Legend +# dmesg: nct6775: Found NCT6798D or compatible chip at 0x2e:0x290 +# + +# Nuvoton NCT6796D-E super IO chip (recognized diffently by lm-sensors) -> driver nct6775 needs to be loaded +chip "nct6798-isa-*" + + # 1. voltages + # "SIO1_V" at register 0x80 in B550STLLGD.xml. Uses resistors 1,1 + # Long description: "Vcore Voltage" + label in0 "CPU Vcore" + set in0_min 0.2 + set in0_max 2.1 + set in0_beep 1 + + # "P5P0_V" at register 0x81 in B550STLLGD.xml. Uses resistors 2,1 + # Long description: "+5.0V Volt." + label in1 "+5.0V" + compute in1 @*(2/1+1), @/(2/1+1) + set in1_min 5 * 0.95 + set in1_max 5 * 1.05 + set in1_beep 1 + + # No entry for register 0x82 in B550STLLGD.xml. + ignore in2 + + # "P3P3_V" at register 0x83 in B550STLLGD.xml. Uses resistors 34,34 + # Long description: "+3.3V Volt." + label in3 "+3.3V" + compute in1 @*(34/34+1), @/(34/34+1) + set in3_min 3.3 * 0.95 + set in3_max 3.3 * 1.05 + set in3_beep 1 + + # "P12_V" at register 0x84 in B550STLLGD.xml. Uses resistors 56,10 + # Long description: "+12V Volt." + label in4 "+12V" + compute in4 @*((56/10)+1)*1, @/((56/10)+1) + set in4_min 12 * 0.95 + set in4_max 12 * 1.05 + set in4_beep 1 + + # "SIO6_V" at register 0x85 in B550STLLGD.xml. Uses resistors 0,1 + # Long description: "CPU VDDCR_SOC Voltage" + label in5 "CPU VDDCR" + compute in5 @*(0/1+1), @/(0/1+1) + set in5_min 0.9 + set in5_max 1.2 + set in5_beep 1 + + # "SIO2_V" at register 0x86 in B550STLLGD.xml. Uses resistors 0,1 + # Long description: "DRAM Voltage" + label in6 "DRAM" + compute in5 @*(0/1+1), @/(0/1+1) + set in6_min 1.1 + set in6_max 1.65 + set in6_beep 1 + + ignore in7 + ignore in8 + ignore in9 + ignore in10 + + # "SIO3_V" at register 0x8b in B550STLLGD.xml. Uses resistors 3,1 + # Long description: "VPPM Voltage" + label in11 "VPPM" + compute in11 @*(3/1+1), @/(3/1+1) + set in11_min 2.0 + set in11_max 3.0 + set in11_beep 1 + + ignore in12 + + # "SIO4_V" at register 0x8d in B550STLLGD.xml. Uses resistors 0,1 + # Long description not available in B550STLLGD.xml, but the manual lists + # "1.05V_PROM_S5" as one of the monitored voltages, so it's probably + # that one. + label in13 "1.05V_PROM_S5" + compute in13 @*(0/1+1), @/(0/1+1) + set in13_min 0.9 + set in13_max 1.1 + # set in13_beep 1 + + # "SIO5_V" at register 0x8e in B550STLLGD.xml. Uses resistors 1,1 + # Long description: "CPU VDD 1.8V Voltage" + label in14 "CPU VDD 1.8V" + compute in14 @*(1/1+1), @/(1/1+1) + set in14_min 1.7 + set in14_max 1.9 + set in14_beep 1 + + # 2. fans + label fan1 "Chassis fan3" + label fan2 "CPU fan1" + set fan2_min 200 + set fan2_beep 1 + label fan3 "Chassis fan 2" + label fan4 "Chassis fan 4" + label fan5 "Chassis fan 1" + ignore fan6 + label fan7 "CPU fan 2" + label fan8 "Chassis fan 5" + + # 3. temperatures + label temp1 "Motherboard" # SYSTIN + ignore temp2 # CPUTIN + ignore temp3 # AUXTIN0 + ignore temp4 # AUXTIN1 + ignore temp5 # AUXTIN2 + ignore temp6 # AUXTIN3 + label temp7 "CPU" # PECI Agent 0 + ignore temp8 # PCH_CHIP_CPU_MAX_TEMP + ignore temp9 # PCH_CHIP_TEMP + ignore temp10 # PCH_CPU_TEMP + + # 4. other + set beep_enable 1 + ignore intrusion0 + ignore intrusion1 + +# End From e818c9b1a3bd705a19a35bbc133ca09f53c6be4e Mon Sep 17 00:00:00 2001 From: sidorsett <49516540+sidorsett@users.noreply.github.com> Date: Sun, 29 Oct 2023 15:27:37 +0100 Subject: [PATCH 053/116] New configuration for Lenovo ThinkPad X120e The file contains configuration of sensors for Lenovo ThinkPad X120e laptop. --- configs/Lenovo/ThinkPad-X120e.conf | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 configs/Lenovo/ThinkPad-X120e.conf diff --git a/configs/Lenovo/ThinkPad-X120e.conf b/configs/Lenovo/ThinkPad-X120e.conf new file mode 100644 index 00000000..a02bbd1e --- /dev/null +++ b/configs/Lenovo/ThinkPad-X120e.conf @@ -0,0 +1,34 @@ +chip "thinkpad-isa-0000" + # Fan speed is erroneously reported in revolutions per clock tick + # rather than in RPM. This formula recalculates fan speed, while + # also avoiding devision by zero when the fan is idle. + # 1350000 states for the number of 22.5 kHz clock ticks in 1 minute. + compute fan1 1350000 * (1 - ^-@) / (@ + ^-@), 1350000 * (1 - ^-@) / (@ + ^-@) + compute fan2 1350000 * (1 - ^-@) / (@ + ^-@), 1350000 * (1 - ^-@) / (@ + ^-@) + label fan1 "Fan speed" + label fan2 "Fan speed" + label temp1 "CPU temperature" + ignore temp2 + label temp3 "GPU temperature" + ignore temp4 + ignore temp5 + ignore temp6 + label temp7 "CMOS battery temperature" + ignore temp8 + +chip "acpitz-acpi-0" + label temp1 "CPU temperature" + +chip "k10temp-pci-00c3" + label temp1 "CPU temperature" + +chip "radeon-pci-0008" + label in0 "GPU voltage" + label temp1 "GPU temperature" + +chip "BAT1-acpi-0" + label in0 "Battery voltage" + +chip "drivetemp-*" + label temp1 "Storage temperature" + From aa2dbf2501879ccb2f5e0e610149f94884acd720 Mon Sep 17 00:00:00 2001 From: Fred Date: Mon, 6 Nov 2023 12:29:33 -0500 Subject: [PATCH 054/116] Allow subfeatures to be ignored too --- lib/access.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/access.c b/lib/access.c index c9124339..119a7345 100644 --- a/lib/access.c +++ b/lib/access.c @@ -221,6 +221,21 @@ static int sensors_get_ignored(const sensors_chip_name *name, return 0; } +/* Looks up whether a sub-feature should be ignored. Returns + 1 if it should be ignored, 0 if not. */ +static int subfeatures_get_ignored(const sensors_chip_name *name, + const sensors_subfeature *subfeature) +{ + const sensors_chip *chip; + int i; + + for (chip = NULL; (chip = sensors_for_all_config_chips(name, chip));) + for (i = 0; i < chip->ignores_count; i++) + if (!strcmp(subfeature->name, chip->ignores[i].name)) + return 1; + return 0; +} + /* Read the value of a subfeature of a certain chip. Note that chip should not contain wildcard values! This function will return 0 on success, and <0 on failure. */ @@ -414,7 +429,8 @@ sensors_get_all_subfeatures(const sensors_chip_name *name, if (*nr >= chip->subfeature_count) return NULL; /* end of list */ subfeature = &chip->subfeature[(*nr)++]; - if (subfeature->mapping == feature->number) + if (subfeature->mapping == feature->number && + !subfeatures_get_ignored(name, subfeature)) return subfeature; return NULL; /* end of subfeature list */ } @@ -432,7 +448,8 @@ sensors_get_subfeature(const sensors_chip_name *name, for (i = feature->first_subfeature; i < chip->subfeature_count && chip->subfeature[i].mapping == feature->number; i++) { - if (chip->subfeature[i].type == type) + if (chip->subfeature[i].type == type && + !subfeatures_get_ignored(name, &(chip->subfeature[i]))) return &chip->subfeature[i]; } return NULL; /* No such subfeature */ From dbe36869336742f8822ca8ec7e541014a5b1fdaa Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sun, 24 Dec 2023 14:23:22 +0100 Subject: [PATCH 055/116] Zotac IONITX-U: add conf extension. --- configs/Zotac/{IONITX-U => IONITX-U.conf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename configs/Zotac/{IONITX-U => IONITX-U.conf} (100%) diff --git a/configs/Zotac/IONITX-U b/configs/Zotac/IONITX-U.conf similarity index 100% rename from configs/Zotac/IONITX-U rename to configs/Zotac/IONITX-U.conf From 54efada033adff330f9c4d3b3903e8b8606ad404 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sun, 24 Dec 2023 23:17:22 +0100 Subject: [PATCH 056/116] Release version 3.6.1 Signed-off-by: Michal Suchanek --- CHANGES | 23 +++++++++++++++++++++-- doc/developers/lm_sensors.lsm | 6 +++--- prog/detect/sensors-detect | 2 +- prog/pwm/pwmconfig | 2 +- version.h | 2 +- 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 2cffb539..2e5b62e8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,27 @@ lm-sensors CHANGES file ----------------------- -git HEAD - Add PWM sensor support +3.6.1 (2023-12-24) + configs: Added a number of new configuration files + fancontrol: Add executable commands as temp sensors + pwmconfig, fancontrol: Allow read-only pwm*_enable + sensors: Handle json trailing ',' when no features are listed + Add support for rated values + Only do conversion to Fahrenheit on temperatures + sensors-detect: Add support for NCT6687D + Add support for AMD CPU Family 19h + Add support for FTS Teutates Chip + Fix the driver for Nuvoton W83677HG-I + sensord: Add support of emergency alarm + Change PIDFile path from /var/run to /run + Allow subfeatures to be ignored too + Flag allow-no-sensors added + Add support for dev_name formatted like "a000000.wifi" + Add ZSH completion for sensors and sensors-detect + Add ISA ACPI sensor driver name support + Add support for static only build + Add SDIO attached sensor support + Add PWM and frequency sensor support 3.6.0 (2019-10-18) configs: Added a number of new configuration files diff --git a/doc/developers/lm_sensors.lsm b/doc/developers/lm_sensors.lsm index 599b85e0..562b010a 100644 --- a/doc/developers/lm_sensors.lsm +++ b/doc/developers/lm_sensors.lsm @@ -1,7 +1,7 @@ Begin4 Title: lm_sensors -Version: 3.6.0 -Entered-date: 2019-10-18 +Version: 3.6.1 +Entered-date: 2023-12-24 Description: Hardware health monitoring package for Linux. It consists of a library to allow applications to read sensors data more easily, and of an example program to pretty print this data. @@ -11,6 +11,6 @@ Keywords: sensors health hardware-monitoring fan-speed Author: jdelvare@suse.de (Jean Delvare) Maintained-by: olysonek@redhat.com (OndΕ™ej LysonΔ›k) Primary-site: https://github.com - /lm-sensors/lm-sensors/archive/V3-6-0/lm-sensors-3-6-0.tar.gz + /hramrach/lm-sensors/archive/V3-6-1/lm-sensors-3-6-1.tar.gz Copying-policy: GPL/LGPL End diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 4a73e1f9..2018cc70 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -38,7 +38,7 @@ foreach ('/usr/sbin', '/usr/local/sbin', '/sbin') { ######################### use constant NO_CACHE => 1; -use constant LM_VERSION => '3.6.0+git'; +use constant LM_VERSION => '3.6.1'; use vars qw(@pci_adapters @chip_ids @ipmi_ifs @non_hwmon_chip_ids $i2c_addresses_to_scan @i2c_byte_cache %opt); diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index 87d6f051..83bc0777 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -29,7 +29,7 @@ # # -LM_VERSION='3.6.0+git' +LM_VERSION='3.6.1' PIDFILE="/var/run/fancontrol.pid" USERDIR=$(pwd) diff --git a/version.h b/version.h index 9dfb4abb..4b9b60a5 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define LM_VERSION "3.6.0+git" +#define LM_VERSION "3.6.1" From 82ca61b38a0cbddb35314f5bb2f12f5bab3bc9aa Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Mon, 25 Dec 2023 19:31:52 +0100 Subject: [PATCH 057/116] sysfs: remove unused variable Fixes: e5e053bb ("libsensors: Avoid non-symlink sysfs device entries") Signed-off-by: Michal Suchanek --- lib/sysfs.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index 3aa939a0..c6bbb2c8 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -752,7 +752,6 @@ static char* realpath_no_symlink(const char *restrict path, char *restrict resolved_path) { struct stat st; - int ret; if (lstat(path, &st) < 0) return NULL; From 79d7803c410626e988c6c457ee83885bfb20e4b3 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 26 Dec 2023 13:44:06 +0100 Subject: [PATCH 058/116] Append the "+git" post-release marker to LM_VERSION --- prog/detect/sensors-detect | 2 +- prog/pwm/pwmconfig | 2 +- version.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 2018cc70..d0f29c3b 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -38,7 +38,7 @@ foreach ('/usr/sbin', '/usr/local/sbin', '/sbin') { ######################### use constant NO_CACHE => 1; -use constant LM_VERSION => '3.6.1'; +use constant LM_VERSION => '3.6.1+git'; use vars qw(@pci_adapters @chip_ids @ipmi_ifs @non_hwmon_chip_ids $i2c_addresses_to_scan @i2c_byte_cache %opt); diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index 83bc0777..31d5a224 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -29,7 +29,7 @@ # # -LM_VERSION='3.6.1' +LM_VERSION='3.6.1+git' PIDFILE="/var/run/fancontrol.pid" USERDIR=$(pwd) diff --git a/version.h b/version.h index 4b9b60a5..664381d7 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define LM_VERSION "3.6.1" +#define LM_VERSION "3.6.1+git" From 36d976cba68dd03f100f1efb1e88efbe264888c1 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 26 Apr 2021 13:06:50 +0000 Subject: [PATCH 059/116] /var/run is deprecated Systemd now wants PID files in /run, not /var/run. Service files have been updated upstream already, but not the path used by the actual programs. Change them too so that things don't break when the /var/run symlink is eventually dropped. References: bsc#1185183 --- prog/pwm/fancontrol | 2 +- prog/pwm/pwmconfig | 2 +- prog/sensord/args.c | 4 ++-- prog/sensord/sensord.8 | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/prog/pwm/fancontrol b/prog/pwm/fancontrol index bf95e5a4..243e1a8e 100755 --- a/prog/pwm/fancontrol +++ b/prog/pwm/fancontrol @@ -38,7 +38,7 @@ # # -PIDFILE="/var/run/fancontrol.pid" +PIDFILE="/run/fancontrol.pid" #DEBUG=1 MAX=255 diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index 31d5a224..197e800c 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -30,7 +30,7 @@ # LM_VERSION='3.6.1+git' -PIDFILE="/var/run/fancontrol.pid" +PIDFILE="/run/fancontrol.pid" USERDIR=$(pwd) if [ -f "$PIDFILE" ] diff --git a/prog/sensord/args.c b/prog/sensord/args.c index 36e23865..59c01ad6 100644 --- a/prog/sensord/args.c +++ b/prog/sensord/args.c @@ -33,7 +33,7 @@ #include "version.h" struct sensord_arguments sensord_args = { - .pidFile = "/var/run/sensord.pid", + .pidFile = "/run/sensord.pid", .scanTime = 60, .logTime = 30 * 60, .rrdTime = 5 * 60, @@ -97,7 +97,7 @@ static const char *daemonSyntax = " -T, --rrd-no-average -- switch RRD in non-average mode\n" " -r, --rrd-file -- RRD file (default )\n" " -c, --config-file -- configuration file\n" - " -p, --pid-file -- PID file (default /var/run/sensord.pid)\n" + " -p, --pid-file -- PID file (default /run/sensord.pid)\n" " -f, --syslog-facility -- syslog facility to use (default local4)\n" " -g, --rrd-cgi -- output an RRD CGI script and exit\n" " -a, --load-average -- include load average in RRD file\n" diff --git a/prog/sensord/sensord.8 b/prog/sensord/sensord.8 index a300478f..bfbcc7df 100644 --- a/prog/sensord/sensord.8 +++ b/prog/sensord/sensord.8 @@ -86,7 +86,7 @@ configuration file is used. .IP "-p, --pid-file file" Specify what PID file to write; the default is to write the file -`/var/run/sensord.pid'. You should always specify an absolute path +`/run/sensord.pid'. You should always specify an absolute path here. The file is removed when the daemon exits. .IP "-f, --syslog-facility facility" Specify the From ee5a542b20d588945a5be19005e337df039fc14b Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 11 Feb 2021 14:41:45 +0000 Subject: [PATCH 060/116] pwmconfig: Further raise the fan threshold Modern 4-pin fans can have a minimum speed (PWM=0) which is still relatively high. I've seen 4500 RPM fans lower their speed to only 3500 RPM, which is 77% of the maximum speed, above our current detection threshold (3/4 or 75%). Increase the threshold to 5/6 (roughly 83%) to make sure such fans are handled properly. References: boo#1181890 Signed-off-by: Jean Delvare --- prog/pwm/pwmconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index 197e800c..5cb6cee9 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -451,7 +451,7 @@ do OS=$(echo $SPEEDS | cut -d' ' -f$count) S=$(echo $CURRENT_SPEEDS | cut -d' ' -f$count) echo " $j ... speed was $OS now $S" - let threshold=3*$OS/4 + let threshold=5*$OS/6 if [ $S -lt $threshold ] then echo " It appears that fan $j" From db241f6c6d688d1ff74cba00b1aed54623bf693e Mon Sep 17 00:00:00 2001 From: "jdelvare@suse.de" Date: Sun, 31 Jan 2016 12:30:06 +0000 Subject: [PATCH 061/116] lm_sensors-3.4.0-sensord-service-extra-args Allow passing arbitrary extra arguments to sensord. --- prog/init/sensord.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prog/init/sensord.service b/prog/init/sensord.service index af2f0ae9..34bbdde7 100644 --- a/prog/init/sensord.service +++ b/prog/init/sensord.service @@ -6,7 +6,7 @@ After=lm_sensors.service EnvironmentFile=/etc/sysconfig/sensord Type=forking PIDFile=/run/sensord.pid -ExecStart=/usr/sbin/sensord -i $INTERVAL -l $LOG_INTERVAL -f daemon +ExecStart=/usr/sbin/sensord -i $INTERVAL -l $LOG_INTERVAL -f daemon $SENSORD_ARGS [Install] WantedBy=multi-user.target From 209aab03ee54596cc417adcdc7e7ac449086871e Mon Sep 17 00:00:00 2001 From: Johannes Segitz Date: Tue, 16 Nov 2021 15:44:52 +0000 Subject: [PATCH 062/116] harden_fancontrol.service --- prog/init/fancontrol.service | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/prog/init/fancontrol.service b/prog/init/fancontrol.service index 43293141..4606d7dd 100644 --- a/prog/init/fancontrol.service +++ b/prog/init/fancontrol.service @@ -4,6 +4,15 @@ ConditionFileNotEmpty=/etc/fancontrol After=lm_sensors.service [Service] +# added automatically, for details please see +# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort +ProtectSystem=full +ProtectHome=true +ProtectHostname=true +ProtectKernelLogs=true +ProtectControlGroups=true +RestrictRealtime=true +# end of automatic additions Type=simple PIDFile=/run/fancontrol.pid ExecStart=/usr/sbin/fancontrol From 6c21643ed03144f3986b27f315fbbaa812d73f85 Mon Sep 17 00:00:00 2001 From: Johannes Segitz Date: Tue, 16 Nov 2021 15:44:52 +0000 Subject: [PATCH 063/116] harden_lm_sensors.service --- prog/init/lm_sensors.service | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/prog/init/lm_sensors.service b/prog/init/lm_sensors.service index 7d3bf808..0d772416 100644 --- a/prog/init/lm_sensors.service +++ b/prog/init/lm_sensors.service @@ -2,6 +2,15 @@ Description=Initialize hardware monitoring sensors [Service] +# added automatically, for details please see +# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort +ProtectSystem=full +ProtectHome=true +ProtectHostname=true +ProtectKernelLogs=true +ProtectControlGroups=true +RestrictRealtime=true +# end of automatic additions EnvironmentFile=/etc/sysconfig/lm_sensors Type=oneshot RemainAfterExit=yes From f9ccac7d714f7d9b50a176d29148b1076ec03675 Mon Sep 17 00:00:00 2001 From: Johannes Segitz Date: Tue, 16 Nov 2021 15:44:52 +0000 Subject: [PATCH 064/116] harden_sensord.service --- prog/init/sensord.service | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/prog/init/sensord.service b/prog/init/sensord.service index 34bbdde7..1f975de7 100644 --- a/prog/init/sensord.service +++ b/prog/init/sensord.service @@ -3,6 +3,16 @@ Description=Log hardware monitoring data After=lm_sensors.service [Service] +# added automatically, for details please see +# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort +ProtectSystem=full +ProtectHome=true +ProtectHostname=true +ProtectKernelTunables=true +ProtectKernelLogs=true +ProtectControlGroups=true +RestrictRealtime=true +# end of automatic additions EnvironmentFile=/etc/sysconfig/sensord Type=forking PIDFile=/run/sensord.pid From 43b6101bb0f49716e14beff8bbde16374b45e9af Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 26 Dec 2023 16:31:23 +0100 Subject: [PATCH 065/116] sysfs: Expand filename buffer to quiet warning The GCC heurisitc says that the buffer can overflow by 2 bytes, expand it. --- lib/sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index c6bbb2c8..8d6a5e72 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -437,11 +437,11 @@ static int sensors_compute_max_sf(void) static int sensors_get_attr_mode(const char *device, const char *attr) { - char path[NAME_MAX]; + char path[NAME_MAX + 2]; struct stat st; int mode = 0; - snprintf(path, NAME_MAX, "%s/%s", device, attr); + snprintf(path, NAME_MAX + 2, "%s/%s", device, attr); if (!stat(path, &st)) { if (st.st_mode & S_IRUSR) mode |= SENSORS_MODE_R; From aa87b54d432eb7b5a47c247291bd7cf39934219c Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 26 Dec 2023 20:54:52 +0100 Subject: [PATCH 066/116] sensors: Also avoid conversion from double to float for Fahrenheit Fixes: 868fd8d0 ("Avoid the conversions from double to float.") --- prog/sensors/chips.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index adea0aaf..1f1beaf2 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -36,7 +36,7 @@ static void scale_value(double *value, const char **prefixstr); static inline double deg_ctof(double cel) { - return cel * (9.0F / 5.0F) + 32.0F; + return cel * (9.0 / 5.0) + 32.0; } void print_chip_raw(const sensors_chip_name *name) From b76cd8a5f62ff304480c1088bd020d186d6eaee5 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 27 Dec 2023 13:05:07 +0100 Subject: [PATCH 067/116] sysfs: Specific match has to go before generic match This is not really a problem when the specific scaling factors happen to be for factors not matched by a generic match but this may not hold in general over time. Fixes: 1bd92120 ("Fill the magnitude field of dynamically generated device entries.") --- lib/sysfs.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index 8d6a5e72..d767578d 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -141,6 +141,17 @@ char sensors_sysfs_mount[NAME_MAX]; static int get_type_scaling(sensors_subfeature_type type) { + /* Multipliers for second class subfeatures + that need their own multiplier */ + switch (type) { + case SENSORS_SUBFEATURE_POWER_AVERAGE_INTERVAL: + case SENSORS_SUBFEATURE_VID: + case SENSORS_SUBFEATURE_TEMP_OFFSET: + return 1000; + default: + break; + } + /* Multipliers for subfeatures */ switch (type & 0xFF80) { case SENSORS_SUBFEATURE_IN_INPUT: @@ -157,16 +168,7 @@ int get_type_scaling(sensors_subfeature_type type) return 1000000; } - /* Multipliers for second class subfeatures - that need their own multiplier */ - switch (type) { - case SENSORS_SUBFEATURE_POWER_AVERAGE_INTERVAL: - case SENSORS_SUBFEATURE_VID: - case SENSORS_SUBFEATURE_TEMP_OFFSET: - return 1000; - default: - return 1; - } + return 1; } static From c1a1f4ff206c0e6959c3e4d6b19ba27963076d5e Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 27 Dec 2023 13:12:43 +0100 Subject: [PATCH 068/116] pwm: Move scaling factor from sensors prog to library Fixes: a6ec549e ("sensors: Add support for pwm sensors") Signed-off-by: Michal Suchanek --- lib/sysfs.c | 2 ++ prog/sensors/chips.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index d767578d..ea518560 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -148,6 +148,8 @@ int get_type_scaling(sensors_subfeature_type type) case SENSORS_SUBFEATURE_VID: case SENSORS_SUBFEATURE_TEMP_OFFSET: return 1000; + case SENSORS_SUBFEATURE_PWM_IO: + return 2.55; default: break; } diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 1f1beaf2..0fc1063a 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -783,7 +783,7 @@ static void print_chip_pwm(const sensors_chip_name *name, sfio = sensors_get_subfeature(name, feature, SENSORS_SUBFEATURE_PWM_IO); if (sfio && !get_input_value(name, sfio, &val)) - printf(" %3.0f%%", val / 2.55); + printf(" %3.0f%%", val); else printf(" N/A"); From fceeee0543ef8fa270b3ec7db376d1296f17f2e0 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 27 Dec 2023 13:40:53 +0100 Subject: [PATCH 069/116] sysfs: Multiplier 1 is the default, no need to list it. Signed-off-by: Michal Suchanek --- lib/sysfs.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index ea518560..63950d37 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -161,9 +161,6 @@ int get_type_scaling(sensors_subfeature_type type) case SENSORS_SUBFEATURE_CURR_INPUT: case SENSORS_SUBFEATURE_HUMIDITY_INPUT: return 1000; - case SENSORS_SUBFEATURE_FAN_INPUT: - case SENSORS_SUBFEATURE_PWM_IO: - return 1; case SENSORS_SUBFEATURE_POWER_AVERAGE: case SENSORS_SUBFEATURE_ENERGY_INPUT: case SENSORS_SUBFEATURE_FREQ_INPUT: From 6fa5cba2e3f744dfe981d1a9a618749c1e979091 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 27 Dec 2023 14:53:05 +0100 Subject: [PATCH 070/116] sysfs: Do not prescale frequency to MHz Add autoscaling in the output instead. Fixes: 54363271 ("libsensors + sensors: Add freq_input support") --- lib/sysfs.c | 1 - prog/sensors/chips.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index 63950d37..20e8d2a3 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -163,7 +163,6 @@ int get_type_scaling(sensors_subfeature_type type) return 1000; case SENSORS_SUBFEATURE_POWER_AVERAGE: case SENSORS_SUBFEATURE_ENERGY_INPUT: - case SENSORS_SUBFEATURE_FREQ_INPUT: return 1000000; } diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 0fc1063a..8aee8b87 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -905,6 +905,7 @@ static void print_chip_freq(const sensors_chip_name *name, const sensors_subfeature *sf; double val; char *label; + const char *unit; if (!(label = sensors_get_label(name, feature))) { fprintf(stderr, "ERROR: Can't get label of feature %s!\n", @@ -917,7 +918,8 @@ static void print_chip_freq(const sensors_chip_name *name, sf = sensors_get_subfeature(name, feature, SENSORS_SUBFEATURE_FREQ_INPUT); if (sf && get_input_value(name, sf, &val) == 0) { - printf("%4.0f %s", val, "MHz"); + scale_value(&val, &unit); + printf("%4.0f %sHz%*s", val, unit, 2 - (int)strlen(unit), ""); } else { printf(" N/A "); } From b4ab3652afb884a4c3986e9ff72f9afff0708e3a Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 26 Dec 2023 22:49:40 +0100 Subject: [PATCH 071/116] sensors: json: Fix print of sensors without values When the sensor does not provide a value something bogus is printed, print a NaN instead. Also update the output counting to also print a comman for NaNs. --- prog/sensors/chips.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 8aee8b87..c270e35f 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -97,7 +97,7 @@ void print_chip_json(const sensors_chip_name *name) "%s!\n", feature->name); continue; } - if (cnt > 0) + if (cnt++) printf(",\n"); printf(" \"%s\":{\n", label); @@ -114,22 +114,21 @@ void print_chip_json(const sensors_chip_name *name) sub->name, sensors_strerror(err)); } else { - if (subCnt > 0) + if (subCnt++) printf(",\n"); if (is_temp && fahrenheit) val = deg_ctof(val); printf(" \"%s\": %.3f", sub->name, val); - subCnt++; } } else { - printf("(%s)", label); - subCnt++; + if (subCnt++) + printf(",\n"); + printf(" \"%s\": NaN", sub->name); } } free(label); printf("\n }"); - cnt++; } if (cnt > 0) printf("\n"); From 297b050d3d3c842e00c9fd0471e9e08465f7b52f Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 27 Dec 2023 14:54:05 +0100 Subject: [PATCH 072/116] sysfs: Add function for determining feature quantity --- lib/libsensors.map | 1 + lib/sensors.h | 7 +++++ lib/sysfs.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) diff --git a/lib/libsensors.map b/lib/libsensors.map index 5e2dac03..93931491 100644 --- a/lib/libsensors.map +++ b/lib/libsensors.map @@ -15,6 +15,7 @@ global: sensors_parse_chip_name; sensors_set_value; sensors_snprintf_chip_name; + sensors_get_quantity; sensors_strerror; sensors_parse_error; sensors_parse_error_wfn; diff --git a/lib/sensors.h b/lib/sensors.h index 3a25d216..c8350295 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -269,6 +269,13 @@ typedef enum sensors_subfeature_type { SENSORS_SUBFEATURE_UNKNOWN = INT_MAX, } sensors_subfeature_type; +typedef struct sensors_quantity { + const char * quantity; + const char * unit; +} sensors_quantity; + +const sensors_quantity *sensors_get_quantity(sensors_subfeature_type) __attribute__ ((const)); + /* Data about a single chip feature (or category leader) */ struct sensors_feature { char *name; diff --git a/lib/sysfs.c b/lib/sysfs.c index 20e8d2a3..662dd039 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -169,6 +169,73 @@ int get_type_scaling(sensors_subfeature_type type) return 1; } +static sensors_quantity none = {"", ""}; +static sensors_quantity bool = {"boolean", ""}; +static sensors_quantity voltage = {"voltage", "V"}; +static sensors_quantity rpm = {"rotation speed", "RPM"}; +static sensors_quantity temperature = {"temperature", "Β°C"}; +static sensors_quantity power = {"power", "W"}; +static sensors_quantity interval = {"time interval", "s"}; +static sensors_quantity energy = {"energy", "J"}; +static sensors_quantity current = {"electric current", "A"}; +static sensors_quantity humidity = {"humidity", "%RH"}; +static sensors_quantity pwm = {"pwm", "%"}; +static sensors_quantity freq = {"frequency", "Hz"}; + +const sensors_quantity* sensors_get_quantity(sensors_subfeature_type type) +{ + /* Second class subfeatures + that need their own handling */ + switch (type) { + case SENSORS_SUBFEATURE_FAN_DIV: + case SENSORS_SUBFEATURE_FAN_PULSES: + case SENSORS_SUBFEATURE_TEMP_TYPE: + case SENSORS_SUBFEATURE_TEMP_OFFSET: + case SENSORS_SUBFEATURE_PWM_MODE: + return &none; + case SENSORS_SUBFEATURE_POWER_AVERAGE_INTERVAL: + return &interval; + case SENSORS_SUBFEATURE_PWM_FREQ: + return &freq; + default: + break; + } + + /* Generic subfeatures groups */ + switch (type & 0xFF80) { + case SENSORS_SUBFEATURE_IN_ALARM: + case SENSORS_SUBFEATURE_FAN_ALARM: + case SENSORS_SUBFEATURE_TEMP_ALARM: + case SENSORS_SUBFEATURE_POWER_AVERAGE_INTERVAL: + case SENSORS_SUBFEATURE_CURR_ALARM: + case SENSORS_SUBFEATURE_PWM_ENABLE: + case SENSORS_SUBFEATURE_INTRUSION_ALARM: + case SENSORS_SUBFEATURE_BEEP_ENABLE: + return &bool; + case SENSORS_SUBFEATURE_VID: /* reported in mV and scaled */ + case SENSORS_SUBFEATURE_IN_INPUT: + return &voltage; + case SENSORS_SUBFEATURE_FAN_INPUT: + return &rpm; + case SENSORS_SUBFEATURE_TEMP_INPUT: + return &temperature; + case SENSORS_SUBFEATURE_POWER_AVERAGE: + return &power; + case SENSORS_SUBFEATURE_ENERGY_INPUT: + return &energy; + case SENSORS_SUBFEATURE_CURR_INPUT: + return ¤t; + case SENSORS_SUBFEATURE_HUMIDITY_INPUT: + return &humidity; + case SENSORS_SUBFEATURE_PWM_IO: + return &pwm; + case SENSORS_SUBFEATURE_FREQ_INPUT: + return &freq; + } + + return &none; +} + static char *get_feature_name(sensors_feature_type ftype, char *sfname) { From fcf478016d8162bf84dcafcede85ca9777fdc128 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 27 Dec 2023 17:03:26 +0100 Subject: [PATCH 073/116] sensors: Use quantity unit to determine when to translate to fahrenheit --- prog/sensors/chips.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index c270e35f..311b1daa 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -60,7 +60,7 @@ void print_chip_raw(const sensors_chip_name *name) b = 0; while ((sub = sensors_get_all_subfeatures(name, feature, &b))) { if (sub->flags & SENSORS_MODE_R) { - is_temp = feature->type == SENSORS_FEATURE_TEMP; + is_temp = !strcmp("Β°C", sensors_get_quantity(sub->type)->unit); if ((err = sensors_get_value(name, sub->number, &val))) @@ -105,7 +105,7 @@ void print_chip_json(const sensors_chip_name *name) subCnt = 0; while ((sub = sensors_get_all_subfeatures(name, feature, &b))) { if (sub->flags & SENSORS_MODE_R) { - is_temp = feature->type == SENSORS_FEATURE_TEMP; + is_temp = !strcmp("Β°C", sensors_get_quantity(sub->type)->unit); if ((err = sensors_get_value(name, sub->number, &val))) { From 0d9ea7f031b040c9769652c8f86e97236b39f996 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 27 Dec 2023 17:02:31 +0100 Subject: [PATCH 074/116] Move temperature sensor type translation to library --- lib/sensors.h | 19 +++++++++++++++++++ prog/sensors/chips.c | 8 +------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lib/sensors.h b/lib/sensors.h index c8350295..2a84a5b3 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -276,6 +276,25 @@ typedef struct sensors_quantity { const sensors_quantity *sensors_get_quantity(sensors_subfeature_type) __attribute__ ((const)); +static inline const char *sensors_temp_type_name(int sens) +{ + /* older kernels / drivers sometimes report a beta value for + thermistors */ + if (sens > 1000) + sens = 4; + + switch (sens) { + case 0: return "disabled"; + case 1: return "CPU diode"; + case 2: return "transistor"; + case 3: return "thermal diode"; + case 4: return "thermistor"; + case 5: return "AMD AMDSI"; + case 6: return "Intel PECI"; + default: return "unknown"; + } +} + /* Data about a single chip feature (or category leader) */ struct sensors_feature { char *name; diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 311b1daa..c847db78 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -409,13 +409,7 @@ static void print_chip_temp(const sensors_chip_name *name, if (sens > 1000) sens = 4; - printf(" sensor = %s", sens == 0 ? "disabled" : - sens == 1 ? "CPU diode" : - sens == 2 ? "transistor" : - sens == 3 ? "thermal diode" : - sens == 4 ? "thermistor" : - sens == 5 ? "AMD AMDSI" : - sens == 6 ? "Intel PECI" : "unknown"); + printf(" sensor = %s", sensors_temp_type_name(sens)); } printf("\n"); } From 3764b44396da144065f28f003280f87945005aae Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 26 Dec 2023 17:22:18 +0100 Subject: [PATCH 075/116] json: Drop whitespace The json can be reformatted with jq or similar tool into desired layout. --- prog/sensors/chips.c | 16 +++++++--------- prog/sensors/main.c | 16 +++++++--------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index c847db78..272e7092 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -98,8 +98,8 @@ void print_chip_json(const sensors_chip_name *name) continue; } if (cnt++) - printf(",\n"); - printf(" \"%s\":{\n", label); + printf(","); + printf("\"%s\":{", label); b = 0; subCnt = 0; @@ -115,23 +115,21 @@ void print_chip_json(const sensors_chip_name *name) sensors_strerror(err)); } else { if (subCnt++) - printf(",\n"); + printf(","); if (is_temp && fahrenheit) val = deg_ctof(val); - printf(" \"%s\": %.3f", sub->name, val); + printf("\"%s\":%.3f", sub->name, val); } } else { if (subCnt++) - printf(",\n"); - printf(" \"%s\": NaN", sub->name); + printf(","); + printf("\"%s\":NaN", sub->name); } } free(label); - printf("\n }"); + printf("}"); } - if (cnt > 0) - printf("\n"); } static const char hyst_str[] = "hyst"; diff --git a/prog/sensors/main.c b/prog/sensors/main.c index a288afd5..a68fe446 100644 --- a/prog/sensors/main.c +++ b/prog/sensors/main.c @@ -177,24 +177,22 @@ static void do_a_print(const sensors_chip_name *name) static void do_a_json_print(const sensors_chip_name *name) { - printf(" \"%s\":{\n", sprintf_chip_name(name)); + printf("\"%s\":{", sprintf_chip_name(name)); if (!hide_adapter) { int a = 0; const char *adap = sensors_get_adapter_name(&name->bus); if (adap) { - printf(" \"Adapter\": \"%s\"", adap); + printf("\"Adapter\":\"%s\"", adap); /* only print trailing ',' if there are features to list */ if (sensors_get_features(name, &a) != NULL) { - printf(",\n"); - } else { - printf("\n"); + printf(","); } } else { fprintf(stderr, "Can't get adapter name\n"); } } print_chip_json(name); - printf(" }"); + printf("}"); } /* returns 1 on error */ @@ -229,7 +227,7 @@ static int do_the_real_work(const sensors_chip_name *match, int *err) int cnt = 0; if (do_json) - printf("{\n"); + printf("{"); chip_nr = 0; while ((chip = sensors_get_detected_chips(match, &chip_nr))) { if (do_sets) { @@ -238,7 +236,7 @@ static int do_the_real_work(const sensors_chip_name *match, int *err) } else { if (do_json) { if (cnt > 0) - printf(",\n"); + printf(","); do_a_json_print(chip); } else { do_a_print(chip); @@ -247,7 +245,7 @@ static int do_the_real_work(const sensors_chip_name *match, int *err) cnt++; } if (do_json) - printf("\n}\n"); + printf("}\n"); return cnt; } From c6c5dfcffdbec5096833f7b33d6a4097b4525ed6 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 26 Dec 2023 20:56:08 +0100 Subject: [PATCH 076/116] sensors: New json format option Using -J rather than -j gives JSON with new, hopefully more usable structure. --- prog/sensors/chips.c | 61 +++++++++++++++++++++++++++++++++++++++--- prog/sensors/main.c | 8 +++++- prog/sensors/main.h | 1 + prog/sensors/sensors.1 | 4 ++- 4 files changed, 68 insertions(+), 6 deletions(-) diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 272e7092..b66e5904 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -99,11 +99,27 @@ void print_chip_json(const sensors_chip_name *name) } if (cnt++) printf(","); - printf("\"%s\":{", label); + subCnt = 0; + if (new_json) { + printf("\"%s\":{", feature->name); + if (strcmp(label, feature->name)) { + if (subCnt++) + printf(","); + printf("\"label\":\"%s\"", label); + } + } else + printf("\"%s\":{", label); b = 0; - subCnt = 0; while ((sub = sensors_get_all_subfeatures(name, feature, &b))) { + char *fname = sub->name; + if (new_json) { + if (strlen(feature->name) < strlen(sub->name)) { + fname += strlen(feature->name); + if (*fname == '_') /* FIXME some sensors use other separator */ + fname++; + } + } if (sub->flags & SENSORS_MODE_R) { is_temp = !strcmp("Β°C", sensors_get_quantity(sub->type)->unit); @@ -118,13 +134,50 @@ void print_chip_json(const sensors_chip_name *name) printf(","); if (is_temp && fahrenheit) val = deg_ctof(val); - printf("\"%s\":%.3f", sub->name, val); + if (new_json) { + const char *unit = sensors_get_quantity(sub->type)->unit; + const char *quantity = sensors_get_quantity(sub->type)->quantity; + int quaCnt = 0; + + printf("\"%s\":{", fname); + + if (is_temp && fahrenheit) + unit = "Β°F"; + if (strrchr(quantity, ' ')) + quantity = strrchr(quantity, ' ') + 1; + + if (sub->type == SENSORS_SUBFEATURE_TEMP_TYPE) { + if (quaCnt++) + printf(","); + printf("\"label\":\"%s\"", sensors_temp_type_name(val)); + } + + if (strlen(quantity)) { + if (quaCnt++) + printf(","); + printf("\"quantity\":\"%s\"", quantity); + } + + if (strlen(unit)) { + if (quaCnt++) + printf(","); + printf("\"unit\":\"%s\"", unit); + } + + if (quaCnt++) + printf(","); + printf("\"value\":%.16g", val); + printf("}"); + + } else { + printf("\"%s\":%f", fname, val); + } } } else { if (subCnt++) printf(","); - printf("\"%s\":NaN", sub->name); + printf("\"%s\":NaN", fname); } } free(label); diff --git a/prog/sensors/main.c b/prog/sensors/main.c index a68fe446..0031eb66 100644 --- a/prog/sensors/main.c +++ b/prog/sensors/main.c @@ -42,6 +42,7 @@ #define VERSION LM_VERSION static int do_sets, do_raw, do_json, hide_adapter; +int new_json; int fahrenheit; char degstr[5]; /* store the correct string to print degrees */ @@ -296,12 +297,13 @@ int main(int argc, char *argv[]) do_raw = 0; do_json = 0; + new_json = 0; do_sets = 0; do_bus_list = 0; hide_adapter = 0; allow_no_sensors = 0; while (1) { - c = getopt_long(argc, argv, "hsvfAc:ujn", long_opts, NULL); + c = getopt_long(argc, argv, "hsvfAc:ujJn", long_opts, NULL); if (c == EOF) break; switch(c) { @@ -333,6 +335,10 @@ int main(int argc, char *argv[]) case 'j': do_json = 1; break; + case 'J': + do_json = 1; + new_json = 1; + break; case 'B': do_bus_list = 1; break; diff --git a/prog/sensors/main.h b/prog/sensors/main.h index 7b608f0c..d53f1e64 100644 --- a/prog/sensors/main.h +++ b/prog/sensors/main.h @@ -22,6 +22,7 @@ #define PROG_SENSORS_MAIN_H extern int fahrenheit; +extern int new_json; extern char degstr[5]; #endif /* PROG_SENSORS_MAIN_H */ diff --git a/prog/sensors/sensors.1 b/prog/sensors/sensors.1 index d207aa1b..67c1b97b 100644 --- a/prog/sensors/sensors.1 +++ b/prog/sensors/sensors.1 @@ -67,7 +67,9 @@ of the output by scripts. It is also useful when writing a configuration file because it shows the raw input names which must be referenced in the configuration file. .IP -j -Json output. This mode is suitable for post-processing of the output by scripts. +Json output. +.IP -J +New json output. This mode is suitable for post-processing of the output by scripts. .IP "-v, --version" Print the program version and exit. .IP "-f, --fahrenheit" From f1af9ceae214a25672a2f1f50663d0484aae203f Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Thu, 28 Dec 2023 17:19:49 +0100 Subject: [PATCH 077/116] Add test makefile target --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index f1e72258..ababa7b0 100644 --- a/Makefile +++ b/Makefile @@ -193,6 +193,11 @@ endif MANPAGES := $(LIBMAN3FILES) $(LIBMAN5FILES) $(PROGDETECTMAN8FILES) $(PROGDUMPMAN8FILES) \ $(PROGSENSORSMAN1FILES) $(PROGPWMMAN8FILES) prog/sensord/sensord.8 +check:: test + +test:: lib/test/test-scanner + cd lib/test ; ./test-scanner.pl + user :: user_install:: @echo "*** Important notes:" From 9c66c7b59e7ba840f2fc612eef20898ad4987794 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Fri, 29 Dec 2023 14:20:42 +0100 Subject: [PATCH 078/116] Remove special build rules for parser The parser can be generated warning-free, no need to suppress warnings. --- lib/Module.mk | 14 -------------- lib/conf-lex.l | 1 + 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/lib/Module.mk b/lib/Module.mk index ca25e7bb..05d5547d 100644 --- a/lib/Module.mk +++ b/lib/Module.mk @@ -94,20 +94,6 @@ $(MODULE_DIR)/conf-parse.h: $(MODULE_DIR)/conf-parse.c # Include all dependency files INCLUDEFILES += $(LIBSHOBJECTS:.lo=.ld) $(LIBSTOBJECTS:.ao=.ad) -# Special warning prevention for flex-generated files -FLEXNOWARN:=-Wno-shadow -Wno-undef -Wno-unused -Wno-missing-prototypes -Wno-sign-compare -$(MODULE_DIR)/conf-lex.ao: $(MODULE_DIR)/conf-lex.c - $(CC) $(ARCPPFLAGS) $(ARCFLAGS) $(FLEXNOWARN) -c $< -o $@ -$(MODULE_DIR)/conf-lex.lo: $(MODULE_DIR)/conf-lex.c - $(CC) $(LIBCPPFLAGS) $(LIBCFLAGS) $(FLEXNOWARN) -c $< -o $@ - -# Special warning prevention for bison-generated files -YACCNOWARN:=-Wno-undef -$(MODULE_DIR)/conf-parse.ao: $(MODULE_DIR)/conf-parse.c - $(CC) $(ARCPPFLAGS) $(ARCFLAGS) $(YACCNOWARN) -c $< -o $@ -$(MODULE_DIR)/conf-parse.lo: $(MODULE_DIR)/conf-parse.c - $(CC) $(LIBCPPFLAGS) $(LIBCFLAGS) $(YACCNOWARN) -c $< -o $@ - REMOVELIBST := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(LIBDIR)/%,$(LIB_DIR)/$(LIBSTLIBNAME)) REMOVELIBSH := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(LIBDIR)/%,$(LIB_DIR)/$(LIBSHLIBNAME)) REMOVELNSO := $(DESTDIR)$(LIBDIR)/$(LIBSHSONAME) diff --git a/lib/conf-lex.l b/lib/conf-lex.l index 43ddbd8f..fdbd2360 100644 --- a/lib/conf-lex.l +++ b/lib/conf-lex.l @@ -55,6 +55,7 @@ int sensors_yylineno; %option nodefault %option noyywrap %option nounput +%option noinput /* All states are exclusive */ From d60d6beebfcbe5a61442d1d537cc6af0fe26bda8 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Fri, 29 Dec 2023 14:49:49 +0100 Subject: [PATCH 079/116] Correct parser file dependencies The dependencies for the parser files are not correct. There is baroque irule adding header prerequisites to the parser but the parser may still fail to build. The real dependency is on conf-parse.h There is no way to tell make that a rule produces two targets, such as parse.c and parse.h. However, the dependency files are generated by a separate rule, and not as a byproduct of building the source so they can themselves have dependencies. And dependencies they do have: when the header is generated it's in lib but when the header is missing while generating dependency file it's searched in top directory, and then the file that depends on it cannot be built because the header neveer appears there. When the generated .c file is addded as prerequisite to the dependency file that should reference the header generated together with the .c file the dependency file is generated correctly with the header present. This is not easily reproducible with the current source but adding conf-lex.h generated with conf-lex.c and including it in conf-parse.c now makes both conf-lex.ad depend on conf-parse.h and conf-lex.ad on conf-lex.h making the build 100% fail. --- lib/Module.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Module.mk b/lib/Module.mk index 05d5547d..f30e4e58 100644 --- a/lib/Module.mk +++ b/lib/Module.mk @@ -85,11 +85,8 @@ $(MODULE_DIR)/$(LIBSTLIBNAME): $(LIBSTOBJECTS) $(AR) rcvs $@ $^ # Depencies for non-C sources -$(MODULE_DIR)/conf-lex.c: $(MODULE_DIR)/conf-lex.l $(MODULE_DIR)/general.h \ - $(MODULE_DIR)/data.h $(MODULE_DIR)/conf-parse.h -$(MODULE_DIR)/conf-parse.c: $(MODULE_DIR)/conf-parse.y $(MODULE_DIR)/general.h \ - $(MODULE_DIR)/data.h -$(MODULE_DIR)/conf-parse.h: $(MODULE_DIR)/conf-parse.c +$(MODULE_DIR)/conf-lex.ad: $(MODULE_DIR)/conf-parse.c +$(MODULE_DIR)/conf-lex.ld: $(MODULE_DIR)/conf-parse.c # Include all dependency files INCLUDEFILES += $(LIBSHOBJECTS:.lo=.ld) $(LIBSTOBJECTS:.ao=.ad) From c829b4c7fb8ccec9480d670ea9d2f5a04b035b45 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Fri, 29 Dec 2023 15:29:16 +0100 Subject: [PATCH 080/116] Add LDFLAGS handling similar to CFLAGS --- Makefile | 6 ++++-- lib/Module.mk | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ababa7b0..5343a501 100644 --- a/Makefile +++ b/Makefile @@ -63,8 +63,6 @@ DATADIR := $(PREFIX)/share # ZSH completion files will be installed. ZSHCOMPDIR := $(DATADIR)/zsh/site-functions -EXLDFLAGS := -Wl,-rpath,$(LIBDIR) - # You should not need to change this. It is the directory into which the # executable program files will be installed. BINDIR for programs that are # also useful for normal users, SBINDIR for programs that can only be run @@ -171,6 +169,10 @@ ARCFLAGS := $(ALL_CFLAGS) LIBCPPFLAGS := -DETCDIR="\"$(ETCDIR)\"" $(ALL_CPPFLAGS) LIBCFLAGS := -fpic -D_REENTRANT $(ALL_CFLAGS) +ALL_LDFLAGS := $(LDFLAGS) + +EXLDFLAGS := -Wl,-rpath,$(LIBDIR) $(ALL_LDFLAGS) + .PHONY: all user clean install user_install uninstall user_uninstall # Make all the default rule diff --git a/lib/Module.mk b/lib/Module.mk index f30e4e58..bcfbda75 100644 --- a/lib/Module.mk +++ b/lib/Module.mk @@ -69,7 +69,7 @@ LIBHEADERFILES := $(MODULE_DIR)/error.h $(MODULE_DIR)/sensors.h # How to create the shared library $(MODULE_DIR)/$(LIBSHLIBNAME): $(LIBSHOBJECTS) $(LIB_DIR)/libsensors.map - $(CC) -shared $(LDFLAGS) -Wl,--version-script=$(LIB_DIR)/libsensors.map -Wl,-soname,$(LIBSHSONAME) -o $@ $(LIBSHOBJECTS) -lc -lm + $(CC) -shared $(ALL_LDFLAGS) -Wl,--version-script=$(LIB_DIR)/libsensors.map -Wl,-soname,$(LIBSHSONAME) -o $@ $(LIBSHOBJECTS) -lc -lm $(MODULE_DIR)/$(LIBSHSONAME): $(MODULE_DIR)/$(LIBSHLIBNAME) $(RM) $@ From 7a4b9b98c0f986903b34456eaa90c8e71612b882 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sat, 30 Dec 2023 18:23:49 +0100 Subject: [PATCH 081/116] Correct dependencies for generated parser The parser needs to be regenerated when makefile changes --- lib/Module.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Module.mk b/lib/Module.mk index bcfbda75..a1bb575d 100644 --- a/lib/Module.mk +++ b/lib/Module.mk @@ -85,6 +85,8 @@ $(MODULE_DIR)/$(LIBSTLIBNAME): $(LIBSTOBJECTS) $(AR) rcvs $@ $^ # Depencies for non-C sources +$(MODULE_DIR)/conf-lex.c: Makefile $(MODULE_DIR)/Module.mk +$(MODULE_DIR)/conf-parse.c: Makefile $(MODULE_DIR)/Module.mk $(MODULE_DIR)/conf-lex.ad: $(MODULE_DIR)/conf-parse.c $(MODULE_DIR)/conf-lex.ld: $(MODULE_DIR)/conf-parse.c From 39d3145da9f2aa08a6d8b12e00ef20c70dcb646f Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Fri, 29 Dec 2023 20:13:33 +0100 Subject: [PATCH 082/116] test: Generate dependency files --- lib/test/Module.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/test/Module.mk b/lib/test/Module.mk index d1e953c6..6382431d 100644 --- a/lib/test/Module.mk +++ b/lib/test/Module.mk @@ -10,13 +10,17 @@ LIB_TEST_SCANNER_OBJS := \ $(LIB_DIR)/error.ao \ $(LIB_DIR)/general.ao +# Include all dependency files. We use '.rd' to indicate this will create +# executables. +INCLUDEFILES += $(LIB_TEST_SOURCES:.c=.rd) + $(LIB_TEST_DIR)/test-scanner: $(LIB_TEST_SCANNER_OBJS) $(CC) $(EXLDFLAGS) -o $@ $(LIB_TEST_SCANNER_OBJS) -Llib all-lib-test: $(LIB_TEST_TARGETS) user :: all-lib-test -$(LIB_TEST_DIR)/test-scanner.ro: $(LIB_DIR)/data.h $(LIB_DIR)/conf.h $(LIB_DIR)/conf-parse.h $(LIB_DIR)/scanner.h +$(LIB_TEST_DIR)/test-scanner.rd: $(LIB_DIR)/conf-parse.c clean-lib-test: $(RM) $(LIB_TEST_DIR)/*.rd $(LIB_TEST_DIR)/*.ro From e0efe7dc76d4a065823a304778e68afdb53f2dd8 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sat, 30 Dec 2023 12:17:58 +0100 Subject: [PATCH 083/116] Use output filename in flex invocation With stdout output file name in debuginfo is specified as . --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5343a501..a5c038a3 100644 --- a/Makefile +++ b/Makefile @@ -292,9 +292,9 @@ manhtml: $(BISON) -p sensors_yy -d $< -o $@ ifeq ($(DEBUG),1) -FLEX_FLAGS := -Psensors_yy -t -b -Cfe -8 +FLEX_FLAGS := -Psensors_yy -b -Cfe -8 else -FLEX_FLAGS := -Psensors_yy -t -Cfe -8 +FLEX_FLAGS := -Psensors_yy -Cfe -8 endif %.c: %.l @@ -302,4 +302,4 @@ endif echo "Please install $(FLEX), then run \"make clean\" and try again" ; \ false ; \ fi - $(FLEX) $(FLEX_FLAGS) $< > $@ + $(FLEX) $(FLEX_FLAGS) -o $@ $< From 10c6068b3ed5fac90d7a2bf3b76a97496632e97d Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sat, 30 Dec 2023 15:01:23 +0100 Subject: [PATCH 084/116] 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.") --- lib/data.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/data.c b/lib/data.c index a8fd6b6d..8e38f19f 100644 --- a/lib/data.c +++ b/lib/data.c @@ -84,6 +84,7 @@ int sensors_parse_chip_name(const char *name, sensors_chip_name *res) { char *dash; + memset(res, 0, sizeof(*res)); /* First, the prefix. It's either "*" or a real chip name. */ if (!strncmp(name, "*-", 2)) { res->prefix = SENSORS_CHIP_NAME_PREFIX_ANY; From 6b5a19b70867941b3841eb879ebd33e491a67c25 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Mon, 25 Dec 2023 18:45:35 +0100 Subject: [PATCH 085/116] 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 --- prog/sensord/rrd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prog/sensord/rrd.c b/prog/sensord/rrd.c index a531362b..263d89fd 100644 --- a/prog/sensord/rrd.c +++ b/prog/sensord/rrd.c @@ -299,7 +299,7 @@ int rrdInit(void) argv[argc++] = rraBuff; argv[argc] = NULL; - ret = rrd_create(argc, (char**) argv); + ret = rrd_create(argc, argv); if (ret == -1) { sensorLog(LOG_ERR, "Error creating RRD file: %s: %s", sensord_args.rrdFile, rrd_get_error()); @@ -455,7 +455,7 @@ int rrdUpdate(void) const char *argv[] = { "sensord", sensord_args.rrdFile, rrdBuff, NULL }; - if ((ret = rrd_update(3, (char **) /* WEAK */ argv))) { + if ((ret = rrd_update(3, /* WEAK */ argv))) { sensorLog(LOG_ERR, "Error updating RRD file: %s: %s", sensord_args.rrdFile, rrd_get_error()); } From 0c097bfca44f53bc59d7917e8ee3e8f3cf97e77d Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sat, 30 Dec 2023 20:40:21 +0100 Subject: [PATCH 086/116] parser: Strip trailing whitespace --- lib/conf-lex.l | 6 +++--- lib/conf-parse.y | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/conf-lex.l b/lib/conf-lex.l index fdbd2360..02c7447b 100644 --- a/lib/conf-lex.l +++ b/lib/conf-lex.l @@ -1,7 +1,7 @@ %{ /* conf-lex.l - Part of libsensors, a Linux library for reading sensor data. - Copyright (c) 1998, 1999 Frodo Looijaard + Copyright (c) 1998, 1999 Frodo Looijaard This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -245,7 +245,7 @@ ignore{BLANK}* { if (! sensors_yylval.name) sensors_fatal_error("conf-lex.l", "Allocating a new string"); - + return NAME; } @@ -296,7 +296,7 @@ ignore{BLANK}* { BEGIN(ERR); return ERROR; } - + \" { buffer_add_char("\0"); sensors_yylval.name = strdup(buffer); diff --git a/lib/conf-parse.y b/lib/conf-parse.y index 1937f544..af2e4fdb 100644 --- a/lib/conf-parse.y +++ b/lib/conf-parse.y @@ -85,7 +85,7 @@ static sensors_chip *current_chip = NULL; sensors_bus_id bus; sensors_chip_name chip; sensors_config_line line; -} +} %left '-' '+' %left '*' '/' @@ -211,13 +211,13 @@ chip_statement: CHIP chip_name_list new_el.ignores_count = new_el.ignores_max = 0; new_el.chips = $2; chip_add_el(&new_el); - current_chip = sensors_config_chips + + current_chip = sensors_config_chips + sensors_config_chips_count - 1; } ; chip_name_list: chip_name - { + { $$.fits = NULL; $$.fits_count = $$.fits_max = 0; fits_add_el(&$1,$$); @@ -227,14 +227,14 @@ chip_name_list: chip_name fits_add_el(&$2,$$); } ; - -expression: FLOAT - { $$ = malloc_expr(); - $$->data.val = $1; + +expression: FLOAT + { $$ = malloc_expr(); + $$->data.val = $1; $$->kind = sensors_kind_val; } | NAME - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->data.var = $1; $$->kind = sensors_kind_var; } @@ -243,35 +243,35 @@ expression: FLOAT $$->kind = sensors_kind_source; } | expression '+' expression - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_add; $$->data.subexpr.sub1 = $1; $$->data.subexpr.sub2 = $3; } | expression '-' expression - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_sub; $$->data.subexpr.sub1 = $1; $$->data.subexpr.sub2 = $3; } | expression '*' expression - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_multiply; $$->data.subexpr.sub1 = $1; $$->data.subexpr.sub2 = $3; } | expression '/' expression - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_divide; $$->data.subexpr.sub1 = $1; $$->data.subexpr.sub2 = $3; } | '-' expression %prec NEG - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_negate; $$->data.subexpr.sub1 = $2; @@ -280,14 +280,14 @@ expression: FLOAT | '(' expression ')' { $$ = $2; } | '^' expression - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_exp; $$->data.subexpr.sub1 = $2; $$->data.subexpr.sub2 = NULL; } | '`' expression - { $$ = malloc_expr(); + { $$ = malloc_expr(); $$->kind = sensors_kind_sub; $$->data.subexpr.op = sensors_log; $$->data.subexpr.sub1 = $2; @@ -318,7 +318,7 @@ string: NAME ; chip_name: NAME - { int res = sensors_parse_chip_name($1,&$$); + { int res = sensors_parse_chip_name($1,&$$); free($1); if (res) { sensors_yyerror("Parse error in chip name"); From 502ce051fe2a9d98e3b0416037ac7d37a9c3524e Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sat, 6 Jan 2024 22:24:13 +0100 Subject: [PATCH 087/116] sensors_temperature_type_name: New library function Decode temperature sensor type to a string. Add enum for temperature types. Signed-off-by: Michal Suchanek --- lib/data.c | 19 +++++++++++++++++++ lib/libsensors.map | 1 + lib/sensors.h | 27 ++++++++++----------------- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/lib/data.c b/lib/data.c index 8e38f19f..8e433618 100644 --- a/lib/data.c +++ b/lib/data.c @@ -292,3 +292,22 @@ int sensors_substitute_busses(void) sensors_config_chips_subst = sensors_config_chips_count; return res; } + +const char *sensors_temp_type_name(sensors_temp_type sens) +{ + /* older kernels / drivers sometimes report a beta value for + thermistors */ + if (sens > 1000) + sens = SENSORS_TEMP_THERMISTOR; + + switch (sens) { + case SENSORS_TEMP_DISABLED: return "disabled"; + case SENSORS_TEMP_CPU_DIODE: return "CPU diode"; + case SENSORS_TEMP_TRANSISTOR: return "transistor"; + case SENSORS_TEMP_THERMAL_DIODE: return "thermal diode"; + case SENSORS_TEMP_THERMISTOR: return "thermistor"; + case SENSORS_TEMP_AMD_AMDSI: return "AMD AMDSI"; + case SENSORS_TEMP_INTEL_PECI: return "Intel PECI"; + } + return "unknown"; +} diff --git a/lib/libsensors.map b/lib/libsensors.map index 93931491..75309d64 100644 --- a/lib/libsensors.map +++ b/lib/libsensors.map @@ -15,6 +15,7 @@ global: sensors_parse_chip_name; sensors_set_value; sensors_snprintf_chip_name; + sensors_temp_type_name; sensors_get_quantity; sensors_strerror; sensors_parse_error; diff --git a/lib/sensors.h b/lib/sensors.h index 2a84a5b3..65fe7154 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -276,24 +276,17 @@ typedef struct sensors_quantity { const sensors_quantity *sensors_get_quantity(sensors_subfeature_type) __attribute__ ((const)); -static inline const char *sensors_temp_type_name(int sens) -{ - /* older kernels / drivers sometimes report a beta value for - thermistors */ - if (sens > 1000) - sens = 4; +typedef enum sensors_temp_type { + SENSORS_TEMP_DISABLED, + SENSORS_TEMP_CPU_DIODE, + SENSORS_TEMP_TRANSISTOR, + SENSORS_TEMP_THERMAL_DIODE, + SENSORS_TEMP_THERMISTOR, + SENSORS_TEMP_AMD_AMDSI, + SENSORS_TEMP_INTEL_PECI, +} sensors_temp_type; - switch (sens) { - case 0: return "disabled"; - case 1: return "CPU diode"; - case 2: return "transistor"; - case 3: return "thermal diode"; - case 4: return "thermistor"; - case 5: return "AMD AMDSI"; - case 6: return "Intel PECI"; - default: return "unknown"; - } -} +const char *sensors_temp_type_name(sensors_temp_type sens); /* Data about a single chip feature (or category leader) */ struct sensors_feature { From 3bbd9758605bc198ab22d168cfcda2da1a17bbf9 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sat, 6 Jan 2024 23:02:42 +0100 Subject: [PATCH 088/116] quantity: Add enumeration type Signed-off-by: Michal Suchanek --- lib/libsensors.map | 4 ++- lib/sensors.h | 22 ++++++++++--- lib/sysfs.c | 76 ++++++++++++++++++++++++++++---------------- prog/sensors/chips.c | 8 ++--- 4 files changed, 73 insertions(+), 37 deletions(-) diff --git a/lib/libsensors.map b/lib/libsensors.map index 75309d64..d1ad8867 100644 --- a/lib/libsensors.map +++ b/lib/libsensors.map @@ -16,7 +16,9 @@ global: sensors_set_value; sensors_snprintf_chip_name; sensors_temp_type_name; - sensors_get_quantity; + sensors_get_subfeature_quantity; + sensors_get_quantity_name; + sensors_get_quantity_unit; sensors_strerror; sensors_parse_error; sensors_parse_error_wfn; diff --git a/lib/sensors.h b/lib/sensors.h index 65fe7154..010be778 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -269,12 +269,26 @@ typedef enum sensors_subfeature_type { SENSORS_SUBFEATURE_UNKNOWN = INT_MAX, } sensors_subfeature_type; -typedef struct sensors_quantity { - const char * quantity; - const char * unit; +typedef enum sensors_quantity { + SENSORS_QUANTITY_UNKNOWN, + SENSORS_QUANTITY_NONE, + SENSORS_QUANTITY_BOOL, + SENSORS_QUANTITY_VOLTAGE, + SENSORS_QUANTITY_RPM, + SENSORS_QUANTITY_TEMP, + SENSORS_QUANTITY_POWER, + SENSORS_QUANTITY_INTERVAL, + SENSORS_QUANTITY_ENERGY, + SENSORS_QUANTITY_CURRENT, + SENSORS_QUANTITY_HUMIDITY, + SENSORS_QUANTITY_PWM, + SENSORS_QUANTITY_FREQ, + SENSORS_QUANTITY_MAX = SENSORS_QUANTITY_FREQ, } sensors_quantity; -const sensors_quantity *sensors_get_quantity(sensors_subfeature_type) __attribute__ ((const)); +sensors_quantity sensors_get_subfeature_quantity(sensors_subfeature_type) __attribute__ ((const)); +const char * sensors_get_quantity_name(sensors_quantity) __attribute__ ((const)); +const char * sensors_get_quantity_unit(sensors_quantity) __attribute__ ((const)); typedef enum sensors_temp_type { SENSORS_TEMP_DISABLED, diff --git a/lib/sysfs.c b/lib/sysfs.c index 662dd039..0b795f85 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -169,20 +169,7 @@ int get_type_scaling(sensors_subfeature_type type) return 1; } -static sensors_quantity none = {"", ""}; -static sensors_quantity bool = {"boolean", ""}; -static sensors_quantity voltage = {"voltage", "V"}; -static sensors_quantity rpm = {"rotation speed", "RPM"}; -static sensors_quantity temperature = {"temperature", "Β°C"}; -static sensors_quantity power = {"power", "W"}; -static sensors_quantity interval = {"time interval", "s"}; -static sensors_quantity energy = {"energy", "J"}; -static sensors_quantity current = {"electric current", "A"}; -static sensors_quantity humidity = {"humidity", "%RH"}; -static sensors_quantity pwm = {"pwm", "%"}; -static sensors_quantity freq = {"frequency", "Hz"}; - -const sensors_quantity* sensors_get_quantity(sensors_subfeature_type type) +sensors_quantity sensors_get_subfeature_quantity(sensors_subfeature_type type) { /* Second class subfeatures that need their own handling */ @@ -192,11 +179,11 @@ const sensors_quantity* sensors_get_quantity(sensors_subfeature_type type) case SENSORS_SUBFEATURE_TEMP_TYPE: case SENSORS_SUBFEATURE_TEMP_OFFSET: case SENSORS_SUBFEATURE_PWM_MODE: - return &none; + return SENSORS_QUANTITY_NONE; case SENSORS_SUBFEATURE_POWER_AVERAGE_INTERVAL: - return &interval; + return SENSORS_QUANTITY_INTERVAL; case SENSORS_SUBFEATURE_PWM_FREQ: - return &freq; + return SENSORS_QUANTITY_FREQ; default: break; } @@ -211,29 +198,62 @@ const sensors_quantity* sensors_get_quantity(sensors_subfeature_type type) case SENSORS_SUBFEATURE_PWM_ENABLE: case SENSORS_SUBFEATURE_INTRUSION_ALARM: case SENSORS_SUBFEATURE_BEEP_ENABLE: - return &bool; + return SENSORS_QUANTITY_BOOL; case SENSORS_SUBFEATURE_VID: /* reported in mV and scaled */ case SENSORS_SUBFEATURE_IN_INPUT: - return &voltage; + return SENSORS_QUANTITY_VOLTAGE; case SENSORS_SUBFEATURE_FAN_INPUT: - return &rpm; + return SENSORS_QUANTITY_RPM; case SENSORS_SUBFEATURE_TEMP_INPUT: - return &temperature; + return SENSORS_QUANTITY_TEMP; case SENSORS_SUBFEATURE_POWER_AVERAGE: - return &power; + return SENSORS_QUANTITY_POWER; case SENSORS_SUBFEATURE_ENERGY_INPUT: - return &energy; + return SENSORS_QUANTITY_ENERGY; case SENSORS_SUBFEATURE_CURR_INPUT: - return ¤t; + return SENSORS_QUANTITY_CURRENT; case SENSORS_SUBFEATURE_HUMIDITY_INPUT: - return &humidity; + return SENSORS_QUANTITY_VOLTAGE; case SENSORS_SUBFEATURE_PWM_IO: - return &pwm; + return SENSORS_QUANTITY_PWM; case SENSORS_SUBFEATURE_FREQ_INPUT: - return &freq; + return SENSORS_QUANTITY_FREQ; } - return &none; + return SENSORS_QUANTITY_UNKNOWN; +} + +static struct { + const char * name; + const char * unit; +} quantity_names[SENSORS_QUANTITY_MAX + 1] = { + {"", ""}, + {"", ""}, + {"boolean", ""}, + {"voltage", "V"}, + {"rotation speed", "RPM"}, + {"temperature", "Β°C"}, + {"power", "W"}, + {"time interval", "s"}, + {"energy", "J"}, + {"electric current", "A"}, + {"humidity", "%RH"}, + {"pwm", "%"}, + {"frequency", "Hz"}, +}; + +const char *sensors_get_quantity_name(sensors_quantity quant) +{ + if (quant > SENSORS_QUANTITY_MAX) + return NULL; + return quantity_names[quant].name; +} + +const char *sensors_get_quantity_unit(sensors_quantity quant) +{ + if (quant > SENSORS_QUANTITY_MAX) + return NULL; + return quantity_names[quant].unit; } static diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index b66e5904..18f023ba 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -60,7 +60,7 @@ void print_chip_raw(const sensors_chip_name *name) b = 0; while ((sub = sensors_get_all_subfeatures(name, feature, &b))) { if (sub->flags & SENSORS_MODE_R) { - is_temp = !strcmp("Β°C", sensors_get_quantity(sub->type)->unit); + is_temp = sensors_get_subfeature_quantity(sub->type) == SENSORS_QUANTITY_TEMP; if ((err = sensors_get_value(name, sub->number, &val))) @@ -121,7 +121,7 @@ void print_chip_json(const sensors_chip_name *name) } } if (sub->flags & SENSORS_MODE_R) { - is_temp = !strcmp("Β°C", sensors_get_quantity(sub->type)->unit); + is_temp = sensors_get_subfeature_quantity(sub->type) == SENSORS_QUANTITY_TEMP; if ((err = sensors_get_value(name, sub->number, &val))) { @@ -135,8 +135,8 @@ void print_chip_json(const sensors_chip_name *name) if (is_temp && fahrenheit) val = deg_ctof(val); if (new_json) { - const char *unit = sensors_get_quantity(sub->type)->unit; - const char *quantity = sensors_get_quantity(sub->type)->quantity; + const char *unit = sensors_get_quantity_unit(sensors_get_subfeature_quantity(sub->type)); + const char *quantity = sensors_get_quantity_name(sensors_get_subfeature_quantity(sub->type)); int quaCnt = 0; printf("\"%s\":{", fname); From 25108fe4a49e649cb0b3053a47249977a732b5b9 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sun, 7 Jan 2024 15:55:48 +0100 Subject: [PATCH 089/116] 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. --- lib/access.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/access.c b/lib/access.c index 149ed712..96541adb 100644 --- a/lib/access.c +++ b/lib/access.c @@ -168,7 +168,7 @@ char *sensors_get_label(const sensors_chip_name *name, { char *label; const sensors_chip *chip; - char buf[PATH_MAX]; + char buf[PATH_MAX + 1] = {0}; FILE *f; int i; @@ -183,12 +183,14 @@ char *sensors_get_label(const sensors_chip_name *name, } /* No user specified label, check for a _label sysfs file */ - snprintf(buf, PATH_MAX, "%s/%s_label", name->path, feature->name); - + snprintf(buf, sizeof(buf) - 1, "%s/%s_label", name->path, feature->name); + if ((f = fopen(buf, "r"))) { - i = fread(buf, 1, sizeof(buf), f); + i = fread(buf, 1, sizeof(buf) - 1, f); fclose(f); if (i > 0) { + buf[i] = 0; /* terminate string */ + i = strlen(buf); /* strip trailing zeroes */ /* i - 1 to strip the '\n' at the end */ buf[i - 1] = 0; label = buf; From 89548dab2a6171f32ff83f71be4020fec29e4a2f Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sun, 7 Jan 2024 15:59:13 +0100 Subject: [PATCH 090/116] 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 --- lib/sysfs.c | 29 ++++++++++++++++++++++++++--- lib/sysfs.h | 2 +- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index 0b795f85..39644f11 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -136,7 +136,7 @@ static int sysfs_foreach_busdev(const char *bus_type, /****************************************************************************/ -char sensors_sysfs_mount[NAME_MAX]; +const char *sensors_sysfs_mount = "/sys"; static int get_type_scaling(sensors_subfeature_type type) @@ -730,12 +730,35 @@ exit_free: int sensors_init_sysfs(void) { struct statfs statfsbuf; + struct stat statbuf; + const char *sysfs_root_env = getenv("SENSORS_SYSFS_ROOT"); + const char *hwmon_subdir = "/class/hwmon"; + char *hwmon_path; + size_t length; + int result; + + if (sysfs_root_env) + sensors_sysfs_mount = sysfs_root_env; - snprintf(sensors_sysfs_mount, NAME_MAX, "%s", "/sys"); if (statfs(sensors_sysfs_mount, &statfsbuf) < 0 - || statfsbuf.f_type != SYSFS_MAGIC) + || statfsbuf.f_type != SYSFS_MAGIC) { + if (sysfs_root_env) + fprintf(stderr, "%s: Not a sysfs mount.\n", sensors_sysfs_mount); + else + return 0; + } + + length = strlen(sensors_sysfs_mount) + strlen(hwmon_subdir) + 1; + hwmon_path = malloc(length); + if (!hwmon_path) return 0; + snprintf(hwmon_path, length, "%s%s", sensors_sysfs_mount, hwmon_subdir); + result = !stat(hwmon_path, &statbuf) && ((statbuf.st_mode & S_IFMT) == S_IFDIR); + if (!result) + fprintf(stderr, "%s: No sensors at %s.\n", sensors_sysfs_mount, hwmon_path); + + free(hwmon_path); return 1; } diff --git a/lib/sysfs.h b/lib/sysfs.h index 3f4d83a2..7e11b4fd 100644 --- a/lib/sysfs.h +++ b/lib/sysfs.h @@ -22,7 +22,7 @@ #ifndef LIB_SENSORS_SYSFS_H #define LIB_SENSORS_SYSFS_H -extern char sensors_sysfs_mount[]; +extern const char *sensors_sysfs_mount; int sensors_init_sysfs(void); From 4bf8e37e0f98b8cb3a5ca90ebdbbc575146eb0de Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sat, 30 Dec 2023 19:39:47 +0100 Subject: [PATCH 091/116] Update API description Signed-off-by: Michal Suchanek --- doc/libsensors-API.txt | 29 +++++++++++++++++++++++++++++ lib/sensors.h | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/doc/libsensors-API.txt b/doc/libsensors-API.txt index 7832d979..52fe56dc 100644 --- a/doc/libsensors-API.txt +++ b/doc/libsensors-API.txt @@ -6,8 +6,37 @@ over time. This document summarizes these evolutions so that application authors can quickly figure out how to test for the availability of a given new feature. +0x510 lm-sensors 3.6.2 +* Added pwm scaling factor +* Added support for SDIO bus + #define SENSORS_BUS_TYPE_SDIO +* Added support for ignoring subfeatures +* Added support for frequency sensors + enum sensors_feature_type SENSORS_FEATURE_FREQ + enum sensors_subfeature_type SENSORS_SUBFEATURE_FREQ_INPUT +* Added support for min/max rating if voltage/cuttent/power + enum sensors_subfeature_type SENSORS_SUBFEATURE_IN_RATED_MIN + enum sensors_subfeature_type SENSORS_SUBFEATURE_IN_RATED_MAX + enum sensors_subfeature_type SENSORS_SUBFEATURE_POWER_RATED_MIN + enum sensors_subfeature_type SENSORS_SUBFEATURE_POWER_RATED_MAX + enum sensors_subfeature_type SENSORS_SUBFEATURE_CURR_RATED_MIN + enum sensors_subfeature_type SENSORS_SUBFEATURE_CURR_RATED_MAX +* Added support for getting subfeature quantity and units + enum sensors_quantity + function sensors_get_subfeature_quantity + functions sensors_get_quantity_name sensors_get_quantity_unit +* Added support for translating temperature sensor type + enum sensors_temp_type + function sensors_temp_type_name +* Added SENSORS_SYSFS_ROOT environment variable + 0x501 * Added support for pwm sensors + enum sensors_feature_type SENSORS_FEATURE_PWM + enum sensors_subfeature_type SENSORS_SUBFEATURE_PWM_IO + enum sensors_subfeature_type SENSORS_SUBFEATURE_PWM_FREQ + enum sensors_subfeature_type SENSORS_SUBFEATURE_PWM_ENABLE + enum sensors_subfeature_type SENSORS_SUBFEATURE_PWM_MODE 0x500 lm-sensors 3.5.0 * Added support for power min, lcrit, min_alarm and lcrit_alarm diff --git a/lib/sensors.h b/lib/sensors.h index 010be778..4360b945 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -31,7 +31,7 @@ when the API or ABI breaks), the third digit is incremented to track small API additions like new flags / enum values. The second digit is for tracking larger additions like new methods. */ -#define SENSORS_API_VERSION 0x501 +#define SENSORS_API_VERSION 0x510 #define SENSORS_CHIP_NAME_PREFIX_ANY NULL #define SENSORS_CHIP_NAME_ADDR_ANY (-1) From 5c3ba50f806dea27c3b1e368966191c735459111 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sat, 13 Jan 2024 17:03:31 +0100 Subject: [PATCH 092/116] Release version 3.6.2 --- CHANGES | 8 ++++++++ doc/developers/lm_sensors.lsm | 6 +++--- prog/detect/sensors-detect | 2 +- prog/pwm/pwmconfig | 2 +- version.h | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 2e5b62e8..f2b011dd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,13 @@ lm-sensors CHANGES file ----------------------- +3.6.2 (2024-01-13) + Move pwm scaling factor from sensors to libsensors + Add quantity and unit information for sensors + Add SENSORS_SYSFS_ROOT for reading data from different location + sensors: Add new json format with extra information + Update service files: Include hardening patches + Add extra sensord arguments from the environemnt + Fix /run support 3.6.1 (2023-12-24) configs: Added a number of new configuration files diff --git a/doc/developers/lm_sensors.lsm b/doc/developers/lm_sensors.lsm index 562b010a..560e671a 100644 --- a/doc/developers/lm_sensors.lsm +++ b/doc/developers/lm_sensors.lsm @@ -1,7 +1,7 @@ Begin4 Title: lm_sensors -Version: 3.6.1 -Entered-date: 2023-12-24 +Version: 3.6.2 +Entered-date: 2024-01-13 Description: Hardware health monitoring package for Linux. It consists of a library to allow applications to read sensors data more easily, and of an example program to pretty print this data. @@ -11,6 +11,6 @@ Keywords: sensors health hardware-monitoring fan-speed Author: jdelvare@suse.de (Jean Delvare) Maintained-by: olysonek@redhat.com (OndΕ™ej LysonΔ›k) Primary-site: https://github.com - /hramrach/lm-sensors/archive/V3-6-1/lm-sensors-3-6-1.tar.gz + /hramrach/lm-sensors/archive/V3-6-2/lm-sensors-3-6-2.tar.gz Copying-policy: GPL/LGPL End diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index d0f29c3b..69f465c9 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -38,7 +38,7 @@ foreach ('/usr/sbin', '/usr/local/sbin', '/sbin') { ######################### use constant NO_CACHE => 1; -use constant LM_VERSION => '3.6.1+git'; +use constant LM_VERSION => '3.6.2'; use vars qw(@pci_adapters @chip_ids @ipmi_ifs @non_hwmon_chip_ids $i2c_addresses_to_scan @i2c_byte_cache %opt); diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index 5cb6cee9..5b06a64a 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -29,7 +29,7 @@ # # -LM_VERSION='3.6.1+git' +LM_VERSION='3.6.2' PIDFILE="/run/fancontrol.pid" USERDIR=$(pwd) diff --git a/version.h b/version.h index 664381d7..068815e0 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define LM_VERSION "3.6.1+git" +#define LM_VERSION "3.6.2" From 0b771017be1694064993e726e770f23ec5e4c3db Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 26 Dec 2023 13:44:06 +0100 Subject: [PATCH 093/116] Append the "+git" post-release marker to LM_VERSION --- prog/detect/sensors-detect | 2 +- prog/pwm/pwmconfig | 2 +- version.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 69f465c9..f5b0705a 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -38,7 +38,7 @@ foreach ('/usr/sbin', '/usr/local/sbin', '/sbin') { ######################### use constant NO_CACHE => 1; -use constant LM_VERSION => '3.6.2'; +use constant LM_VERSION => '3.6.2+git'; use vars qw(@pci_adapters @chip_ids @ipmi_ifs @non_hwmon_chip_ids $i2c_addresses_to_scan @i2c_byte_cache %opt); diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index 5b06a64a..1ca08bcb 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -29,7 +29,7 @@ # # -LM_VERSION='3.6.2' +LM_VERSION='3.6.2+git' PIDFILE="/run/fancontrol.pid" USERDIR=$(pwd) diff --git a/version.h b/version.h index 068815e0..635978ca 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define LM_VERSION "3.6.2" +#define LM_VERSION "3.6.2+git" From 3a5737fe7ba1f6f322f2e66b03a6fa53bb05524e Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 17 Jan 2024 18:53:41 +0100 Subject: [PATCH 094/116] Rename find-driver -> sensors-find-driver --- prog/debug/{find-driver => sensors-find-driver} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename prog/debug/{find-driver => sensors-find-driver} (100%) diff --git a/prog/debug/find-driver b/prog/debug/sensors-find-driver similarity index 100% rename from prog/debug/find-driver rename to prog/debug/sensors-find-driver From 905634f182c22bd52d7847f31036da416fddc8e6 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 17 Jan 2024 18:54:14 +0100 Subject: [PATCH 095/116] sensors-find-driver: Convert README to man page --- prog/debug/README | 25 ---------- prog/debug/sensors-find-driver.1 | 83 ++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 25 deletions(-) delete mode 100644 prog/debug/README create mode 100644 prog/debug/sensors-find-driver.1 diff --git a/prog/debug/README b/prog/debug/README deleted file mode 100644 index 9e49f9fe..00000000 --- a/prog/debug/README +++ /dev/null @@ -1,25 +0,0 @@ -This directory contains tools which may help with debugging lm_sensors. - -find-driver -=========== -If the 'sensors' program does not report useful values for certain hardware -monitoring inputs, the problem in most cases is not in lm_sensors. lm_sensors -only reads values exported by the Linux kernel. Finding the driver responsible -for exporting the particular hardware monitoring chip may help to diagnose -the problem further. It is possible that there is a bug in the driver, however -it is even more likely that the input is simply not used on your board. -Nonetheless, identifying the driver may help you identify the piece of hardware -that reports the bogus value. - -This script finds the driver and kernel module responsible for exporting -a hardware monitoring chip in sysfs. It should be given the chip name (as -reported by the 'sensors' program) as argument. For example: - -$ sensors -thinkpad-isa-0000 -Adapter: ISA adapter -fan1: 0 RPM - -$ ./find-driver thinkpad-isa-0000 -Driver: thinkpad_hwmon -Module: thinkpad_acpi diff --git a/prog/debug/sensors-find-driver.1 b/prog/debug/sensors-find-driver.1 new file mode 100644 index 00000000..61ac220a --- /dev/null +++ b/prog/debug/sensors-find-driver.1 @@ -0,0 +1,83 @@ +.\" Copyright 1999 Frodo Looijaard +.\" Copyright (C) 2007-2012 Jean Delvare +.\" sensors is distributed under the GPL +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH sensors-find-driver 1 "November 2012" "lm-sensors 3" "Linux User's Manual" +.SH NAME +sensors-find-driver \- find driver corresponding to a sensor chip +.SH SYNOPSIS +.B sensors-find-driver +.I chip-name + +.SH DESCRIPTION +.B sensors-find-driver +Chip name is a string in the format +.I --
+as reported by the +.I sensors +program. For example the chip name can be +.I coretemp-isa-0000 +or +.I acpitz-virtual-0 +.P +If the +.I sensors +program does not report useful values for certain hardware +monitoring inputs, the problem in most cases is not in lm_sensors. lm_sensors +only reads values exported by the Linux kernel. Finding the driver responsible +for exporting the particular hardware monitoring chip may help to diagnose +the problem further. It is possible that there is a bug in the driver, however +it is even more likely that the input is simply not used on your board. + +Nonetheless, identifying the driver may help you identify the piece of hardware +that reports the bogus value. + +This script finds the driver and kernel module responsible for exporting +a hardware monitoring chip in sysfs. It should be given the chip name as +reported by the +.I sensors + +program as argument. For example: + +.br +$ sensors +.br +thinkpad-isa-0000 +.br +Adapter: ISA adapter +.br +fan1: 0 RPM +.br + +.br +$ sensors-find-driver thinkpad-isa-0000 +.br +Driver: thinkpad_hwmon +.br +Module: thinkpad_acpi + +.SH AUTHOR +Frodo Looijaard and the lm_sensors group +https://hwmon.wiki.kernel.org/lm_sensors + + From 9aa83ee190921e8833ecb6f98d8498ef98ff803c Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 17 Jan 2024 18:56:01 +0100 Subject: [PATCH 096/116] sensors-save: New debug tool for saving sensor data from sysfs --- prog/debug/sensors-save | 64 +++++++++++++++++++++++++++++++++++++++ prog/debug/sensors-save.1 | 50 ++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100755 prog/debug/sensors-save create mode 100644 prog/debug/sensors-save.1 diff --git a/prog/debug/sensors-save b/prog/debug/sensors-save new file mode 100755 index 00000000..59123839 --- /dev/null +++ b/prog/debug/sensors-save @@ -0,0 +1,64 @@ +#!/bin/sh + +verbose=true + +while [ "$*" != "" ] ; do + case $1 in + -q) verbose=false ; shift;; + *) break ;; + esac +done + +if [ $# -ne 1 ] ; then + echo Usage: "$0 [ -q ] target" >&2 + exit 22 +fi + +target="$1" +prefix=/sys +set -e + +set -- /class/hwmon + +while [ -n "$1" ] ; do + source="$1" ; shift + src="$prefix$source" + tgt="$target$source" + if [ -e "$tgt" ] ; then + ! $verbose || echo "$tgt already exists" + continue + fi + if [ -L "$src" ] ; then + link="$(readlink "$src")" + ! $verbose || echo "$tgt -> $link" + ln -s "$link" "$tgt" + link="/$(realpath --relative-to="$prefix" -s "$(dirname "$src")"/"$link")" + set -- "${link}" "$@" + continue + fi + if [ -d "$src" ] ; then + ! $verbose || echo "$tgt/" + mkdir -p "$tgt" + sub="$(ls -A "$src")" # cannot use a pipeline, it creates new parameter scope + while [ -n "$sub" ] ; do + x=$(echo "$sub" | head -n 1) + sub="$(echo "$sub" | tail -n +2)" + [ "$x" != autosuspend_delay_ms ] || continue # these files cause io error + set -- "$source/$x" "$@" + done + continue + fi + if [ -f "$src" ] ; then + ! $verbose || echo "$tgt" + if [ -r "$src" ] ; then + cp -a "$src" "$tgt" ||: # some files gitve i/o error even when readable + else + ! $verbose || echo "$tgt not readable" + touch --reference="$src" "$tgt" + chmod --reference="$src" "$tgt" + fi + continue + fi +done + +exit 0 diff --git a/prog/debug/sensors-save.1 b/prog/debug/sensors-save.1 new file mode 100644 index 00000000..0825f008 --- /dev/null +++ b/prog/debug/sensors-save.1 @@ -0,0 +1,50 @@ +.\" Copyright 1999 Frodo Looijaard +.\" Copyright (C) 2007-2012 Jean Delvare +.\" sensors is distributed under the GPL +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH sensors-save 1 "January 2024" "lm-sensors 3" "Linux User's Manual" +.SH NAME +sensors-save \- save sensor data +.SH SYNOPSIS +.B sensors-save [ -q ] +.I location + +.SH DESCRIPTION +.B location +directory where sensor data is saved. Saved data can then be used by specifying +.I location +in the +.I SENSORS_SYSFS_ROOT +environment variable. +.br +Saved data can be used for diagnosing problems in data interpretation and other testing. + +.SH OPTIONS +.IP "-q" +Do not print file names as they are copied. + +.SH AUTHOR +Michal SuchΓ‘nek and the lm_sensors group +https://hwmon.wiki.kernel.org/lm_sensors + + From 06bd510ef7f4e0f5e4382bcd0469d44eeba72ece Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 17 Jan 2024 18:56:57 +0100 Subject: [PATCH 097/116] Install troubleshooting tools --- Makefile | 2 +- prog/debug/Module.mk | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 prog/debug/Module.mk diff --git a/Makefile b/Makefile index a5c038a3..af301848 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ BUILD_SHARED_LIB := 1 # to do this. # The subdirectories we need to build things in -SRCDIRS := lib prog/detect prog/pwm \ +SRCDIRS := lib prog/debug prog/detect prog/pwm \ prog/sensors ${PROG_EXTRA:%=prog/%} etc # Only build isadump and isaset on x86 machines. ifneq (,$(findstring $(ARCH), i386 i486 i586 i686 x86_64)) diff --git a/prog/debug/Module.mk b/prog/debug/Module.mk new file mode 100644 index 00000000..9efc00d8 --- /dev/null +++ b/prog/debug/Module.mk @@ -0,0 +1,41 @@ +# Module.mk +# Copyright (c) 1998, 1999 Frodo Looijaard +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301 USA. + +MODULE_DIR := prog/debug +PROGDEBUGDIR := $(MODULE_DIR) + +PROGDEBUGMAN1DIR := $(MANDIR)/man1 +PROGDEBUGMAN1FILES := $(MODULE_DIR)/sensors-find-driver.1 +PROGDEBUGTARGETS := $(MODULE_DIR)/sensors-find-driver + +PROGDEBUGMAN1FILES += $(MODULE_DIR)/sensors-save.1 +PROGDEBUGTARGETS += $(MODULE_DIR)/sensors-save + +REMOVEDEBUGBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGDEBUGTARGETS)) +REMOVEDEBUGMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGDEBUGMAN1DIR)/%,$(PROGDEBUGMAN1FILES)) + +install-prog-debug: $(PROGDEBUGTARGETS) + $(MKDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(PROGDEBUGMAN1DIR) + $(INSTALL) -m 755 $(PROGDEBUGTARGETS) $(DESTDIR)$(BINDIR) + $(INSTALL) -m 644 $(PROGDEBUGMAN1FILES) $(DESTDIR)$(PROGDEBUGMAN1DIR) + +user_install :: install-prog-debug + +user_uninstall:: + $(RM) $(REMOVEDEBUGBIN) + $(RM) $(REMOVEDEBUGMAN) From 989f387a9a29fc3918426e5f08efa568742474f6 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 17 Jan 2024 19:32:42 +0100 Subject: [PATCH 098/116] tests: shellcheck the debug progs --- Makefile | 7 ++++++- prog/debug/Module.mk | 2 ++ prog/debug/sensors-find-driver | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index af301848..2e62f4fa 100644 --- a/Makefile +++ b/Makefile @@ -197,7 +197,12 @@ MANPAGES := $(LIBMAN3FILES) $(LIBMAN5FILES) $(PROGDETECTMAN8FILES) $(PROGDUMPMAN check:: test -test:: lib/test/test-scanner +test:: shellcheck test-lib + +shellcheck:: + shellcheck $(SHELLCHECKFILES) + +test-lib:: lib/test/test-scanner cd lib/test ; ./test-scanner.pl user :: diff --git a/prog/debug/Module.mk b/prog/debug/Module.mk index 9efc00d8..79cbc811 100644 --- a/prog/debug/Module.mk +++ b/prog/debug/Module.mk @@ -29,6 +29,8 @@ PROGDEBUGTARGETS += $(MODULE_DIR)/sensors-save REMOVEDEBUGBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGDEBUGTARGETS)) REMOVEDEBUGMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGDEBUGMAN1DIR)/%,$(PROGDEBUGMAN1FILES)) +SHELLCHECKFILES += $(PROGDEBUGTARGETS) + install-prog-debug: $(PROGDEBUGTARGETS) $(MKDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(PROGDEBUGMAN1DIR) $(INSTALL) -m 755 $(PROGDEBUGTARGETS) $(DESTDIR)$(BINDIR) diff --git a/prog/debug/sensors-find-driver b/prog/debug/sensors-find-driver index 0cc001d0..5f24cac6 100755 --- a/prog/debug/sensors-find-driver +++ b/prog/debug/sensors-find-driver @@ -74,7 +74,7 @@ while true; do DRIVER_DIR=$(readlink -f "$DEVICE/driver") DRIVER=$(basename "$DRIVER_DIR") if [ -L "$DRIVER_DIR/module" ]; then - MODULE=$(basename $(readlink "$DRIVER_DIR/module")) + MODULE="$(basename "$(readlink "$DRIVER_DIR/module")")" fi break elif [ -L "$DEVICE/device" ]; then From e06d99df7c1499574048bcce4da4c7dfef5b9a01 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 17 Jan 2024 19:12:57 +0100 Subject: [PATCH 099/116] tests: Add trivial json formatting test --- Makefile | 6 +- prog/sensors/test/data/laptop.f.json | 411 ++++++++++++++++++ prog/sensors/test/data/laptop.json | 411 ++++++++++++++++++ .../test/data/laptop/class/hwmon/hwmon0 | 1 + .../test/data/laptop/class/hwmon/hwmon1 | 1 + .../test/data/laptop/class/hwmon/hwmon2 | 1 + .../test/data/laptop/class/hwmon/hwmon3 | 1 + .../test/data/laptop/class/hwmon/hwmon4 | 1 + .../test/data/laptop/class/hwmon/hwmon5 | 1 + .../power_supply/ACAD/hwmon2/device | 1 + .../ACPI0003:00/power_supply/ACAD/hwmon2/name | 1 + .../power_supply/ACAD/hwmon2/power/async | 1 + .../power_supply/ACAD/hwmon2/power/control | 1 + .../ACAD/hwmon2/power/runtime_active_kids | 1 + .../ACAD/hwmon2/power/runtime_active_time | 1 + .../ACAD/hwmon2/power/runtime_enabled | 1 + .../ACAD/hwmon2/power/runtime_status | 1 + .../ACAD/hwmon2/power/runtime_suspended_time | 1 + .../ACAD/hwmon2/power/runtime_usage | 1 + .../power_supply/ACAD/hwmon2/subsystem | 1 + .../power_supply/ACAD/hwmon2/uevent | 0 .../power_supply/BAT1/hwmon0/curr1_input | 1 + .../power_supply/BAT1/hwmon0/device | 1 + .../power_supply/BAT1/hwmon0/in0_input | 1 + .../PNP0C0A:00/power_supply/BAT1/hwmon0/name | 1 + .../power_supply/BAT1/hwmon0/power/async | 1 + .../power_supply/BAT1/hwmon0/power/control | 1 + .../BAT1/hwmon0/power/runtime_active_kids | 1 + .../BAT1/hwmon0/power/runtime_active_time | 1 + .../BAT1/hwmon0/power/runtime_enabled | 1 + .../BAT1/hwmon0/power/runtime_status | 1 + .../BAT1/hwmon0/power/runtime_suspended_time | 1 + .../BAT1/hwmon0/power/runtime_usage | 1 + .../power_supply/BAT1/hwmon0/subsystem | 1 + .../power_supply/BAT1/hwmon0/uevent | 0 .../0000:01:00.0/nvme/nvme0/hwmon1/device | 1 + .../0000:01:00.0/nvme/nvme0/hwmon1/name | 1 + .../nvme/nvme0/hwmon1/power/async | 1 + .../nvme/nvme0/hwmon1/power/control | 1 + .../nvme0/hwmon1/power/runtime_active_kids | 1 + .../nvme0/hwmon1/power/runtime_active_time | 1 + .../nvme/nvme0/hwmon1/power/runtime_enabled | 1 + .../nvme/nvme0/hwmon1/power/runtime_status | 1 + .../nvme0/hwmon1/power/runtime_suspended_time | 1 + .../nvme/nvme0/hwmon1/power/runtime_usage | 1 + .../0000:01:00.0/nvme/nvme0/hwmon1/subsystem | 1 + .../nvme/nvme0/hwmon1/temp1_alarm | 1 + .../0000:01:00.0/nvme/nvme0/hwmon1/temp1_crit | 1 + .../nvme/nvme0/hwmon1/temp1_input | 1 + .../nvme/nvme0/hwmon1/temp1_label | 1 + .../0000:01:00.0/nvme/nvme0/hwmon1/temp1_max | 1 + .../0000:01:00.0/nvme/nvme0/hwmon1/temp1_min | 1 + .../0000:01:00.0/nvme/nvme0/hwmon1/uevent | 0 .../platform/coretemp.0/hwmon/hwmon4/device | 1 + .../platform/coretemp.0/hwmon/hwmon4/name | 1 + .../coretemp.0/hwmon/hwmon4/power/async | 1 + .../coretemp.0/hwmon/hwmon4/power/control | 1 + .../hwmon/hwmon4/power/runtime_active_kids | 1 + .../hwmon/hwmon4/power/runtime_active_time | 1 + .../hwmon/hwmon4/power/runtime_enabled | 1 + .../hwmon/hwmon4/power/runtime_status | 1 + .../hwmon/hwmon4/power/runtime_suspended_time | 1 + .../hwmon/hwmon4/power/runtime_usage | 1 + .../coretemp.0/hwmon/hwmon4/subsystem | 1 + .../coretemp.0/hwmon/hwmon4/temp10_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp10_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp10_input | 1 + .../coretemp.0/hwmon/hwmon4/temp10_label | 1 + .../coretemp.0/hwmon/hwmon4/temp10_max | 1 + .../coretemp.0/hwmon/hwmon4/temp11_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp11_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp11_input | 1 + .../coretemp.0/hwmon/hwmon4/temp11_label | 1 + .../coretemp.0/hwmon/hwmon4/temp11_max | 1 + .../coretemp.0/hwmon/hwmon4/temp12_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp12_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp12_input | 1 + .../coretemp.0/hwmon/hwmon4/temp12_label | 1 + .../coretemp.0/hwmon/hwmon4/temp12_max | 1 + .../coretemp.0/hwmon/hwmon4/temp13_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp13_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp13_input | 1 + .../coretemp.0/hwmon/hwmon4/temp13_label | 1 + .../coretemp.0/hwmon/hwmon4/temp13_max | 1 + .../coretemp.0/hwmon/hwmon4/temp1_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp1_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp1_input | 1 + .../coretemp.0/hwmon/hwmon4/temp1_label | 1 + .../coretemp.0/hwmon/hwmon4/temp1_max | 1 + .../coretemp.0/hwmon/hwmon4/temp2_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp2_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp2_input | 1 + .../coretemp.0/hwmon/hwmon4/temp2_label | 1 + .../coretemp.0/hwmon/hwmon4/temp2_max | 1 + .../coretemp.0/hwmon/hwmon4/temp3_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp3_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp3_input | 1 + .../coretemp.0/hwmon/hwmon4/temp3_label | 1 + .../coretemp.0/hwmon/hwmon4/temp3_max | 1 + .../coretemp.0/hwmon/hwmon4/temp4_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp4_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp4_input | 1 + .../coretemp.0/hwmon/hwmon4/temp4_label | 1 + .../coretemp.0/hwmon/hwmon4/temp4_max | 1 + .../coretemp.0/hwmon/hwmon4/temp5_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp5_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp5_input | 1 + .../coretemp.0/hwmon/hwmon4/temp5_label | 1 + .../coretemp.0/hwmon/hwmon4/temp5_max | 1 + .../coretemp.0/hwmon/hwmon4/temp6_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp6_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp6_input | 1 + .../coretemp.0/hwmon/hwmon4/temp6_label | 1 + .../coretemp.0/hwmon/hwmon4/temp6_max | 1 + .../coretemp.0/hwmon/hwmon4/temp7_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp7_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp7_input | 1 + .../coretemp.0/hwmon/hwmon4/temp7_label | 1 + .../coretemp.0/hwmon/hwmon4/temp7_max | 1 + .../coretemp.0/hwmon/hwmon4/temp8_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp8_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp8_input | 1 + .../coretemp.0/hwmon/hwmon4/temp8_label | 1 + .../coretemp.0/hwmon/hwmon4/temp8_max | 1 + .../coretemp.0/hwmon/hwmon4/temp9_crit | 1 + .../coretemp.0/hwmon/hwmon4/temp9_crit_alarm | 1 + .../coretemp.0/hwmon/hwmon4/temp9_input | 1 + .../coretemp.0/hwmon/hwmon4/temp9_label | 1 + .../coretemp.0/hwmon/hwmon4/temp9_max | 1 + .../platform/coretemp.0/hwmon/hwmon4/uevent | 0 .../thermal/thermal_zone13/hwmon5/device | 1 + .../thermal/thermal_zone13/hwmon5/name | 1 + .../thermal/thermal_zone13/hwmon5/power/async | 1 + .../thermal_zone13/hwmon5/power/control | 1 + .../hwmon5/power/runtime_active_kids | 1 + .../hwmon5/power/runtime_active_time | 1 + .../hwmon5/power/runtime_enabled | 1 + .../hwmon5/power/runtime_status | 1 + .../hwmon5/power/runtime_suspended_time | 1 + .../thermal_zone13/hwmon5/power/runtime_usage | 1 + .../thermal/thermal_zone13/hwmon5/subsystem | 1 + .../thermal/thermal_zone13/hwmon5/temp1_input | 1 + .../thermal/thermal_zone13/hwmon5/uevent | 0 .../thermal/thermal_zone5/hwmon3/device | 1 + .../virtual/thermal/thermal_zone5/hwmon3/name | 1 + .../thermal/thermal_zone5/hwmon3/power/async | 1 + .../thermal_zone5/hwmon3/power/control | 1 + .../hwmon3/power/runtime_active_kids | 1 + .../hwmon3/power/runtime_active_time | 1 + .../hwmon3/power/runtime_enabled | 1 + .../thermal_zone5/hwmon3/power/runtime_status | 1 + .../hwmon3/power/runtime_suspended_time | 1 + .../thermal_zone5/hwmon3/power/runtime_usage | 1 + .../thermal/thermal_zone5/hwmon3/subsystem | 1 + .../thermal/thermal_zone5/hwmon3/temp1_crit | 1 + .../thermal/thermal_zone5/hwmon3/temp1_input | 1 + .../thermal/thermal_zone5/hwmon3/temp2_crit | 1 + .../thermal/thermal_zone5/hwmon3/temp2_input | 1 + .../thermal/thermal_zone5/hwmon3/temp3_crit | 1 + .../thermal/thermal_zone5/hwmon3/temp3_input | 1 + .../thermal/thermal_zone5/hwmon3/temp4_crit | 1 + .../thermal/thermal_zone5/hwmon3/temp4_input | 1 + .../thermal/thermal_zone5/hwmon3/temp5_crit | 1 + .../thermal/thermal_zone5/hwmon3/temp5_input | 1 + .../thermal/thermal_zone5/hwmon3/uevent | 0 165 files changed, 983 insertions(+), 1 deletion(-) create mode 100644 prog/sensors/test/data/laptop.f.json create mode 100644 prog/sensors/test/data/laptop.json create mode 120000 prog/sensors/test/data/laptop/class/hwmon/hwmon0 create mode 120000 prog/sensors/test/data/laptop/class/hwmon/hwmon1 create mode 120000 prog/sensors/test/data/laptop/class/hwmon/hwmon2 create mode 120000 prog/sensors/test/data/laptop/class/hwmon/hwmon3 create mode 120000 prog/sensors/test/data/laptop/class/hwmon/hwmon4 create mode 120000 prog/sensors/test/data/laptop/class/hwmon/hwmon5 create mode 120000 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/device create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/name create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/async create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/control create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_active_kids create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_active_time create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_enabled create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_status create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_suspended_time create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_usage create mode 120000 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/subsystem create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/uevent create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/curr1_input create mode 120000 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/device create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/in0_input create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/name create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/async create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/control create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_active_kids create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_active_time create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_enabled create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_status create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_suspended_time create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_usage create mode 120000 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/subsystem create mode 100644 prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/uevent create mode 120000 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/device create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/name create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/async create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/control create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_active_kids create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_active_time create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_enabled create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_status create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_suspended_time create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_usage create mode 120000 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/subsystem create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_alarm create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_crit create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_input create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_label create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_max create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_min create mode 100644 prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/uevent create mode 120000 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/device create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/name create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/async create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/control create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_active_kids create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_active_time create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_enabled create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_status create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_suspended_time create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_usage create mode 120000 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/subsystem create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_crit create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_crit_alarm create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_input create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_label create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_max create mode 100644 prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/uevent create mode 120000 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/device create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/name create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/async create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/control create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_active_kids create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_active_time create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_enabled create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_status create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_suspended_time create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_usage create mode 120000 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/subsystem create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/temp1_input create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/uevent create mode 120000 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/device create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/name create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/async create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/control create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_active_kids create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_active_time create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_enabled create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_status create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_suspended_time create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_usage create mode 120000 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/subsystem create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp1_crit create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp1_input create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp2_crit create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp2_input create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp3_crit create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp3_input create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp4_crit create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp4_input create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp5_crit create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp5_input create mode 100644 prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/uevent diff --git a/Makefile b/Makefile index 2e62f4fa..bc0518d4 100644 --- a/Makefile +++ b/Makefile @@ -197,7 +197,7 @@ MANPAGES := $(LIBMAN3FILES) $(LIBMAN5FILES) $(PROGDETECTMAN8FILES) $(PROGDUMPMAN check:: test -test:: shellcheck test-lib +test:: shellcheck test-sensors test-lib shellcheck:: shellcheck $(SHELLCHECKFILES) @@ -205,6 +205,10 @@ shellcheck:: test-lib:: lib/test/test-scanner cd lib/test ; ./test-scanner.pl +test-sensors:: prog/sensors/sensors + LD_LIBRARY_PATH=lib SENSORS_SYSFS_ROOT=prog/sensors/test/data/laptop prog/sensors/sensors -J | jq -S | diff -u prog/sensors/test/data/laptop.json - + LD_LIBRARY_PATH=lib SENSORS_SYSFS_ROOT=prog/sensors/test/data/laptop prog/sensors/sensors -J -f | jq -S | diff -u prog/sensors/test/data/laptop.f.json - + user :: user_install:: @echo "*** Important notes:" diff --git a/prog/sensors/test/data/laptop.f.json b/prog/sensors/test/data/laptop.f.json new file mode 100644 index 00000000..af4cb0c5 --- /dev/null +++ b/prog/sensors/test/data/laptop.f.json @@ -0,0 +1,411 @@ +{ + "BAT1-isa-00ba": { + "Adapter": "ISA adapter", + "curr1": { + "input": { + "quantity": "current", + "unit": "A", + "value": 0 + } + }, + "in0": { + "input": { + "quantity": "voltage", + "unit": "V", + "value": 16.575 + } + } + }, + "acpitz-isa-0000": { + "Adapter": "ISA adapter", + "temp1": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 410 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 110.84 + } + }, + "temp2": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 410 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 109.04 + } + }, + "temp3": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 410 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 110.84 + } + }, + "temp4": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 410 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 103.64 + } + }, + "temp5": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 410 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 85.64 + } + } + }, + "coretemp-isa-0000": { + "Adapter": "ISA adapter", + "temp1": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 107.6 + }, + "label": "Package id 0", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + }, + "temp10": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 102.2 + }, + "label": "Core 20", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + }, + "temp11": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 105.8 + }, + "label": "Core 21", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + }, + "temp12": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 104 + }, + "label": "Core 22", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + }, + "temp13": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 102.2 + }, + "label": "Core 23", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + }, + "temp2": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 105.8 + }, + "label": "Core 0", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + }, + "temp3": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 98.60000000000001 + }, + "label": "Core 4", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + }, + "temp4": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 102.2 + }, + "label": "Core 8", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + }, + "temp5": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 104 + }, + "label": "Core 12", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + }, + "temp6": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 104 + }, + "label": "Core 16", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + }, + "temp7": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 102.2 + }, + "label": "Core 17", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + }, + "temp8": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 102.2 + }, + "label": "Core 18", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + }, + "temp9": { + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 104 + }, + "label": "Core 19", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 212 + } + } + }, + "iwlwifi_1-isa-0000": { + "Adapter": "ISA adapter", + "temp1": { + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 111.2 + } + } + }, + "nvme-isa-0000": { + "Adapter": "ISA adapter", + "temp1": { + "alarm": { + "quantity": "boolean", + "value": 0 + }, + "crit": { + "quantity": "temperature", + "unit": "Β°F", + "value": 200.93 + }, + "input": { + "quantity": "temperature", + "unit": "Β°F", + "value": 98.33 + }, + "label": "Composite", + "max": { + "quantity": "temperature", + "unit": "Β°F", + "value": 193.73 + }, + "min": { + "quantity": "temperature", + "unit": "Β°F", + "value": 22.73 + } + } + } +} diff --git a/prog/sensors/test/data/laptop.json b/prog/sensors/test/data/laptop.json new file mode 100644 index 00000000..7ed072e2 --- /dev/null +++ b/prog/sensors/test/data/laptop.json @@ -0,0 +1,411 @@ +{ + "BAT1-isa-00ba": { + "Adapter": "ISA adapter", + "curr1": { + "input": { + "quantity": "current", + "unit": "A", + "value": 0 + } + }, + "in0": { + "input": { + "quantity": "voltage", + "unit": "V", + "value": 16.575 + } + } + }, + "acpitz-isa-0000": { + "Adapter": "ISA adapter", + "temp1": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 210 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 43.8 + } + }, + "temp2": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 210 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 42.8 + } + }, + "temp3": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 210 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 43.8 + } + }, + "temp4": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 210 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 39.8 + } + }, + "temp5": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 210 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 29.8 + } + } + }, + "coretemp-isa-0000": { + "Adapter": "ISA adapter", + "temp1": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 42 + }, + "label": "Package id 0", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + }, + "temp10": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 39 + }, + "label": "Core 20", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + }, + "temp11": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 41 + }, + "label": "Core 21", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + }, + "temp12": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 40 + }, + "label": "Core 22", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + }, + "temp13": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 39 + }, + "label": "Core 23", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + }, + "temp2": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 41 + }, + "label": "Core 0", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + }, + "temp3": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 37 + }, + "label": "Core 4", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + }, + "temp4": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 39 + }, + "label": "Core 8", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + }, + "temp5": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 40 + }, + "label": "Core 12", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + }, + "temp6": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 40 + }, + "label": "Core 16", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + }, + "temp7": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 39 + }, + "label": "Core 17", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + }, + "temp8": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 39 + }, + "label": "Core 18", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + }, + "temp9": { + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + }, + "crit_alarm": { + "quantity": "boolean", + "value": 0 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 40 + }, + "label": "Core 19", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 100 + } + } + }, + "iwlwifi_1-isa-0000": { + "Adapter": "ISA adapter", + "temp1": { + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 44 + } + } + }, + "nvme-isa-0000": { + "Adapter": "ISA adapter", + "temp1": { + "alarm": { + "quantity": "boolean", + "value": 0 + }, + "crit": { + "quantity": "temperature", + "unit": "Β°C", + "value": 93.85 + }, + "input": { + "quantity": "temperature", + "unit": "Β°C", + "value": 36.85 + }, + "label": "Composite", + "max": { + "quantity": "temperature", + "unit": "Β°C", + "value": 89.85 + }, + "min": { + "quantity": "temperature", + "unit": "Β°C", + "value": -5.15 + } + } + } +} diff --git a/prog/sensors/test/data/laptop/class/hwmon/hwmon0 b/prog/sensors/test/data/laptop/class/hwmon/hwmon0 new file mode 120000 index 00000000..29d50567 --- /dev/null +++ b/prog/sensors/test/data/laptop/class/hwmon/hwmon0 @@ -0,0 +1 @@ +../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0 \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/class/hwmon/hwmon1 b/prog/sensors/test/data/laptop/class/hwmon/hwmon1 new file mode 120000 index 00000000..61f82fb0 --- /dev/null +++ b/prog/sensors/test/data/laptop/class/hwmon/hwmon1 @@ -0,0 +1 @@ +../../devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1 \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/class/hwmon/hwmon2 b/prog/sensors/test/data/laptop/class/hwmon/hwmon2 new file mode 120000 index 00000000..6898f3a6 --- /dev/null +++ b/prog/sensors/test/data/laptop/class/hwmon/hwmon2 @@ -0,0 +1 @@ +../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2 \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/class/hwmon/hwmon3 b/prog/sensors/test/data/laptop/class/hwmon/hwmon3 new file mode 120000 index 00000000..5e0cf986 --- /dev/null +++ b/prog/sensors/test/data/laptop/class/hwmon/hwmon3 @@ -0,0 +1 @@ +../../devices/virtual/thermal/thermal_zone5/hwmon3 \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/class/hwmon/hwmon4 b/prog/sensors/test/data/laptop/class/hwmon/hwmon4 new file mode 120000 index 00000000..2f4e783c --- /dev/null +++ b/prog/sensors/test/data/laptop/class/hwmon/hwmon4 @@ -0,0 +1 @@ +../../devices/platform/coretemp.0/hwmon/hwmon4 \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/class/hwmon/hwmon5 b/prog/sensors/test/data/laptop/class/hwmon/hwmon5 new file mode 120000 index 00000000..f757ff1e --- /dev/null +++ b/prog/sensors/test/data/laptop/class/hwmon/hwmon5 @@ -0,0 +1 @@ +../../devices/virtual/thermal/thermal_zone13/hwmon5 \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/device b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/device new file mode 120000 index 00000000..df9279f6 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/device @@ -0,0 +1 @@ +../../ACAD \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/name b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/name new file mode 100644 index 00000000..0f57127e --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/name @@ -0,0 +1 @@ +ACAD diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/async b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/async new file mode 100644 index 00000000..7a68b11d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/async @@ -0,0 +1 @@ +disabled diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/control b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/control new file mode 100644 index 00000000..865faf10 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/control @@ -0,0 +1 @@ +auto diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_active_kids b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_active_kids new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_active_kids @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_active_time b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_active_time new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_active_time @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_enabled b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_enabled new file mode 100644 index 00000000..7a68b11d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_enabled @@ -0,0 +1 @@ +disabled diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_status b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_status new file mode 100644 index 00000000..ad7ccf7a --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_status @@ -0,0 +1 @@ +unsupported diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_suspended_time b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_suspended_time new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_suspended_time @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_usage b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_usage new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/power/runtime_usage @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/subsystem b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/subsystem new file mode 120000 index 00000000..68d2c3c3 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/subsystem @@ -0,0 +1 @@ +../../../../../../../../../class/hwmon \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/uevent b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2/uevent new file mode 100644 index 00000000..e69de29b diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/curr1_input b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/curr1_input new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/curr1_input @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/device b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/device new file mode 120000 index 00000000..9d2d8192 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/device @@ -0,0 +1 @@ +../../BAT1 \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/in0_input b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/in0_input new file mode 100644 index 00000000..4d63c95a --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/in0_input @@ -0,0 +1 @@ +16575 diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/name b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/name new file mode 100644 index 00000000..63aa3fa5 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/name @@ -0,0 +1 @@ +BAT1 diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/async b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/async new file mode 100644 index 00000000..7a68b11d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/async @@ -0,0 +1 @@ +disabled diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/control b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/control new file mode 100644 index 00000000..865faf10 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/control @@ -0,0 +1 @@ +auto diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_active_kids b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_active_kids new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_active_kids @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_active_time b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_active_time new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_active_time @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_enabled b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_enabled new file mode 100644 index 00000000..7a68b11d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_enabled @@ -0,0 +1 @@ +disabled diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_status b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_status new file mode 100644 index 00000000..ad7ccf7a --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_status @@ -0,0 +1 @@ +unsupported diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_suspended_time b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_suspended_time new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_suspended_time @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_usage b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_usage new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/power/runtime_usage @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/subsystem b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/subsystem new file mode 120000 index 00000000..68d2c3c3 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/subsystem @@ -0,0 +1 @@ +../../../../../../../../../class/hwmon \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/uevent b/prog/sensors/test/data/laptop/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0/uevent new file mode 100644 index 00000000..e69de29b diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/device b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/device new file mode 120000 index 00000000..615483f2 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/device @@ -0,0 +1 @@ +../../nvme0 \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/name b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/name new file mode 100644 index 00000000..9158fff4 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/name @@ -0,0 +1 @@ +nvme diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/async b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/async new file mode 100644 index 00000000..7a68b11d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/async @@ -0,0 +1 @@ +disabled diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/control b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/control new file mode 100644 index 00000000..865faf10 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/control @@ -0,0 +1 @@ +auto diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_active_kids b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_active_kids new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_active_kids @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_active_time b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_active_time new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_active_time @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_enabled b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_enabled new file mode 100644 index 00000000..7a68b11d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_enabled @@ -0,0 +1 @@ +disabled diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_status b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_status new file mode 100644 index 00000000..ad7ccf7a --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_status @@ -0,0 +1 @@ +unsupported diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_suspended_time b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_suspended_time new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_suspended_time @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_usage b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_usage new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/power/runtime_usage @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/subsystem b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/subsystem new file mode 120000 index 00000000..60ad84c8 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/subsystem @@ -0,0 +1 @@ +../../../../../../../class/hwmon \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_alarm b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_crit b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_crit new file mode 100644 index 00000000..1ffc5d8d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_crit @@ -0,0 +1 @@ +93850 diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_input b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_input new file mode 100644 index 00000000..90631d3e --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_input @@ -0,0 +1 @@ +36850 diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_label b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_label new file mode 100644 index 00000000..36369216 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_label @@ -0,0 +1 @@ +Composite diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_max b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_max new file mode 100644 index 00000000..15d4c9b9 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_max @@ -0,0 +1 @@ +89850 diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_min b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_min new file mode 100644 index 00000000..e6133e62 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/temp1_min @@ -0,0 +1 @@ +-5150 diff --git a/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/uevent b/prog/sensors/test/data/laptop/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1/uevent new file mode 100644 index 00000000..e69de29b diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/device b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/device new file mode 120000 index 00000000..faf75edc --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/device @@ -0,0 +1 @@ +../../../coretemp.0 \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/name b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/name new file mode 100644 index 00000000..77ce4625 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/name @@ -0,0 +1 @@ +coretemp diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/async b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/async new file mode 100644 index 00000000..7a68b11d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/async @@ -0,0 +1 @@ +disabled diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/control b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/control new file mode 100644 index 00000000..865faf10 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/control @@ -0,0 +1 @@ +auto diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_active_kids b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_active_kids new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_active_kids @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_active_time b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_active_time new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_active_time @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_enabled b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_enabled new file mode 100644 index 00000000..7a68b11d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_enabled @@ -0,0 +1 @@ +disabled diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_status b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_status new file mode 100644 index 00000000..ad7ccf7a --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_status @@ -0,0 +1 @@ +unsupported diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_suspended_time b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_suspended_time new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_suspended_time @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_usage b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_usage new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/power/runtime_usage @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/subsystem b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/subsystem new file mode 120000 index 00000000..c02ab68b --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/subsystem @@ -0,0 +1 @@ +../../../../../class/hwmon \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_input new file mode 100644 index 00000000..dec69412 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_input @@ -0,0 +1 @@ +39000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_label new file mode 100644 index 00000000..88d24142 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_label @@ -0,0 +1 @@ +Core 20 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp10_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_input new file mode 100644 index 00000000..7ca5e373 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_input @@ -0,0 +1 @@ +41000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_label new file mode 100644 index 00000000..a7459de3 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_label @@ -0,0 +1 @@ +Core 21 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp11_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_input new file mode 100644 index 00000000..c5da56ae --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_input @@ -0,0 +1 @@ +40000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_label new file mode 100644 index 00000000..c6932e7e --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_label @@ -0,0 +1 @@ +Core 22 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp12_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_input new file mode 100644 index 00000000..dec69412 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_input @@ -0,0 +1 @@ +39000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_label new file mode 100644 index 00000000..9539ccfb --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_label @@ -0,0 +1 @@ +Core 23 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp13_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input new file mode 100644 index 00000000..6096bd1b --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input @@ -0,0 +1 @@ +42000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_label new file mode 100644 index 00000000..7d676151 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_label @@ -0,0 +1 @@ +Package id 0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp1_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_input new file mode 100644 index 00000000..7ca5e373 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_input @@ -0,0 +1 @@ +41000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_label new file mode 100644 index 00000000..09f8cbdd --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_label @@ -0,0 +1 @@ +Core 0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp2_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_input new file mode 100644 index 00000000..62dc12e0 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_input @@ -0,0 +1 @@ +37000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_label new file mode 100644 index 00000000..a440e161 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_label @@ -0,0 +1 @@ +Core 4 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp3_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_input new file mode 100644 index 00000000..dec69412 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_input @@ -0,0 +1 @@ +39000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_label new file mode 100644 index 00000000..301cd219 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_label @@ -0,0 +1 @@ +Core 8 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp4_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_input new file mode 100644 index 00000000..c5da56ae --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_input @@ -0,0 +1 @@ +40000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_label new file mode 100644 index 00000000..75832e3d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_label @@ -0,0 +1 @@ +Core 12 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp5_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_input new file mode 100644 index 00000000..c5da56ae --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_input @@ -0,0 +1 @@ +40000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_label new file mode 100644 index 00000000..37d605ef --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_label @@ -0,0 +1 @@ +Core 16 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp6_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_input new file mode 100644 index 00000000..dec69412 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_input @@ -0,0 +1 @@ +39000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_label new file mode 100644 index 00000000..4d8b8ac0 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_label @@ -0,0 +1 @@ +Core 17 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp7_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_input new file mode 100644 index 00000000..dec69412 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_input @@ -0,0 +1 @@ +39000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_label new file mode 100644 index 00000000..c7e1c325 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_label @@ -0,0 +1 @@ +Core 18 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp8_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_crit b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_crit new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_crit @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_crit_alarm b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_crit_alarm new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_crit_alarm @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_input b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_input new file mode 100644 index 00000000..c5da56ae --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_input @@ -0,0 +1 @@ +40000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_label b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_label new file mode 100644 index 00000000..89d23f04 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_label @@ -0,0 +1 @@ +Core 19 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_max b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_max new file mode 100644 index 00000000..f7393e84 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/temp9_max @@ -0,0 +1 @@ +100000 diff --git a/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/uevent b/prog/sensors/test/data/laptop/devices/platform/coretemp.0/hwmon/hwmon4/uevent new file mode 100644 index 00000000..e69de29b diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/device b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/device new file mode 120000 index 00000000..014881e6 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/device @@ -0,0 +1 @@ +../../thermal_zone13 \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/name b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/name new file mode 100644 index 00000000..9d35f255 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/name @@ -0,0 +1 @@ +iwlwifi_1 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/async b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/async new file mode 100644 index 00000000..7a68b11d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/async @@ -0,0 +1 @@ +disabled diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/control b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/control new file mode 100644 index 00000000..865faf10 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/control @@ -0,0 +1 @@ +auto diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_active_kids b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_active_kids new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_active_kids @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_active_time b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_active_time new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_active_time @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_enabled b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_enabled new file mode 100644 index 00000000..7a68b11d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_enabled @@ -0,0 +1 @@ +disabled diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_status b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_status new file mode 100644 index 00000000..ad7ccf7a --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_status @@ -0,0 +1 @@ +unsupported diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_suspended_time b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_suspended_time new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_suspended_time @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_usage b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_usage new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/power/runtime_usage @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/subsystem b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/subsystem new file mode 120000 index 00000000..c02ab68b --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/subsystem @@ -0,0 +1 @@ +../../../../../class/hwmon \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/temp1_input b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/temp1_input new file mode 100644 index 00000000..ac2a15ef --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/temp1_input @@ -0,0 +1 @@ +44000 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/uevent b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone13/hwmon5/uevent new file mode 100644 index 00000000..e69de29b diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/device b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/device new file mode 120000 index 00000000..2f703507 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/device @@ -0,0 +1 @@ +../../thermal_zone5 \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/name b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/name new file mode 100644 index 00000000..a29f406c --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/name @@ -0,0 +1 @@ +acpitz diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/async b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/async new file mode 100644 index 00000000..7a68b11d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/async @@ -0,0 +1 @@ +disabled diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/control b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/control new file mode 100644 index 00000000..865faf10 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/control @@ -0,0 +1 @@ +auto diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_active_kids b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_active_kids new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_active_kids @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_active_time b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_active_time new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_active_time @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_enabled b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_enabled new file mode 100644 index 00000000..7a68b11d --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_enabled @@ -0,0 +1 @@ +disabled diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_status b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_status new file mode 100644 index 00000000..ad7ccf7a --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_status @@ -0,0 +1 @@ +unsupported diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_suspended_time b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_suspended_time new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_suspended_time @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_usage b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_usage new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/power/runtime_usage @@ -0,0 +1 @@ +0 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/subsystem b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/subsystem new file mode 120000 index 00000000..c02ab68b --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/subsystem @@ -0,0 +1 @@ +../../../../../class/hwmon \ No newline at end of file diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp1_crit b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp1_crit new file mode 100644 index 00000000..ddf9bed3 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp1_crit @@ -0,0 +1 @@ +210000 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp1_input b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp1_input new file mode 100644 index 00000000..ff8eb3f3 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp1_input @@ -0,0 +1 @@ +43800 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp2_crit b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp2_crit new file mode 100644 index 00000000..ddf9bed3 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp2_crit @@ -0,0 +1 @@ +210000 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp2_input b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp2_input new file mode 100644 index 00000000..654113c7 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp2_input @@ -0,0 +1 @@ +42800 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp3_crit b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp3_crit new file mode 100644 index 00000000..ddf9bed3 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp3_crit @@ -0,0 +1 @@ +210000 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp3_input b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp3_input new file mode 100644 index 00000000..ff8eb3f3 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp3_input @@ -0,0 +1 @@ +43800 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp4_crit b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp4_crit new file mode 100644 index 00000000..ddf9bed3 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp4_crit @@ -0,0 +1 @@ +210000 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp4_input b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp4_input new file mode 100644 index 00000000..06345c22 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp4_input @@ -0,0 +1 @@ +39800 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp5_crit b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp5_crit new file mode 100644 index 00000000..ddf9bed3 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp5_crit @@ -0,0 +1 @@ +210000 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp5_input b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp5_input new file mode 100644 index 00000000..7cb35186 --- /dev/null +++ b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/temp5_input @@ -0,0 +1 @@ +29800 diff --git a/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/uevent b/prog/sensors/test/data/laptop/devices/virtual/thermal/thermal_zone5/hwmon3/uevent new file mode 100644 index 00000000..e69de29b From c0c82d0bca7d372bdc653c5fdc92ee01aaf909ff Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 17 Jan 2024 20:09:08 +0100 Subject: [PATCH 100/116] Run test as GitHub Action --- .github/workflows/debian.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/debian.yml diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml new file mode 100644 index 00000000..a1a63b2b --- /dev/null +++ b/.github/workflows/debian.yml @@ -0,0 +1,29 @@ +name: πŸ₯GitHub Action Debian +run-name: ${{ github.actor }} is testing out GitHub Actions πŸš€ +on: [push] +jobs: + Run-Tests: + runs-on: ubuntu-latest + steps: + - run: echo "πŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "πŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "πŸ’‘ The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "πŸ–₯️ The workflow is now ready to test your code on the runner." + - name: 🧐 List files in the repository + run: | + cd ${{ github.workspace }} + ls + - name: 🧰 Install tools + run: | + sudo apt-get update + sudo apt-get install libtest-cmd-perl + - name: πŸ—οΈ Build the stuff + run: | + make + - name: 🧫 Run tests + run: | + make check + - run: echo "🍏 This job's status is ${{ job.status }}." From 51f74751aeef6b00e9c44f43d972252c4ef9d093 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 17 Jan 2024 22:12:22 +0100 Subject: [PATCH 101/116] Add more junk files to .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index d7c1e0b3..9488e919 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,7 @@ lib/conf-parse.h # Patching artifacts *.orig +*.rej + +# editor backup files +*~ From 1c757b34a7e8da49345bef2a66112f588752be13 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 17 Jan 2024 22:19:09 +0100 Subject: [PATCH 102/116] Fix build with extra libraries Fixes: c829b4c7 ("Add LDFLAGS handling similar to CFLAGS") --- lib/Module.mk | 2 +- lib/test/Module.mk | 2 +- prog/dump/Module.mk | 4 ++-- prog/sensord/Module.mk | 2 +- prog/sensors/Module.mk | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Module.mk b/lib/Module.mk index a1bb575d..282fa746 100644 --- a/lib/Module.mk +++ b/lib/Module.mk @@ -69,7 +69,7 @@ LIBHEADERFILES := $(MODULE_DIR)/error.h $(MODULE_DIR)/sensors.h # How to create the shared library $(MODULE_DIR)/$(LIBSHLIBNAME): $(LIBSHOBJECTS) $(LIB_DIR)/libsensors.map - $(CC) -shared $(ALL_LDFLAGS) -Wl,--version-script=$(LIB_DIR)/libsensors.map -Wl,-soname,$(LIBSHSONAME) -o $@ $(LIBSHOBJECTS) -lc -lm + $(CC) -shared -Wl,--version-script=$(LIB_DIR)/libsensors.map -Wl,-soname,$(LIBSHSONAME) -o $@ $(LIBSHOBJECTS) $(ALL_LDFLAGS) -lc -lm $(MODULE_DIR)/$(LIBSHSONAME): $(MODULE_DIR)/$(LIBSHLIBNAME) $(RM) $@ diff --git a/lib/test/Module.mk b/lib/test/Module.mk index 6382431d..d30919d1 100644 --- a/lib/test/Module.mk +++ b/lib/test/Module.mk @@ -15,7 +15,7 @@ LIB_TEST_SCANNER_OBJS := \ INCLUDEFILES += $(LIB_TEST_SOURCES:.c=.rd) $(LIB_TEST_DIR)/test-scanner: $(LIB_TEST_SCANNER_OBJS) - $(CC) $(EXLDFLAGS) -o $@ $(LIB_TEST_SCANNER_OBJS) -Llib + $(CC) -o $@ $(LIB_TEST_SCANNER_OBJS) -Llib $(EXLDFLAGS) all-lib-test: $(LIB_TEST_TARGETS) user :: all-lib-test diff --git a/prog/dump/Module.mk b/prog/dump/Module.mk index 5e522e3d..52d05332 100644 --- a/prog/dump/Module.mk +++ b/prog/dump/Module.mk @@ -43,10 +43,10 @@ all-prog-dump: $(PROGDUMPTARGETS) user :: all-prog-dump $(MODULE_DIR)/isadump: $(MODULE_DIR)/isadump.ro $(MODULE_DIR)/superio.ro $(MODULE_DIR)/util.ro - $(CC) $(EXLDFLAGS) -o $@ $^ + $(CC) -o $@ $^ $(EXLDFLAGS) $(MODULE_DIR)/isaset: $(MODULE_DIR)/isaset.ro $(MODULE_DIR)/util.ro - $(CC) $(EXLDFLAGS) -o $@ $^ + $(CC) -o $@ $^ $(EXLDFLAGS) install-prog-dump: all-prog-dump $(MKDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(PROGDUMPMAN8DIR) diff --git a/prog/sensord/Module.mk b/prog/sensord/Module.mk index b8a8c956..692b8848 100644 --- a/prog/sensord/Module.mk +++ b/prog/sensord/Module.mk @@ -42,7 +42,7 @@ REMOVESENSORDBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGSENS REMOVESENSORDMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORDMAN8DIR)/%,$(PROGSENSORDMAN8FILES)) $(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBDEP_FOR_PROGS) - $(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORDSOURCES:.c=.ro) -Llib -lsensors -lrrd + $(CC) -o $@ $(PROGSENSORDSOURCES:.c=.ro) $(EXLDFLAGS) -Llib -lsensors -lrrd all-prog-sensord: $(PROGSENSORDTARGETS) user :: all-prog-sensord diff --git a/prog/sensors/Module.mk b/prog/sensors/Module.mk index ad9dd9db..18710f69 100644 --- a/prog/sensors/Module.mk +++ b/prog/sensors/Module.mk @@ -42,7 +42,7 @@ REMOVESENSORSZSH := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(ZSHCOMPDIR)/%,$(PROGS LIBICONV := $(shell if /sbin/ldconfig -p | grep -q '/libiconv\.so$$' ; then echo \-liconv; else echo; fi) $(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBDEP_FOR_PROGS) - $(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors -lm + $(CC) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) $(EXLDFLAGS) -Llib -lsensors -lm all-prog-sensors: $(PROGSENSORSTARGETS) user :: all-prog-sensors From 9e5156cb67a31dea1485eba192dfa4dd93fa99fe Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sat, 17 Feb 2024 11:46:02 +0100 Subject: [PATCH 103/116] check: Check perl program syntax --- Makefile | 5 ++++- etc/Module.mk | 2 ++ prog/detect/Module.mk | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bc0518d4..651ee5cc 100644 --- a/Makefile +++ b/Makefile @@ -197,11 +197,14 @@ MANPAGES := $(LIBMAN3FILES) $(LIBMAN5FILES) $(PROGDETECTMAN8FILES) $(PROGDUMPMAN check:: test -test:: shellcheck test-sensors test-lib +test:: shellcheck perlcheck test-sensors test-lib shellcheck:: shellcheck $(SHELLCHECKFILES) +perlcheck:: + for i in $(PERL_SOURCES) ; do perl -c $$i ; done + test-lib:: lib/test/test-scanner cd lib/test ; ./test-scanner.pl diff --git a/etc/Module.mk b/etc/Module.mk index 6a273928..d44b68af 100644 --- a/etc/Module.mk +++ b/etc/Module.mk @@ -21,6 +21,8 @@ # installed; typically /etc). ETC_DIR := etc +PERL_SOURCES += $(ETC_DIR)/sensors-conf-convert + install-etc: $(MKDIR) $(DESTDIR)$(ETCDIR) $(DESTDIR)$(ETCDIR)/sensors.d if [ ! -e $(DESTDIR)$(ETCDIR)/sensors3.conf ] ; then \ diff --git a/prog/detect/Module.mk b/prog/detect/Module.mk index 1b2cac6d..883670f8 100644 --- a/prog/detect/Module.mk +++ b/prog/detect/Module.mk @@ -34,6 +34,8 @@ REMOVEDETECTBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGDETEC REMOVEDETECTMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGDETECTMAN8DIR)/%,$(PROGDETECTMAN8FILES)) REMOVEDETECTZSH := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(ZSHCOMPDIR)/%,$(PROGDETECTZSHCOMPFILES)) +PERL_SOURCES += $(PROGDETECTSBININSTALL) + all-prog-detect: user :: all-prog-detect From 0be39ad911865cdb95b522ba90bf30cdde925585 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Thu, 3 Jan 2008 11:11:02 +0100 Subject: [PATCH 104/116] sensors-conf-convert: Convert voltage formulas correctly References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=456774 --- etc/sensors-conf-convert | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/etc/sensors-conf-convert b/etc/sensors-conf-convert index dac398c6..e2ada620 100755 --- a/etc/sensors-conf-convert +++ b/etc/sensors-conf-convert @@ -34,7 +34,7 @@ # the user doesn't have a bad surprise when uncommenting them. use strict; -use vars qw($debug $chip %trans @delete %chip_trans %chip_delete); +use vars qw($debug $chip %trans @delete %chip_trans %chip_delete $first_part $second_part $compute_next); BEGIN { @@ -480,3 +480,17 @@ elsif (m/^[\s#]*(?:label|ignore|set|compute)\s+(\S+)\s/) { $_ = substitute_line($chip, $_); } } + +# Formula changes (in0 -> in0_input) +if (m/^([\s#]*compute\s+\S+)(.*)/) { + $first_part = $1; + $second_part = $2; + $second_part =~ s/in(\d+)/in$1_input/gi; + $_ = "$first_part$second_part\n"; + $compute_next = 1 if (m/\\$/); +} elsif ($compute_next) { + s/in(\d+)/in$1_input/gi; + $compute_next = 0 if (! m/\\$/); +} else { + $compute_next = 0; +} From b7b10c0065a4931f6285a132c14c7b98856ba9cd Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sun, 6 Feb 2011 14:46:28 +0100 Subject: [PATCH 105/116] sensors-detect: Recognize more chips References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588355 ADT7466 -> lm85 SCH5524-NS -> none --- prog/detect/sensors-detect | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index f5b0705a..2cd6978d 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -725,7 +725,7 @@ use vars qw(@i2c_adapter_names); i2c_detect => sub { adt7467_detect(@_, 2); }, }, { name => "Analog Devices ADT7466", - driver => "to-be-written", + driver => "lm85", i2c_addrs => [0x4c], i2c_detect => sub { adt7467_detect(@_, 3); }, }, { @@ -2101,6 +2101,11 @@ use constant FEAT_SMBUS => (1 << 7); # No datasheet driver => "not-a-sensor", devid => 0x83, + }, { + name => "SMSC SCH5524-NS Super IO", + # No datasheet + driver => "not-a-sensor", + devid => 0x8d, }, { name => "SMSC SCH5627 Super IO", driver => "sch5627", From 71fb47f1b5a304bc6eb901792f2a69a9bf1db467 Mon Sep 17 00:00:00 2001 From: Micah Gersten Date: Mon, 13 Jun 2011 23:03:46 -0500 Subject: [PATCH 106/116] sensors-detect: Recognize 2 digit kernel version References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=630508 --- prog/detect/sensors-detect | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 2cd6978d..b37104ca 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -3100,8 +3100,8 @@ use vars qw($kernel_version @kernel_version $kernel_arch); sub initialize_kernel_version { chomp($kernel_version = `uname -r`); - $kernel_version =~ /(\d+)\.(\d+)\.(\d+)(.*)/; - @kernel_version = ($1, $2, $3, $4); + $kernel_version =~ /(\d+)\.(\d+)(?:\.(\d+))?(.*)/; + @kernel_version = ($1, $2, $3 || 0, $4); chomp($kernel_arch = `uname -m`); # We only support kernels >= 2.6.5 From 5f35944bc4bbec05ea61e010a54564df52b559e3 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sat, 17 Feb 2024 10:47:23 +0100 Subject: [PATCH 107/116] sensors-detect: Try more locations of udevadm References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852558 --- prog/detect/sensors-detect | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index b37104ca..a4438af7 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -3351,7 +3351,9 @@ sub load_module # udev may take some time to create device nodes when loading modules sub udev_settle { - if (!(-x "/sbin/udevadm" && system("/sbin/udevadm settle") == 0) + if (!(-x "/usr/bin/udevadm" && system("/usr/bin/udevadm settle") == 0) + && !(-x "/bin/udevadm" && system("/bin/udevadm settle") == 0) + && !(-x "/sbin/udevadm" && system("/sbin/udevadm settle") == 0) && !(-x "/sbin/udevsettle" && system("/sbin/udevsettle") == 0)) { sleep(1); } From c2df8a4183940e4f32acef01cbc54204db3bfd99 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Tue, 25 May 2010 11:33:23 +0200 Subject: [PATCH 108/116] fancontrol: Add --check option to only check configuration syntax References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582979 --- prog/pwm/fancontrol | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/prog/pwm/fancontrol b/prog/pwm/fancontrol index 243e1a8e..bfceffb6 100755 --- a/prog/pwm/fancontrol +++ b/prog/pwm/fancontrol @@ -390,6 +390,17 @@ function CheckFiles return $outdated } +if [ "$1" == "--check" ] +then + if [ -f "$2" ] + then + LoadConfig $2 + else + LoadConfig /etc/fancontrol + fi + exit 0 +fi + if [ -f "$1" ] then LoadConfig $1 From 2d18c0952ab47e82be18aadfe8de7c7b056c80dc Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sat, 17 Feb 2024 12:34:41 +0100 Subject: [PATCH 109/116] fancontrol: Uplift the --check option - do not duplicate the load code - add description to man page --- prog/pwm/fancontrol | 14 +++++++------- prog/pwm/fancontrol.8 | 12 ++++++++++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/prog/pwm/fancontrol b/prog/pwm/fancontrol index bfceffb6..5b6e5b48 100755 --- a/prog/pwm/fancontrol +++ b/prog/pwm/fancontrol @@ -390,15 +390,11 @@ function CheckFiles return $outdated } +CHECK_ONLY=false if [ "$1" == "--check" ] then - if [ -f "$2" ] - then - LoadConfig $2 - else - LoadConfig /etc/fancontrol - fi - exit 0 + CHECK_ONLY=true + shift fi if [ -f "$1" ] @@ -408,6 +404,10 @@ else LoadConfig /etc/fancontrol fi +if $CHECK_ONLY ; then + exit 0 +fi + # Detect path to sensors if echo "${AFCPWM[0]}" | grep -E -q '^/' then diff --git a/prog/pwm/fancontrol.8 b/prog/pwm/fancontrol.8 index 48190bc2..30bdefb4 100644 --- a/prog/pwm/fancontrol.8 +++ b/prog/pwm/fancontrol.8 @@ -3,14 +3,22 @@ fancontrol \- automated software based fan speed regulation .SH SYNOPSIS -.B fancontrol -.I [configfile] +.B fancontrol [ +.I --check +.B ] [ +.I configfile +.B ] .SH DESCRIPTION \fBfancontrol\fP is a shell script for use with lm_sensors. It reads its configuration from a file, then calculates fan speeds from temperatures and sets the corresponding PWM outputs to the computed values. +.SH OPTIONS +.IP "--check" +Check configuration file end exit. This option can be used for verifying the +configuration before starting fancontrol as a service in the background. + .SH WARNING Please be careful when using the fan control features of your mainboard, in addition to the risk of burning your CPU, at higher temperatures there will be From c297368a0e4b0442fca06bae58a0bd3386629af0 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sun, 4 Feb 2024 22:55:42 +0100 Subject: [PATCH 110/116] tests: Do not use config file in json test Pass -c /dev/null when running tests Fixes: e06d99df ("tests: Add trivial json formatting test") --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 651ee5cc..10a088db 100644 --- a/Makefile +++ b/Makefile @@ -209,8 +209,8 @@ test-lib:: lib/test/test-scanner cd lib/test ; ./test-scanner.pl test-sensors:: prog/sensors/sensors - LD_LIBRARY_PATH=lib SENSORS_SYSFS_ROOT=prog/sensors/test/data/laptop prog/sensors/sensors -J | jq -S | diff -u prog/sensors/test/data/laptop.json - - LD_LIBRARY_PATH=lib SENSORS_SYSFS_ROOT=prog/sensors/test/data/laptop prog/sensors/sensors -J -f | jq -S | diff -u prog/sensors/test/data/laptop.f.json - + LD_LIBRARY_PATH=lib SENSORS_SYSFS_ROOT=prog/sensors/test/data/laptop prog/sensors/sensors -c /dev/null -J | jq -S | diff -u prog/sensors/test/data/laptop.json - + LD_LIBRARY_PATH=lib SENSORS_SYSFS_ROOT=prog/sensors/test/data/laptop prog/sensors/sensors -c /dev/null -J -f | jq -S | diff -u prog/sensors/test/data/laptop.f.json - user :: user_install:: From 62a955319152ce0595932789d10e955304213beb Mon Sep 17 00:00:00 2001 From: xaizek Date: Sat, 7 Jun 2025 13:33:11 +0300 Subject: [PATCH 111/116] pwm: fix bad scaling due to use of integer type This fixes commit c1a1f4ff206c0e6959c3e4d6b19ba27963076d5e ("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 --- lib/sysfs.c | 2 +- prog/sensors/test/data/laptop.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index 39644f11..6e93b95c 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -139,7 +139,7 @@ static int sysfs_foreach_busdev(const char *bus_type, const char *sensors_sysfs_mount = "/sys"; static -int get_type_scaling(sensors_subfeature_type type) +double get_type_scaling(sensors_subfeature_type type) { /* Multipliers for second class subfeatures that need their own multiplier */ diff --git a/prog/sensors/test/data/laptop.json b/prog/sensors/test/data/laptop.json index 7ed072e2..81a3839b 100644 --- a/prog/sensors/test/data/laptop.json +++ b/prog/sensors/test/data/laptop.json @@ -388,7 +388,7 @@ "crit": { "quantity": "temperature", "unit": "Β°C", - "value": 93.85 + "value": 93.84999999999999 }, "input": { "quantity": "temperature", @@ -399,7 +399,7 @@ "max": { "quantity": "temperature", "unit": "Β°C", - "value": 89.85 + "value": 89.84999999999999 }, "min": { "quantity": "temperature", From 68bda219526d22c3b9014d6e0179c7e82da3bdac Mon Sep 17 00:00:00 2001 From: graysky Date: Sat, 16 Aug 2025 07:01:21 -0400 Subject: [PATCH 112/116] 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. --- Makefile | 17 +++++++++++++++++ prog/sensors/Module.mk | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 10a088db..2adae708 100644 --- a/Makefile +++ b/Makefile @@ -171,6 +171,23 @@ LIBCFLAGS := -fpic -D_REENTRANT $(ALL_CFLAGS) ALL_LDFLAGS := $(LDFLAGS) +# Determine iconv linking requirements +# glibc has built-in iconv, other libc implementations may need -liconv +ifndef LIBICONV + ICONV_TEST := $(shell printf '%s\n' \ + '#include ' \ + 'int main() { iconv_t cd = iconv_open("UTF-8", "ASCII"); return 0; }' \ + | $(CC) $(ALL_CPPFLAGS) -x c - -o /tmp/lm_sensors_iconv_test 2>/dev/null && echo "builtin" || echo "external") + + ifeq ($(ICONV_TEST),builtin) + LIBICONV := + else + LIBICONV := -liconv + endif + + $(shell rm -f /tmp/lm_sensors_iconv_test) +endif + EXLDFLAGS := -Wl,-rpath,$(LIBDIR) $(ALL_LDFLAGS) .PHONY: all user clean install user_install uninstall user_uninstall diff --git a/prog/sensors/Module.mk b/prog/sensors/Module.mk index 18710f69..3130668e 100644 --- a/prog/sensors/Module.mk +++ b/prog/sensors/Module.mk @@ -39,7 +39,10 @@ REMOVESENSORSBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGSENSO REMOVESENSORSMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORSMAN1DIR)/%,$(PROGSENSORSMAN1FILES)) REMOVESENSORSZSH := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(ZSHCOMPDIR)/%,$(PROGSENSORSZSHCOMPFILES)) -LIBICONV := $(shell if /sbin/ldconfig -p | grep -q '/libiconv\.so$$' ; then echo \-liconv; else echo; fi) +LIBICONV := $(shell printf '%s\n' \ + '#include ' \ + 'int main() { iconv_t cd = iconv_open("UTF-8", "ASCII"); return 0; }' \ + | $(CC) $(ALL_CPPFLAGS) -x c - 2>/dev/null && echo || echo \-liconv) $(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBDEP_FOR_PROGS) $(CC) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) $(EXLDFLAGS) -Llib -lsensors -lm From 01359701a22b0c3cc73daa35ed4c64b44dada1d1 Mon Sep 17 00:00:00 2001 From: Michael Lettrich Date: Fri, 25 Jul 2025 10:31:03 +0200 Subject: [PATCH 113/116] [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. --- lib/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index 6e93b95c..8e46ddce 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -810,7 +810,7 @@ static int classify_device(const char *dev_name, if ((!subsys || !strcmp(subsys, "platform") || !strcmp(subsys, "of_platform"))) { /* must be new ISA (platform driver) */ - if (sscanf(dev_name, "%*[a-zA-Z0-9_]%*1[.:]%d", &entry->chip.addr) == 1); + if (sscanf(dev_name, "%*[a-zA-Z0-9_-]%*1[.:]%d", &entry->chip.addr) == 1); else if (sscanf(dev_name, "%x.%*s", &entry->chip.addr) == 1); else entry->chip.addr = 0; entry->chip.bus.type = SENSORS_BUS_TYPE_ISA; From 6282f6925a3764c1242a03b65e6ad0f7e0f6b537 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sat, 12 Apr 2025 14:05:34 +0200 Subject: [PATCH 114/116] 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: 89548dab2a617 ("Add SENSORS_SYSFS_ROOT environment support") --- lib/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index 8e46ddce..4450b00e 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -755,7 +755,7 @@ int sensors_init_sysfs(void) snprintf(hwmon_path, length, "%s%s", sensors_sysfs_mount, hwmon_subdir); result = !stat(hwmon_path, &statbuf) && ((statbuf.st_mode & S_IFMT) == S_IFDIR); - if (!result) + if (sysfs_root_env && !result) fprintf(stderr, "%s: No sensors at %s.\n", sensors_sysfs_mount, hwmon_path); free(hwmon_path); From 2b8073674eb728b06af1a87131854802c587bfaa Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Wed, 17 Jan 2024 22:19:09 +0100 Subject: [PATCH 115/116] GitHub tests: Add coverage report --- .github/workflows/coverage.yml | 43 +++++++++++++++++++++ .github/workflows/debian.yml | 69 +++++++++++++++++++++++++--------- 2 files changed, 95 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..30a062e5 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,43 @@ +name: πŸ”οΈ Display coverage data + +on: + workflow_run: + workflows: [πŸ₯GitHub Action Debian] + types: [completed] + +jobs: + Display-Coverage: + runs-on: ubuntu-latest + steps: + - name: ⏬ Download artifact + uses: actions/github-script@v9 + with: + github-token: ${{ secrets.TOKEN }} + script: | + let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.payload.workflow_run.id, + }); + let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { + return artifact.name == "Coverage report" + })[0]; + let download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }); + let fs = require('fs'); + fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/coverage-report.zip`, Buffer.from(download.data)); + - name: 🏺 Unzip artifact + run: unzip coverage-report.zip -d lcov + - name: πŸ”οΈ Generate coverage report + uses: hramrach/lcov-reporter-action@master + with: + github-token: ${{ secrets.TOKEN }} + lcov-file: "lcov/coverage-current.info" + lcov-base: "lcov/coverage-base.info" + event: "lcov/event" + delete-old-comments: true + update-comment: true diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index a1a63b2b..4fc96c67 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -1,29 +1,64 @@ name: πŸ₯GitHub Action Debian -run-name: ${{ github.actor }} is testing out GitHub Actions πŸš€ -on: [push] +run-name: ${{ github.event_name }} GitHub Action triggered by ${{ github.actor }} 🎬 +on: [pull_request] jobs: Run-Tests: runs-on: ubuntu-latest steps: - - run: echo "πŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "πŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - - run: echo "πŸ’‘ The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "πŸ–₯️ The workflow is now ready to test your code on the runner." - - name: 🧐 List files in the repository - run: | - cd ${{ github.workspace }} - ls + - name: πŸ“¨ Check out repository code + uses: actions/checkout@v6 + with: + path: current + - name: 🏚︎ Check out the base branch + uses: actions/checkout@v6 + with: + path: base + ref: ${{ github.base_ref }} + - name: ≣⃛ checkout lcov + uses: actions/checkout@v6 + with: + path: lcov + ref: v2.0 + repository: linux-test-project/lcov - name: 🧰 Install tools run: | sudo apt-get update - sudo apt-get install libtest-cmd-perl - - name: πŸ—οΈ Build the stuff + sudo apt-get install libtest-cmd-perl librrd-dev valgrind sed \ + libcapture-tiny-perl libdatetime-perl libdevel-cover-perl libdigest-md5-perl libfile-spec-perl libjson-xs-perl libmodule-load-conditional-perl libscalar-list-utils-perl libtime-hires-perl + - name: πŸ—οΈ Build code run: | - make + cd ${{ github.workspace }}/lcov + make PREFIX=${{ github.workspace }}/lcov-install install + for dir in base current ; do + cd ${{ github.workspace }}/$dir + sed -i -e s/[.]ao\\\>/.lo/g lib/test/Module.mk # Need only one kind of object in all binaries for gcov + CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS=-lgcov make PROG_EXTRA=sensord BUILD_STATIC_LIB=0 + done - name: 🧫 Run tests run: | + for dir in base current ; do + cd ${{ github.workspace }}/$dir + ${{ github.workspace }}/lcov-install/bin/lcov --capture --initial --branch-coverage --base $(pwd) --no-external --directory . --output-file coverage0.info make check - - run: echo "🍏 This job's status is ${{ job.status }}." + done + - name: 🌨️ Calculate coverage + run: | + for dir in base current ; do + cd ${{ github.workspace }}/$dir + ${{ github.workspace }}/lcov-install/bin/lcov --capture --branch-coverage --base $(pwd) --no-external --directory . --output-file coverage1.info + ${{ github.workspace }}/lcov-install/bin/lcov --branch-coverage --substitute 's#'$dir'/##g' --add-tracefile coverage0.info --add-tracefile coverage1.info --output-file coverage.info + ${{ github.workspace }}/lcov-install/bin/lcov --list coverage.info + cp ${{ github.workspace }}/$dir/coverage.info ${{ github.workspace }}/coverage-$dir.info + done + PR_NUMBER="${{ github.event.pull_request.number }}" + cp ${{ github.event_path }} ${{ github.workspace }}/event + cat ${{ github.workspace }}/event + + - name: ⏫ Upload coverage data + uses: actions/upload-artifact@v7 + with: + name: Coverage report + path: | + ${{ github.workspace }}/coverage-current.info + ${{ github.workspace }}/coverage-base.info + ${{ github.workspace }}/event From 7f9c917b2862cd7090395b6404a98d40ba8c9ebb Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 23 Apr 2026 12:27:04 +0100 Subject: [PATCH 116/116] Rename README to README.md, update to markdown. --- README | 154 ------------------------------------------------------ README.md | 141 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+), 154 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/README b/README deleted file mode 100644 index 010c7e25..00000000 --- a/README +++ /dev/null @@ -1,154 +0,0 @@ -OVERVIEW OF THE LM-SENSORS PACKAGE -================================== - -The lm-sensors package, version 3, provides user-space support for the -hardware monitoring drivers in Linux 2.6.5 and later. For older kernel -versions, you have to use lm-sensors version 2. - -The directories within this package: - -* doc - Documentation. -* etc - A sample configuration file for libsensors, and a script to convert - lm-sensors version 2 configuration files to work with version 3. -* lib - The user-space sensors support library code (libsensors). -* prog - Several supporting programs. The most important ones are: - - sensors-detect: A stand-alone program for detecting installed - hardware and recommending specific modules to load. - - sensors: A console tool to report sensor readings and set new - sensor limits. - - sensord: A daemon to watch sensor values and log problems. It - includes RRD support. -* configs - This directory contains sample configurations of various boards, - contributed by users of lm-sensors. - - All configuration files should now be imported from the old - www.lm-sensors.org website, however additional information about - the origin of the configuration files can be found on the old site: - http://web.archive.org/web/20150901092438/http://www.lm-sensors.org:80/wiki/Configurations - - Please contribute back a configuration of your board so other users with - the same hardware won't need to recreate it again and again. - -INSTALLING LM-SENSORS ---------------------- - -See the INSTALL file. - - -HARDWARE SUPPORT ----------------- - -To find out what hardware you have, just run 'sensors-detect' as root. - -Most modern mainboards incorporate some form of hardware monitoring chips. -These chips read things like chip temperatures, fan rotation speeds and -voltage levels. There are quite a few different chips which can be used by -mainboard builders for approximately the same results. - -Laptops, on the other hand, rarely expose any hardware monitoring -chip. They often have some BIOS and/or ACPI magic to get the CPU -temperature value, but that's about it. For such laptops, the lm-sensors -package is of no use (sensors-detect will not find anything), and you have -to use acpi instead. - -This package doesn't contain chip-specific knowledge. It will support all -the hardware monitoring chips your kernel has drivers for. In other words, -if you find out that you have unsupported hardware (e.g. sensors-detect -told you so) then it means that you need a more recent kernel, or you -even need to wait for a new kernel driver to be written. Updating the -lm-sensors package itself will not help. - - -LIBSENSORS ----------- - -The kernel drivers communicate their information through the /sys -interface. Because every motherboard is different, the drivers always -advert the measurements at their pins. This means that the values they -report are not always immediately relevant to you. They have to be -labelled properly, and sometimes they must be scaled to correspond to -real-world values. - -libsensors is a (shared or static) library of access functions. It -offers a simple-to-use interface for applications to access the sensor -chip readings and configure them as you like. It has a configuration -file where you can put all the motherboard-specific labels and -conversion rules. That way, all applications do not need to duplicate -the effort and can simply link with libsensors and work out of the box. - - -APPLICATIONS ------------- - -This package contains an example console program that reports all current -sensors values. This program is called 'sensors'. You can use it as a -reference implementation for more intricate programs. It also contains a -daemon watching for sensor values, logging alarms and feeding an RRD -database with the sensor measurements. - -This package does not contain a nice graphical monitor. See -http://sensors-applet.sourceforge.net/ -https://01.org/powertop/ -https://wpitchoune.net/psensor/ -https://amanusk.github.io/s-tui/ -for such programs. - - -TROUBLESHOOTING ---------------- - -lm-sensors is blamed for all kinds of problems on a regular basis. -While it is always possible that lm-sensors does in fact have a problem, -almost everytime the problem will be elsewhere. The most likely culprit -for a problem is one of the kernel drivers providing data to lm-sensors -or, rather, the sensors command (and libsensors). If you encounter problems, -the following tests are recommended. - -- Check enabled sensors with the 'sensors' command. Observe and, if there - are errors, write down your test steps and report. -- If any problems are observed while running the 'sensors' command, disable - (unload) kernel drivers one after another. After unloading a driver, run - the 'sensors' command again and observe if the error is gone. If it is, - you found the problematic driver. Record your tests and report to the driver - maintainer. -- If problems are observed while using libsensors from another application, - the same procedure applies (though it is recommended to perform the test - with the sensors command first). Again, after identifying the offending - driver, record and report your results to the driver maintainer. -- If this does not help, try to run ptrace on the sensors command and/or - the application using libsensors. If you find any anomalies, record - your results and report. - - -OTHER INFORMATION ------------------ - -The lm_sensors website can be found at -https://hwmon.wiki.kernel.org/lm_sensors - -The developers of this package can be reached using -* a mailing list lm-sensors vger kernel org - (you can get information on how to subscribe, unsubscribe, and the list - of archives at http://vger.kernel.org/vger-lists.html#lm-sensors; - you do not need to be subscribed to post to the list) -* GitHub (see https://github.com/lm-sensors/lm-sensors) - -Do not hesitate to contact us if you have questions, suggestions, problems, -want to contribute, or just want to report it works for you. But please try to -read the documentation before you ask any questions! It's all under doc/. - -The latest version of this package can always be found at: -https://github.com/lm-sensors/lm-sensors. - -LICENSE -------- - -The library (libsensors) is released under the GNU Lesser General Public -License (LGPL), as included in the file COPYING.LGPL. The rest of this -package may be distributed according to the GNU General Public License -(GPL), as included in the file COPYING. diff --git a/README.md b/README.md new file mode 100644 index 00000000..c40c0c85 --- /dev/null +++ b/README.md @@ -0,0 +1,141 @@ +# lm-sensors + +The lm-sensors package, version 3, provides user-space support for the +hardware monitoring drivers in Linux 2.6.5 and later. For older kernel +versions, you have to use lm-sensors version 2. + +## Directory Structure + +| Directory | Description | +|-----------|-------------| +| `doc` | Documentation. | +| `etc` | A sample configuration file for libsensors, and a script to convert lm-sensors version 2 configuration files to work with version 3. | +| `lib` | The user-space sensors support library code (libsensors). | +| `prog` | Several supporting programs (see below). | +| `configs` | Sample configurations of various boards, contributed by users of lm-sensors. | + +### Programs (`prog`) + +- **sensors-detect** β€” A stand-alone program for detecting installed + hardware and recommending specific modules to load. +- **sensors** β€” A console tool to report sensor readings and set new + sensor limits. +- **sensord** β€” A daemon to watch sensor values and log problems. It + includes RRD support. + +### Configurations (`configs`) + +All configuration files should now be imported from the old +www.lm-sensors.org website, however additional information about +the origin of the configuration files can be found on the +[old site (archived)](http://web.archive.org/web/20150901092438/http://www.lm-sensors.org:80/wiki/Configurations). + +Please contribute back a configuration of your board so other users with +the same hardware won't need to recreate it again and again. + +## Installing + +See the [INSTALL](INSTALL) file. + +## Hardware Support + +To find out what hardware you have, just run `sensors-detect` as root. + +Most modern mainboards incorporate some form of hardware monitoring chips. +These chips read things like chip temperatures, fan rotation speeds and +voltage levels. There are quite a few different chips which can be used by +mainboard builders for approximately the same results. + +Laptops, on the other hand, rarely expose any hardware monitoring +chip. They often have some BIOS and/or ACPI magic to get the CPU +temperature value, but that's about it. For such laptops, the lm-sensors +package is of no use (`sensors-detect` will not find anything), and you have +to use acpi instead. + +This package doesn't contain chip-specific knowledge. It will support all +the hardware monitoring chips your kernel has drivers for. In other words, +if you find out that you have unsupported hardware (e.g. `sensors-detect` +told you so) then it means that you need a more recent kernel, or you +even need to wait for a new kernel driver to be written. Updating the +lm-sensors package itself will not help. + +## libsensors + +The kernel drivers communicate their information through the `/sys` +interface. Because every motherboard is different, the drivers always +advert the measurements at their pins. This means that the values they +report are not always immediately relevant to you. They have to be +labelled properly, and sometimes they must be scaled to correspond to +real-world values. + +libsensors is a (shared or static) library of access functions. It +offers a simple-to-use interface for applications to access the sensor +chip readings and configure them as you like. It has a configuration +file where you can put all the motherboard-specific labels and +conversion rules. That way, all applications do not need to duplicate +the effort and can simply link with libsensors and work out of the box. + +## Applications + +This package contains an example console program that reports all current +sensor values. This program is called `sensors`. You can use it as a +reference implementation for more intricate programs. It also contains a +daemon watching for sensor values, logging alarms and feeding an RRD +database with the sensor measurements. + +This package does not contain a nice graphical monitor. See the following projects: + +- [GNOME Sensors Applet](http://sensors-applet.sourceforge.net/) +- [PowerTOP](https://01.org/powertop/) +- [Psensor](https://wpitchoune.net/psensor/) +- [s-tui](https://amanusk.github.io/s-tui/) + +## Troubleshooting + +lm-sensors is blamed for all kinds of problems on a regular basis. +While it is always possible that lm-sensors does in fact have a problem, +almost every time the problem will be elsewhere. The most likely culprit +for a problem is one of the kernel drivers providing data to lm-sensors +or, rather, the `sensors` command (and libsensors). If you encounter problems, +the following tests are recommended. + +1. Check enabled sensors with the `sensors` command. Observe and, if there + are errors, write down your test steps and report. +2. If any problems are observed while running the `sensors` command, disable + (unload) kernel drivers one after another. After unloading a driver, run + the `sensors` command again and observe if the error is gone. If it is, + you found the problematic driver. Record your tests and report to the driver + maintainer. +3. If problems are observed while using libsensors from another application, + the same procedure applies (though it is recommended to perform the test + with the `sensors` command first). Again, after identifying the offending + driver, record and report your results to the driver maintainer. +4. If this does not help, try to run `strace` on the `sensors` command and/or + the application using libsensors. If you find any anomalies, record + your results and report. + +## Other Information + +The lm_sensors website can be found at +. + +The developers of this package can be reached through: + +- **Mailing list:** lm-sensors@vger.kernel.org + ([subscription info and archives](http://vger.kernel.org/vger-lists.html#lm-sensors); + you do not need to be subscribed to post) +- **GitHub:** + +Do not hesitate to contact us if you have questions, suggestions, problems, +want to contribute, or just want to report it works for you. But please try to +read the documentation before you ask any questions! It's all under `doc/`. + +The latest version of this package can always be found at: + + +## License + +The library (libsensors) is released under the GNU Lesser General Public +License (LGPL), as included in the file [COPYING.LGPL](COPYING.LGPL). The rest of this +package may be distributed according to the GNU General Public License +(GPL), as included in the file [COPYING](COPYING).