From 3193a453e3a4f3b0d3dde6c25b4cfdc0792e0350 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 16 Apr 2007 13:04:24 +0000 Subject: [PATCH] Add lm-sensors (#1068) SVN-Revision: 6971 --- utils/lm-sensors/Makefile | 54 +++++++++ utils/lm-sensors/files/sensors.conf | 117 ++++++++++++++++++++ utils/lm-sensors/patches/100-Makefile.patch | 44 ++++++++ 3 files changed, 215 insertions(+) create mode 100644 utils/lm-sensors/Makefile create mode 100644 utils/lm-sensors/files/sensors.conf create mode 100644 utils/lm-sensors/patches/100-Makefile.patch diff --git a/utils/lm-sensors/Makefile b/utils/lm-sensors/Makefile new file mode 100644 index 0000000000..974fd408f9 --- /dev/null +++ b/utils/lm-sensors/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id: $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=lm-sensors +PKG_VERSION:=2.10.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=lm_sensors-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://dl.lm-sensors.org/lm-sensors/releases/ +PKG_MD5SUM:=55d77146fbd56c205a9f81d262b9453c +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/lm_sensors-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/lm-sensors + SECTION:=utils + CATEGORY:=Utilities + TITLE:=lm-sensors + DEPENDS:=+sysfsutils + DESCRIPTION:=\ + Utility to read hardware sensor data + URL:=http://www.lm-sensors.org/ +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + KERNELVERSION="$(LINUX_VERSION)" \ + LINUX="$(LINUX_DIR)" \ + CC="$(TARGET_CC)" \ + STAGING_DIR="$(STAGING_DIR)" \ + user +endef + +define Package/lm-sensors/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/lib/libsensors.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/prog/sensors/sensors $(1)/usr/sbin/ + $(CP) $(PKG_BUILD_DIR)/prog/detect/i2cdetect $(1)/usr/sbin/ + $(CP) $(PKG_BUILD_DIR)/prog/detect/sensors-detect $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(CP) files/sensors.conf $(1)/etc/sensors.conf +endef + +$(eval $(call BuildPackage,lm-sensors)) diff --git a/utils/lm-sensors/files/sensors.conf b/utils/lm-sensors/files/sensors.conf new file mode 100644 index 0000000000..505b9d97b8 --- /dev/null +++ b/utils/lm-sensors/files/sensors.conf @@ -0,0 +1,117 @@ +chip "pc87366-*" + +# Soekris net4801 configuration + +# Written by Henrik Brix Andersen +# Latest version can be found at http://www.brixandersen.dk/ + +# The configuration is partly based on the PC87366 datasheet and +# partly borrowed from the env4801 utility by Poul-Henning +# Kamp + +# Datasheet: http://www.winbond.com/PDF/APCsheet/PC87366.pdf +# env4801: http://phk.freebsd.dk/soekris/env4801/ + + +# Voltage inputs + ignore vid + + # Unknown + # label in0 "avi0" + ignore in0 + + + # Core Voltage, +2.0V + label in1 "VCORE" + set in1_min 1.9 + set in1_max 2.1 + + + # VCC, +5.0V + label in2 "VCC" + compute in2 @*2, @/2 + + + # Power Supply Input, +6.0V - +28.0V + label in3 "VPWR" + compute in3 @*20.1, @/20.1 + set in3_min 6.0 + set in3_max 28.0 + + + # +12V + label in4 "+12V" + compute in4 @*4.83, @/4.83 + set in4_min 11 + set in4_max 13 + + + # -12V + label in5 "-12V" + # If in10 on your net4801 doesn't have the 3.3V reference, use this + # compute line instead: + # compute in5 (@-3.3)*19.2+3.3, (@-3.3)/19.2+3.3 + compute in5 (@-in10)*19.2+in10, (@-in10)/19.2+in10 + set in5_min -13 + set in5_max -11 + + + # GND, 0V + label in6 "GND" + set in6_min 0 + set in6_max 0 + + + # Standby Voltage, +3.3V + # Internally divided by 2 + label in7 "Vsb" + compute in7 @*2, @/2 + set in7_min 3.0 + set in7_max 3.6 + + + # Supply Voltage, +3.3V + # Internally divided by 2 + label in8 "Vdd" + compute in8 @*2, @/2 + set in8_min 3.0 + set in8_max 3.6 + + + # Battery Backup Supply Voltage, +3.0V + label in9 "Vbat" + set in9_min 2.4 + set in9_max 3.6 + + + # Analog Supply Voltage, +3.3V + # Internally divided by 2 + label in10 "AVdd" + compute in10 @*2, @/2 + set in10_min 3.0 + set in10_max 3.6 + + +# Temperature inputs + ignore temp1 + ignore temp2 + + # PC87366 Internal Temperature + # PC87366 Recommended Operating Conditions: 0 - 70C + # SC1100 Recommended Operating Conditions: 0 - 85C + label temp3 "Temp" + label temp3_crit "Critical" + set temp3_min 0 + set temp3_max 70 + set temp3_crit 85 + + + ignore temp4 + ignore temp5 + ignore temp6 + + +# Fan inputs + ignore fan1 + ignore fan2 + ignore fan3 diff --git a/utils/lm-sensors/patches/100-Makefile.patch b/utils/lm-sensors/patches/100-Makefile.patch new file mode 100644 index 0000000000..98be7f6ef1 --- /dev/null +++ b/utils/lm-sensors/patches/100-Makefile.patch @@ -0,0 +1,44 @@ +--- lm-sensors-2.10.1.orig/Makefile.orig 2006-09-25 00:30:10.000000000 +0200 ++++ lm-sensors-2.10.1/Makefile 2006-12-09 21:13:50.000000000 +0100 +@@ -45,7 +43,7 @@ + # may be used mistakenly. Note: This should point to the directory + # *above* the linux/ subdirectory, so to /usr/local/include in the + # above example. +-I2C_HEADERS := /usr/local/include ++I2C_HEADERS := $(STAGING_DIR)/usr/include + #I2C_HEADERS := $(LINUX_HEADERS) + + ifneq ($(MAKECMDGOALS),user) +@@ -75,10 +73,10 @@ + DESTDIR := + + # This is the prefix that will be used for almost all directories below. +-PREFIX := /usr/local ++PREFIX := /usr + + # Your C compiler +-CC := gcc ++CC := $(TARGET_CC) + + # This is the main modules directory into which the modules will be installed. + # The magic invocation will return something like this: +@@ -117,7 +115,7 @@ + # library files (both static and shared) will be installed. + LIBDIR := $(PREFIX)/lib + +-EXLDFLAGS := -Wl,-rpath,$(LIBDIR) ++EXLDFLAGS := -Wl,-rpath,$(LIBDIR),-rpath-link,$(STAGING_DIR)/usr/lib + + # 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 +--- lm-sensors-2.10.1.orig/lib/Module.mk 2006-09-25 00:30:10.000000000 +0200 ++++ lm-sensors-2.10.1/lib/Module.mk 2006-12-09 21:14:20.000000000 +0100 +@@ -66,7 +66,7 @@ + # How to create the shared library + ifdef SYSFS_SUPPORT + $(MODULE_DIR)/$(LIBSHLIBNAME): $(LIBSHOBJECTS) +- $(CC) -shared -Wl,-soname,$(LIBSHSONAME) -o $@ $^ -lc -lm -lsysfs ++ $(CC) -shared -L$(STAGING_DIR)/usr/lib -Wl,-soname,$(LIBSHSONAME) -o $@ $^ -lc -lm -lsysfs + else + $(MODULE_DIR)/$(LIBSHLIBNAME): $(LIBSHOBJECTS) + $(CC) -shared -Wl,-soname,$(LIBSHSONAME) -o $@ $^ -lc -lm -- 2.30.2