Merge pull request #566 from lm-sensors/development

Update with changes from hramrach/lm_sensors
This commit is contained in:
Michal Suchánek authored and GitHub committed 2026-04-23 11:47:31 +00:00
commit b2117ef3dc
238 files changed
+3607 -266

No files matched your search

+43
View File
@@ -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
+64
View File
@@ -0,0 +1,64 @@
name: 🍥GitHub Action Debian
run-name: ${{ github.event_name }} GitHub Action triggered by ${{ github.actor }} 🎬
on: [pull_request]
jobs:
Run-Tests:
runs-on: ubuntu-latest
steps:
- 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 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: |
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
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
+4
View File
@@ -27,3 +27,7 @@ lib/conf-parse.h
# Patching artifacts
*.orig
*.rej
# editor backup files
*~
+33 -5
View File
@@ -1,7 +1,35 @@
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
git HEAD
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
@@ -86,7 +114,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 +407,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 +557,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 +590,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
+7 -7
View File
@@ -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
+58 -11
View File
@@ -55,7 +55,13 @@ ETCDIR := /etc
# library files (both static and shared) will be installed.
LIBDIR := $(PREFIX)/lib
EXLDFLAGS := -Wl,-rpath,$(LIBDIR)
# 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
# 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
@@ -68,7 +74,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
@@ -85,6 +91,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 :=
@@ -103,10 +112,10 @@ 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
SRCDIRS := lib prog/detect prog/pwm \
# The subdirectories we need to build things in
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))
@@ -160,13 +169,34 @@ ARCFLAGS := $(ALL_CFLAGS)
LIBCPPFLAGS := -DETCDIR="\"$(ETCDIR)\"" $(ALL_CPPFLAGS)
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 <iconv.h>' \
'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
# Make all the default rule
all::
# Include all makefiles for sub-modules
INCLUDEFILES :=
INCLUDEFILES :=
include $(patsubst %,%/Module.mk,$(SRCDIRS))
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),uninstall)
@@ -182,6 +212,23 @@ endif
MANPAGES := $(LIBMAN3FILES) $(LIBMAN5FILES) $(PROGDETECTMAN8FILES) $(PROGDUMPMAN8FILES) \
$(PROGSENSORSMAN1FILES) $(PROGPWMMAN8FILES) prog/sensord/sensord.8
check:: test
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
test-sensors:: prog/sensors/sensors
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::
@echo "*** Important notes:"
@@ -267,21 +314,21 @@ 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
$(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
@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
$(FLEX) $(FLEX_FLAGS) $< > $@
$(FLEX) $(FLEX_FLAGS) -o $@ $<
+129
View File
@@ -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
+161
View File
@@ -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
+110
View File
@@ -0,0 +1,110 @@
#
# 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)
chip "nct6798-isa-02a0"
# 1. voltages
label in0 "CPU Vcore"
set in0_min 0.2
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 fan1"
label fan5 "Chassis fan2"
label fan6 "Chassis fan4"
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
+48
View File
@@ -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
@@ -0,0 +1,43 @@
# Fujitsu Technology Solutions D3402-B1, "Teutates"-Chip
# Contributed by Armin Wolf <W_Armin@gmx.de>
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
+43
View File
@@ -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
+61
View File
@@ -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"
label in1 "DDR VTT"
label in2 "Chipset Core"
# 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 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"
+32
View File
@@ -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
+92
View File
@@ -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
+93
View File
@@ -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
+34
View File
@@ -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"
+53
View File
@@ -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"
+45
View File
@@ -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"
+105
View File
@@ -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
+96
View File
@@ -0,0 +1,96 @@
# Configuration for the Netgear RN3138 / RNR-4B NAS
#
# Chassis identification labels:
# NETGEAR Advanced Network Storage Model No. RNR-4B
# NETGEAR RN3184E-100NES
# 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
+3
View File
@@ -0,0 +1,3 @@
chip "nct6106-isa-*"
label in5 "Vdimm"
+115
View File
@@ -0,0 +1,115 @@
# Config for a Supermicro X8DTL-I
# 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
# 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
# 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.55
set in3_min 1.35
set in3_max 1.55
#+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
#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
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 "DIMM0 Temp"
chip "jc42-i2c-0-18"
label temp1 "DIMM2 Temp"
chip "jc42-i2c-0-1c"
label temp1 "DIMM4 Temp"
+37
View File
@@ -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
+4 -4
View File
@@ -1,8 +1,8 @@
Begin4
Title: lm_sensors
Version: 3.6.0
Entered-date: 2019-10-18
Description: Hardware health monitoring package for Linux. It consists of
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.
Also included is a fan speed control script.
@@ -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-2/lm-sensors-3-6-2.tar.gz
Copying-policy: GPL/LGPL
End
+1 -1
View File
@@ -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)
-1
View File
@@ -1,4 +1,3 @@
fancontrol - automated software based fan speed regulation
+1 -1
View File
@@ -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.
+32
View File
@@ -6,6 +6,38 @@ 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
enum sensors_subfeature_type SENSORS_SUBFEATURE_POWER_MIN
+1 -1
View File
@@ -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.
+2
View File
@@ -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 \
+16 -2
View File
@@ -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
{
@@ -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
}
@@ -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;
}
+12 -1
View File
@@ -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"
@@ -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-*"
+13 -20
View File
@@ -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
@@ -63,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 -Wl,--version-script=$(LIB_DIR)/libsensors.map -Wl,-soname,$(LIBSHSONAME) -o $@ $(LIBSHOBJECTS) $(ALL_LDFLAGS) -lc -lm
$(MODULE_DIR)/$(LIBSHSONAME): $(MODULE_DIR)/$(LIBSHLIBNAME)
$(RM) $@
@@ -79,29 +85,14 @@ $(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.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
# 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)
@@ -131,9 +122,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 '******************************************************************************' ; \
+27 -6
View File
@@ -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;
@@ -221,6 +223,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. */
@@ -371,6 +388,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 */
@@ -414,7 +433,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 +452,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 */
+4 -3
View File
@@ -1,7 +1,7 @@
%{
/*
conf-lex.l - Part of libsensors, a Linux library for reading sensor data.
Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -55,6 +55,7 @@ int sensors_yylineno;
%option nodefault
%option noyywrap
%option nounput
%option noinput
/* All states are exclusive */
@@ -244,7 +245,7 @@ ignore{BLANK}* {
if (! sensors_yylval.name)
sensors_fatal_error("conf-lex.l",
"Allocating a new string");
return NAME;
}
@@ -295,7 +296,7 @@ ignore{BLANK}* {
BEGIN(ERR);
return ERROR;
}
\" {
buffer_add_char("\0");
sensors_yylval.name = strdup(buffer);
+16 -16
View File
@@ -85,7 +85,7 @@ static sensors_chip *current_chip = NULL;
sensors_bus_id bus;
sensors_chip_name chip;
sensors_config_line line;
}
}
%left <nothing> '-' '+'
%left <nothing> '*' '/'
@@ -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");
+26
View File
@@ -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;
@@ -127,6 +128,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 +207,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;
@@ -285,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";
}
+4
View File
@@ -15,6 +15,10 @@ global:
sensors_parse_chip_name;
sensors_set_value;
sensors_snprintf_chip_name;
sensors_temp_type_name;
sensors_get_subfeature_quantity;
sensors_get_quantity_name;
sensors_get_quantity_unit;
sensors_strerror;
sensors_parse_error;
sensors_parse_error_wfn;
+1 -1
View File
@@ -465,7 +465,7 @@ or
.RS
bus
.B NAME NAME NAME
.B NAME NAME
.sp 0
chip
.B NAME\-LIST
+49 -1
View File
@@ -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 0x510
#define SENSORS_CHIP_NAME_PREFIX_ANY NULL
#define SENSORS_CHIP_NAME_ADDR_ANY (-1)
@@ -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)
@@ -143,11 +144,13 @@ 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,
SENSORS_FEATURE_MAX_OTHER,
SENSORS_FEATURE_BEEP_ENABLE = 0x18,
SENSORS_FEATURE_FREQ,
SENSORS_FEATURE_MAX,
SENSORS_FEATURE_UNKNOWN = INT_MAX,
} sensors_feature_type;
@@ -163,6 +166,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 +222,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 +242,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,
@@ -244,6 +253,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,
@@ -251,9 +265,43 @@ 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;
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;
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,
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;
const char *sensors_temp_type_name(sensors_temp_type sens);
/* Data about a single chip feature (or category leader) */
struct sensors_feature {
char *name;
+201 -27
View File
@@ -136,25 +136,11 @@ 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)
double get_type_scaling(sensors_subfeature_type type)
{
/* Multipliers for subfeatures */
switch (type & 0xFF80) {
case SENSORS_SUBFEATURE_IN_INPUT:
case SENSORS_SUBFEATURE_TEMP_INPUT:
case SENSORS_SUBFEATURE_CURR_INPUT:
case SENSORS_SUBFEATURE_HUMIDITY_INPUT:
return 1000;
case SENSORS_SUBFEATURE_FAN_INPUT:
return 1;
case SENSORS_SUBFEATURE_POWER_AVERAGE:
case SENSORS_SUBFEATURE_ENERGY_INPUT:
return 1000000;
}
/* Multipliers for second class subfeatures
that need their own multiplier */
switch (type) {
@@ -162,9 +148,112 @@ 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:
return 1;
break;
}
/* Multipliers for subfeatures */
switch (type & 0xFF80) {
case SENSORS_SUBFEATURE_IN_INPUT:
case SENSORS_SUBFEATURE_TEMP_INPUT:
case SENSORS_SUBFEATURE_CURR_INPUT:
case SENSORS_SUBFEATURE_HUMIDITY_INPUT:
return 1000;
case SENSORS_SUBFEATURE_POWER_AVERAGE:
case SENSORS_SUBFEATURE_ENERGY_INPUT:
return 1000000;
}
return 1;
}
sensors_quantity sensors_get_subfeature_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 SENSORS_QUANTITY_NONE;
case SENSORS_SUBFEATURE_POWER_AVERAGE_INTERVAL:
return SENSORS_QUANTITY_INTERVAL;
case SENSORS_SUBFEATURE_PWM_FREQ:
return SENSORS_QUANTITY_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 SENSORS_QUANTITY_BOOL;
case SENSORS_SUBFEATURE_VID: /* reported in mV and scaled */
case SENSORS_SUBFEATURE_IN_INPUT:
return SENSORS_QUANTITY_VOLTAGE;
case SENSORS_SUBFEATURE_FAN_INPUT:
return SENSORS_QUANTITY_RPM;
case SENSORS_SUBFEATURE_TEMP_INPUT:
return SENSORS_QUANTITY_TEMP;
case SENSORS_SUBFEATURE_POWER_AVERAGE:
return SENSORS_QUANTITY_POWER;
case SENSORS_SUBFEATURE_ENERGY_INPUT:
return SENSORS_QUANTITY_ENERGY;
case SENSORS_SUBFEATURE_CURR_INPUT:
return SENSORS_QUANTITY_CURRENT;
case SENSORS_SUBFEATURE_HUMIDITY_INPUT:
return SENSORS_QUANTITY_VOLTAGE;
case SENSORS_SUBFEATURE_PWM_IO:
return SENSORS_QUANTITY_PWM;
case SENSORS_SUBFEATURE_FREQ_INPUT:
return SENSORS_QUANTITY_FREQ;
}
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
@@ -181,11 +270,19 @@ 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)
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);
@@ -251,6 +348,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 +387,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 +412,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 }
};
@@ -319,6 +422,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 }
@@ -329,6 +439,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 +454,8 @@ 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 },
{ "pwm%d%c", pwm_matches },
};
/* Return the subfeature type and channel number based on the subfeature
@@ -356,9 +473,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 */
@@ -401,11 +524,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;
@@ -468,6 +591,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:
@@ -606,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 (sysfs_root_env && !result)
fprintf(stderr, "%s: No sensors at %s.\n", sensors_sysfs_mount, hwmon_path);
free(hwmon_path);
return 1;
}
@@ -663,8 +810,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")) {
@@ -692,6 +840,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;
@@ -700,6 +855,25 @@ 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;
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 +914,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 +1012,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");
+1 -1
View File
@@ -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);
+7 -3
View File
@@ -10,15 +10,19 @@ 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
$(CC) -o $@ $(LIB_TEST_SCANNER_OBJS) -Llib $(EXLDFLAGS)
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
$(RM) $(LIB_TEST_DIR)/*.rd $(LIB_TEST_DIR)/*.ro
$(RM) $(LIB_TEST_TARGETS)
clean :: clean-lib-test
+10 -11
View File
@@ -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;
}
-1
View File
@@ -98,4 +98,3 @@ foreach $scenario (@scenarios) {
ok($test->diff_exact(\@stderr, \@experr, \@diff),
"stderr: " . $scenario->{"desc"}) or print @diff;
}
+43
View File
@@ -0,0 +1,43 @@
# Module.mk
# Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
#
# 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))
SHELLCHECKFILES += $(PROGDEBUGTARGETS)
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)
-25
View File
@@ -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
@@ -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
+83
View File
@@ -0,0 +1,83 @@
.\" Copyright 1999 Frodo Looijaard <frodol@dds.nl>
.\" Copyright (C) 2007-2012 Jean Delvare <jdelvare@suse.de>
.\" 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 <chip>-<bus>-<address>
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
+64
View File
@@ -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
+50
View File
@@ -0,0 +1,50 @@
.\" Copyright 1999 Frodo Looijaard <frodol@dds.nl>
.\" Copyright (C) 2007-2012 Jean Delvare <jdelvare@suse.de>
.\" 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
+7 -1
View File
@@ -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,24 @@ 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))
PERL_SOURCES += $(PROGDETECTSBININSTALL)
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
+10
View File
@@ -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
+12 -5
View File
@@ -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.2+git';
use vars qw(@pci_adapters @chip_ids @ipmi_ifs @non_hwmon_chip_ids
$i2c_addresses_to_scan @i2c_byte_cache %opt);
@@ -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",
@@ -3095,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
@@ -3346,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);
}
+2 -2
View File
@@ -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)
+9
View File
@@ -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
+9
View File
@@ -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
+11 -1
View File
@@ -3,10 +3,20 @@ 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
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
+104 -30
View File
@@ -38,7 +38,7 @@
#
#
PIDFILE="/var/run/fancontrol.pid"
PIDFILE="/run/fancontrol.pid"
#DEBUG=1
MAX=255
@@ -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
@@ -297,10 +346,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
@@ -332,6 +390,13 @@ function CheckFiles
return $outdated
}
CHECK_ONLY=false
if [ "$1" == "--check" ]
then
CHECK_ONLY=true
shift
fi
if [ -f "$1" ]
then
LoadConfig $1
@@ -339,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
@@ -490,7 +559,7 @@ function pwmenable()
fi
# enable manual control by fancontrol
echo 1 > $ENABLE 2> /dev/null
if [ $? -ne 0 ]
if [ "$(cat $ENABLE)" -ne 1 ]
then
return 1
fi
@@ -541,7 +610,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"
+13 -3
View File
@@ -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
@@ -49,7 +57,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.
+30 -27
View File
@@ -29,13 +29,14 @@
#
#
LM_VERSION='3.6.0+git'
PIDFILE="/var/run/fancontrol.pid"
LM_VERSION='3.6.2+git'
PIDFILE="/run/fancontrol.pid"
USERDIR=$(pwd)
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
@@ -214,14 +215,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
}
@@ -284,7 +283,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
@@ -452,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"
@@ -614,6 +613,10 @@ function AskPath()
then
FCCONFIG="/etc/fancontrol"
fi
if [ ${FCCONFIG::1} != "/" ]
then
FCCONFIG=$(readlink -f "$USERDIR"/"$FCCONFIG")
fi
}
AskPath
@@ -642,17 +645,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"
@@ -663,7 +666,7 @@ function LoadConfig()
fi
}
LoadConfig $FCCONFIG
LoadConfig "$FCCONFIG"
# $1 = pwm value below which the fan is stopped
function TestMinStart()
@@ -815,8 +818,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'
}
@@ -831,7 +834,7 @@ DEFMINSTOP=100
function filter_cfgvar()
{
echo "$1" | sed -e 's/ /\n/g' \
| egrep "$2" \
| grep -E "$2" \
| sed -e 's/.*=//g'
}
@@ -877,7 +880,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
+2 -2
View File
@@ -41,8 +41,8 @@ INCLUDEFILES += $(PROGSENSORDSOURCES:.c=.rd)
REMOVESENSORDBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGSENSORDTARGETS))
REMOVESENSORDMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORDMAN8DIR)/%,$(PROGSENSORDMAN8FILES))
$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORDSOURCES:.c=.ro) -Llib -lsensors -lrrd
$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBDEP_FOR_PROGS)
$(CC) -o $@ $(PROGSENSORDSOURCES:.c=.ro) $(EXLDFLAGS) -Llib -lsensors -lrrd
all-prog-sensord: $(PROGSENSORDTARGETS)
user :: all-prog-sensord
+2 -2
View File
@@ -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 <file> -- RRD file (default <none>)\n"
" -c, --config-file <file> -- configuration file\n"
" -p, --pid-file <file> -- PID file (default /var/run/sensord.pid)\n"
" -p, --pid-file <file> -- PID file (default /run/sensord.pid)\n"
" -f, --syslog-facility <f> -- syslog facility to use (default local4)\n"
" -g, --rrd-cgi <img-dir> -- output an RRD CGI script and exit\n"
" -a, --load-average -- include load average in RRD file\n"
+3 -1
View File
@@ -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;
+2 -2
View File
@@ -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());
}
+1 -1
View File
@@ -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
+11 -4
View File
@@ -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,24 +37,30 @@ 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)
LIBICONV := $(shell printf '%s\n' \
'#include <iconv.h>' \
'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/$(LIBSHBASENAME)
$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors
$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBDEP_FOR_PROGS)
$(CC) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) $(EXLDFLAGS) -Llib -lsensors -lm
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
+29
View File
@@ -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
}
+168 -24
View File
@@ -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)
@@ -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 = sensors_get_subfeature_quantity(sub->type) == SENSORS_QUANTITY_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;
@@ -93,14 +97,32 @@ void print_chip_json(const sensors_chip_name *name)
"%s!\n", feature->name);
continue;
}
if (cnt > 0)
printf(",\n");
printf(" \"%s\":{\n", label);
if (cnt++)
printf(",");
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 = sensors_get_subfeature_quantity(sub->type) == SENSORS_QUANTITY_TEMP;
if ((err = sensors_get_value(name, sub->number,
&val))) {
fprintf(stderr, "ERROR: Can't get "
@@ -108,25 +130,59 @@ void print_chip_json(const sensors_chip_name *name)
sub->name,
sensors_strerror(err));
} else {
if (subCnt > 0)
printf(",\n");
if (fahrenheit)
if (subCnt++)
printf(",");
if (is_temp && fahrenheit)
val = deg_ctof(val);
printf(" \"%s\": %.3f", sub->name, val);
subCnt++;
if (new_json) {
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);
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 {
printf("(%s)", label);
subCnt++;
if (subCnt++)
printf(",");
printf("\"%s\":NaN", fname);
}
}
free(label);
printf("\n }");
cnt++;
printf("}");
}
if (cnt > 0)
printf("\n");
}
static const char hyst_str[] = "hyst";
@@ -404,13 +460,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");
}
@@ -428,6 +478,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 +636,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 }
};
@@ -754,6 +808,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);
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)
@@ -788,6 +895,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 }
};
@@ -833,6 +942,35 @@ 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;
const char *unit;
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) {
scale_value(&val, &unit);
printf("%4.0f %sHz%*s", val, unit, 2 - (int)strlen(unit), "");
} 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 +1032,12 @@ 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;
case SENSORS_FEATURE_PWM:
print_chip_pwm(name, feature, label_size);
break;
default:
continue;
}
+21 -9
View File
@@ -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 */
@@ -177,16 +178,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\",\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(",");
}
} else {
fprintf(stderr, "Can't get adapter name\n");
}
}
print_chip_json(name);
printf(" }");
printf("}");
}
/* returns 1 on error */
@@ -221,7 +228,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) {
@@ -230,7 +237,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);
@@ -239,7 +246,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;
}
@@ -290,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) {
@@ -327,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;
+1
View File
@@ -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 */
+3 -1
View File
@@ -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"
+411
View File
@@ -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
}
}
}
}
+411
View File
@@ -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.84999999999999
},
"input": {
"quantity": "temperature",
"unit": "°C",
"value": 36.85
},
"label": "Composite",
"max": {
"quantity": "temperature",
"unit": "°C",
"value": 89.84999999999999
},
"min": {
"quantity": "temperature",
"unit": "°C",
"value": -5.15
}
}
}
}
+1
View File
@@ -0,0 +1 @@
../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/PNP0C0A:00/power_supply/BAT1/hwmon0
+1
View File
@@ -0,0 +1 @@
../../devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon1
+1
View File
@@ -0,0 +1 @@
../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/ACPI0003:00/power_supply/ACAD/hwmon2
+1
View File
@@ -0,0 +1 @@
../../devices/virtual/thermal/thermal_zone5/hwmon3
+1
View File
@@ -0,0 +1 @@
../../devices/platform/coretemp.0/hwmon/hwmon4
+1
View File
@@ -0,0 +1 @@
../../devices/virtual/thermal/thermal_zone13/hwmon5
@@ -0,0 +1 @@
../../../../../../../../../class/hwmon
Loaded 100 of 238 files, more files were not shown because too many files have changed in this diff. Show more