diff options
author | Marc Ferland <ferlandm@sonatest.com> | 2012-10-19 15:15:34 +0000 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-10-24 08:27:15 +0200 |
commit | c00f3c285c722a480ce9f02bcebc64fd36c1a1b0 (patch) | |
tree | 60e448e4de3efcd1c1fa5675101a453effa29f5e /meta-oe | |
parent | 4a0066557bcf3af2a9516b523efbfba7387db063 (diff) | |
download | meta-openembedded-c00f3c285c722a480ce9f02bcebc64fd36c1a1b0.tar.gz |
lmsensors: Initial commit
The lmsensors project provides hardware health monitoring tools in the
form of kernel drivers, a user-space library and some helper
programs. This recipe provides all the different user-space tools
offered by lmsensors in separete packages. Startup scripts and default
configuration files are also made available through this commit.
The packages consist of (description text from lmsensors documentation):
* lmsensors-libsensors: The user-space sensors support library code.
* lmsensors-sensors: A console tool to report sensor readings and set
new sensor limits.
* lmsensors-sensord: A daemon to watch sensor values and log
problems. It includes RRD support.
* lmsensors-fancontrol: Controls fanspeeds responding to changes on
temperature sensors. Configuration through pwmconfig.
* lmsensors-sensorsdetect: This program tries to detect the available
SMBus adapters and the chips connected to them, as well as Super-I/O
and misc chips.
* lmsensors-sensorsconfconvert: Convert configuration files from
lmsensorsv2 to lmsensorsv3.
* lmsensors-pwmconfig: tests the pwm (pulse width modulation) outputs
of sensors for their effect on the fans and helps to setup the
configfile for fancontrol.
* lmsensors-isatools: This program sets/gets the registers of ISA or
Super-I/O chips.
Signed-off-by: Marc Ferland <ferlandm@sonatest.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe')
7 files changed, 267 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/lm_sensors/files/fancontrol b/meta-oe/recipes-support/lm_sensors/files/fancontrol new file mode 100644 index 0000000000..1f03a2bf2f --- /dev/null +++ b/meta-oe/recipes-support/lm_sensors/files/fancontrol | |||
@@ -0,0 +1,2 @@ | |||
1 | # fancontrol configuration file. | ||
2 | # Place your device specific configuration in this file. | ||
diff --git a/meta-oe/recipes-support/lm_sensors/files/fancontrol.sh b/meta-oe/recipes-support/lm_sensors/files/fancontrol.sh new file mode 100644 index 0000000000..f179310dd2 --- /dev/null +++ b/meta-oe/recipes-support/lm_sensors/files/fancontrol.sh | |||
@@ -0,0 +1,48 @@ | |||
1 | #! /bin/sh | ||
2 | ### BEGIN INIT INFO | ||
3 | # Provides: fancontrol | ||
4 | # Required-Start: $local_fs | ||
5 | # Should-Start: | ||
6 | # Required-Stop: $local_fs | ||
7 | # Should-Stop: | ||
8 | # Default-Start: 2 3 4 5 | ||
9 | # Default-Stop: 0 1 6 | ||
10 | # Short-Description: fancontrol initscript | ||
11 | # Description: Starts and controls the fancontrol daemon | ||
12 | ### END INIT INFO | ||
13 | |||
14 | PATH=/sbin:/usr/sbin:/bin:/usr/bin | ||
15 | |||
16 | DESC="fan control daemon" | ||
17 | NAME="fancontrol" | ||
18 | FANCONTROL=`which $NAME` | ||
19 | |||
20 | . /etc/init.d/functions || exit 1 | ||
21 | |||
22 | # Exit if the package is not installed | ||
23 | [ -x "$FANCONTROL" ] || exit 0 | ||
24 | |||
25 | case "$1" in | ||
26 | start) | ||
27 | echo -n "Starting $DESC: $NAME... " | ||
28 | /sbin/start-stop-daemon -S -x $FANCONTROL -b -- $FANCONTROL_ARGS | ||
29 | echo "done." | ||
30 | ;; | ||
31 | stop) | ||
32 | echo -n "Stopping $DESC: $NAME... " | ||
33 | /sbin/start-stop-daemon -K -x $FANCONTROL | ||
34 | echo "done." | ||
35 | ;; | ||
36 | restart) | ||
37 | echo "Restarting $DESC: $NAME... " | ||
38 | $0 stop | ||
39 | $0 start | ||
40 | echo "done." | ||
41 | ;; | ||
42 | *) | ||
43 | echo "Usage: $0 {start|stop|restart}" | ||
44 | exit 1 | ||
45 | ;; | ||
46 | esac | ||
47 | |||
48 | exit 0 | ||
diff --git a/meta-oe/recipes-support/lm_sensors/files/sensord.cgi b/meta-oe/recipes-support/lm_sensors/files/sensord.cgi new file mode 100644 index 0000000000..b1aad05b6d --- /dev/null +++ b/meta-oe/recipes-support/lm_sensors/files/sensord.cgi | |||
@@ -0,0 +1,10 @@ | |||
1 | #!/usr/bin/rrdcgi | ||
2 | |||
3 | <html> | ||
4 | <head> | ||
5 | <title>sensord</title> | ||
6 | </head> | ||
7 | <body> | ||
8 | Generate a valid sensord.cgi script and install it in your BSP. | ||
9 | </body> | ||
10 | </html> | ||
diff --git a/meta-oe/recipes-support/lm_sensors/files/sensord.conf b/meta-oe/recipes-support/lm_sensors/files/sensord.conf new file mode 100644 index 0000000000..6b48cf6044 --- /dev/null +++ b/meta-oe/recipes-support/lm_sensors/files/sensord.conf | |||
@@ -0,0 +1,16 @@ | |||
1 | # Default sensord configuration file | ||
2 | # Syntax: sensord {options} {chips} | ||
3 | # -i, --interval <time> -- interval between scanning alarms (default 60s) | ||
4 | # -l, --log-interval <time> -- interval between logging sensors (default 30m) | ||
5 | # -t, --rrd-interval <time> -- interval between updating RRD file (default 5m) | ||
6 | # -T, --rrd-no-average -- switch RRD in non-average mode | ||
7 | # -r, --rrd-file <file> -- RRD file (default <none>) | ||
8 | # -c, --config-file <file> -- configuration file | ||
9 | # -p, --pid-file <file> -- PID file (default /var/run/sensord.pid) | ||
10 | # -f, --syslog-facility <f> -- syslog facility to use (default local4) | ||
11 | # -g, --rrd-cgi <img-dir> -- output an RRD CGI script and exit | ||
12 | # -a, --load-average -- include load average in RRD file | ||
13 | # -d, --debug -- display some debug information | ||
14 | # -v, --version -- display version and exit | ||
15 | # -h, --help -- display help and exit | ||
16 | SENSORD_ARGS="-i60s -l30m -t1m -r/var/lib/sensord.rrd -a" | ||
diff --git a/meta-oe/recipes-support/lm_sensors/files/sensord.sh b/meta-oe/recipes-support/lm_sensors/files/sensord.sh new file mode 100644 index 0000000000..5a09cd3cfc --- /dev/null +++ b/meta-oe/recipes-support/lm_sensors/files/sensord.sh | |||
@@ -0,0 +1,49 @@ | |||
1 | #! /bin/sh | ||
2 | ### BEGIN INIT INFO | ||
3 | # Provides: sensord | ||
4 | # Required-Start: $local_fs | ||
5 | # Should-Start: | ||
6 | # Required-Stop: $local_fs | ||
7 | # Should-Stop: | ||
8 | # Default-Start: 2 3 4 5 | ||
9 | # Default-Stop: 0 1 6 | ||
10 | # Short-Description: sensord initscript | ||
11 | # Description: Starts the sensord logging daemon | ||
12 | ### END INIT INFO | ||
13 | |||
14 | PATH=/sbin:/usr/sbin:/bin:/usr/bin | ||
15 | |||
16 | DESC="sensors logging daemon" | ||
17 | NAME="sensord" | ||
18 | SENSORD=`which $NAME` | ||
19 | |||
20 | . /etc/init.d/functions || exit 1 | ||
21 | . /etc/sensord.conf || exit 1 | ||
22 | |||
23 | # Exit if the package is not installed | ||
24 | [ -x "$SENSORD" ] || exit 0 | ||
25 | |||
26 | case "$1" in | ||
27 | start) | ||
28 | echo -n "Starting $DESC: $NAME... " | ||
29 | start-stop-daemon -S -x $SENSORD -- $SENSORD_ARGS | ||
30 | echo "done." | ||
31 | ;; | ||
32 | stop) | ||
33 | echo -n "Stopping $DESC: $NAME... " | ||
34 | start-stop-daemon -K -x $SENSORD | ||
35 | echo "done." | ||
36 | ;; | ||
37 | restart) | ||
38 | echo "Restarting $DESC: $NAME... " | ||
39 | $0 stop | ||
40 | $0 start | ||
41 | echo "done." | ||
42 | ;; | ||
43 | *) | ||
44 | echo "Usage: $0 {start|stop|restart}" | ||
45 | exit 1 | ||
46 | ;; | ||
47 | esac | ||
48 | |||
49 | exit 0 | ||
diff --git a/meta-oe/recipes-support/lm_sensors/files/sensors.conf b/meta-oe/recipes-support/lm_sensors/files/sensors.conf new file mode 100644 index 0000000000..bb8c93de6e --- /dev/null +++ b/meta-oe/recipes-support/lm_sensors/files/sensors.conf | |||
@@ -0,0 +1,2 @@ | |||
1 | # sensors configuration file. | ||
2 | # Place your device specific configuration in this file. | ||
diff --git a/meta-oe/recipes-support/lm_sensors/lmsensors_3.3.2.bb b/meta-oe/recipes-support/lm_sensors/lmsensors_3.3.2.bb new file mode 100644 index 0000000000..5c6c91dd76 --- /dev/null +++ b/meta-oe/recipes-support/lm_sensors/lmsensors_3.3.2.bb | |||
@@ -0,0 +1,140 @@ | |||
1 | SUMMARY = "lm_sensors" | ||
2 | DESCRIPTION = "Hardware health monitoring applications" | ||
3 | HOMEPAGE = "http://www.lm-sensors.org/" | ||
4 | LICENSE = "GPLv2+ & LGPLv2.1+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ | ||
6 | file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c" | ||
7 | |||
8 | DEPENDS = "sysfsutils virtual/libiconv bison-native flex-native rrdtool" | ||
9 | |||
10 | SRC_URI = "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-${PV}.tar.bz2 \ | ||
11 | file://fancontrol \ | ||
12 | file://fancontrol.sh \ | ||
13 | file://sensors.conf \ | ||
14 | file://sensord.conf \ | ||
15 | file://sensord.sh \ | ||
16 | file://sensord.cgi \ | ||
17 | " | ||
18 | |||
19 | SRC_URI[md5sum] = "f357ba00b080ab102a170f7bf8bb2578" | ||
20 | SRC_URI[sha256sum] = "f13dd885406841a7352ccfb8b9ccb23c4c057abe3de4258da5444c149a9e3ae1" | ||
21 | |||
22 | inherit update-rc.d | ||
23 | |||
24 | INITSCRIPT_PACKAGES = "${PN}-fancontrol ${PN}-sensord" | ||
25 | INITSCRIPT_NAME_${PN}-fancontrol = "fancontrol.sh" | ||
26 | INITSCRIPT_NAME_${PN}-sensord = "sensord.sh" | ||
27 | INITSCRIPT_PARAMS_${PN}-fancontrol = "defaults 66" | ||
28 | INITSCRIPT_PARAMS_${PN}-sensord = "defaults 67" | ||
29 | |||
30 | S = "${WORKDIR}/lm_sensors-${PV}" | ||
31 | |||
32 | EXTRA_OEMAKE = 'LINUX=${STAGING_KERNEL_DIR} EXLDFLAGS="${LDFLAGS}" \ | ||
33 | MACHINE=${TARGET_ARCH} PREFIX=${prefix} CC="${CC}" AR="${AR}"' | ||
34 | |||
35 | do_compile() { | ||
36 | oe_runmake user PROG_EXTRA="sensors sensord" | ||
37 | } | ||
38 | |||
39 | do_install() { | ||
40 | oe_runmake user_install DESTDIR=${D} | ||
41 | install -m 0755 ${S}/prog/sensord/sensord ${D}${bindir} | ||
42 | install -m 0644 ${S}/prog/sensord/sensord.8 ${D}/usr/man/man8 | ||
43 | |||
44 | # move manuals into proper place | ||
45 | install -d ${D}${mandir} | ||
46 | rm -rf ${D}${mandir}/* | ||
47 | mv ${D}/usr/man/* ${D}${mandir} | ||
48 | rmdir ${D}/usr/man | ||
49 | |||
50 | # Install directories | ||
51 | install -d ${D}${sysconfdir} | ||
52 | install -d ${D}${sysconfdir}/init.d | ||
53 | install -d ${D}${sysconfdir}/sensors.d | ||
54 | |||
55 | # Install sensors.conf | ||
56 | install -m 0644 ${WORKDIR}/sensors.conf ${D}${sysconfdir}/sensors.d | ||
57 | |||
58 | # Install fancontrol config file | ||
59 | install -m 0644 ${WORKDIR}/fancontrol ${D}${sysconfdir} | ||
60 | |||
61 | # Install fancontrol init script | ||
62 | install -m 0755 ${WORKDIR}/fancontrol.sh ${D}${sysconfdir}/init.d | ||
63 | |||
64 | # Install sensord init script | ||
65 | install -m 0755 ${WORKDIR}/sensord.sh ${D}${sysconfdir}/init.d | ||
66 | install -m 0644 ${WORKDIR}/sensord.conf ${D}${sysconfdir} | ||
67 | |||
68 | # Install sensord.cgi script and create world-writable | ||
69 | # web-accessible sensord directory. | ||
70 | install -d ${D}/www/pages/cgi-bin | ||
71 | install -m 0755 ${WORKDIR}/sensord.cgi ${D}/www/pages/cgi-bin | ||
72 | install -d -m a=rwxs ${D}/www/pages/sensord | ||
73 | } | ||
74 | |||
75 | # libsensors packages | ||
76 | PACKAGES =+ "${PN}-libsensors ${PN}-libsensors-dbg ${PN}-libsensors-dev ${PN}-libsensors-staticdev ${PN}-libsensors-doc" | ||
77 | |||
78 | # sensors command packages | ||
79 | PACKAGES =+ "${PN}-sensors ${PN}-sensors-dbg ${PN}-sensors-doc" | ||
80 | |||
81 | # sensord logging daemon | ||
82 | PACKAGES =+ "${PN}-sensord ${PN}-sensord-dbg ${PN}-sensord-doc" | ||
83 | |||
84 | # fancontrol script | ||
85 | PACKAGES =+ "${PN}-fancontrol ${PN}-fancontrol-doc" | ||
86 | |||
87 | # sensors-detect script | ||
88 | PACKAGES =+ "${PN}-sensorsdetect ${PN}-sensorsdetect-doc" | ||
89 | |||
90 | # sensors-conf-convert script | ||
91 | PACKAGES =+ "${PN}-sensorsconfconvert" | ||
92 | |||
93 | # pwmconfig script | ||
94 | PACKAGES =+ "${PN}-pwmconfig ${PN}-pwmconfig-doc" | ||
95 | |||
96 | # isadump and isaset helper program | ||
97 | PACKAGES =+ "${PN}-isatools ${PN}-isatools-dbg ${PN}-isatools-doc" | ||
98 | |||
99 | # libsensors files | ||
100 | FILES_${PN}-libsensors = "${libdir}/libsensors.so.* ${sysconfdir}/sensors3.conf ${sysconfdir}/sensors.d/sensors.conf" | ||
101 | FILES_${PN}-libsensors-dbg = "${libdir}/.debug ${prefix}/src/debug" | ||
102 | FILES_${PN}-libsensors-dev = "${libdir}/libsensors.so ${includedir}" | ||
103 | FILES_${PN}-libsensors-staticdev = "${libdir}/libsensors.a" | ||
104 | FILES_${PN}-libsensors-doc = "${mandir}/man3" | ||
105 | |||
106 | # sensors command files | ||
107 | FILES_${PN}-sensors = "${bindir}/sensors" | ||
108 | FILES_${PN}-sensors-dbg = "${bindir}/.debug/sensors" | ||
109 | FILES_${PN}-sensors-doc = "${mandir}/man1 ${mandir}/man5" | ||
110 | RDEPENDS_${PN}-sensors = "${PN}-libsensors" | ||
111 | |||
112 | # sensord logging daemon | ||
113 | FILES_${PN}-sensord = "${bindir}/sensord ${sysconfdir}/sensord.conf ${sysconfdir}/init.d/sensord.sh /www/*" | ||
114 | FILES_${PN}-sensord-dbg = "${bindir}/.debug/sensord" | ||
115 | FILES_${PN}-sensord-doc = "${mandir}/man8/sensord.8" | ||
116 | RDEPENDS_${PN}-sensord = "${PN}-sensors rrdtool lighttpd lighttpd-module-cgi" | ||
117 | |||
118 | # fancontrol script files | ||
119 | FILES_${PN}-fancontrol = "${sbindir}/fancontrol ${sysconfdir}/fancontrol ${sysconfdir}/init.d/fancontrol.sh" | ||
120 | FILES_${PN}-fancontrol-doc = "${mandir}/man8/fancontrol.8" | ||
121 | RDEPENDS_${PN}-fancontrol = "bash" | ||
122 | |||
123 | # sensors-detect script files | ||
124 | FILES_${PN}-sensorsdetect = "${sbindir}/sensors-detect" | ||
125 | FILES_${PN}-sensorsdetect-doc = "${mandir}/man8/sensors-detect.8" | ||
126 | RDEPENDS_${PN}-sensorsdetect = "${PN}-sensors perl perl-modules" | ||
127 | |||
128 | # sensors-conf-convert script files | ||
129 | FILES_${PN}-sensorsconfconvert = "${bindir}/sensors-conf-convert" | ||
130 | RDEPENDS_${PN}-sensorsconfconvert = "${PN}-sensors perl perl-modules" | ||
131 | |||
132 | # pwmconfig script files | ||
133 | FILES_${PN}-pwmconfig = "${sbindir}/pwmconfig" | ||
134 | FILES_${PN}-pwmconfig-doc = "${mandir}/man8/pwmconfig.8" | ||
135 | RDEPENDS_${PN}-pwmconfig = "${PN}-fancontrol" | ||
136 | |||
137 | # isadump and isaset helper program files | ||
138 | FILES_${PN}-isatools = "${sbindir}/isa*" | ||
139 | FILES_${PN}-isatools-dbg = "${sbindir}/.debug/isa*" | ||
140 | FILES_${PN}-isatools-doc = "${mandir}/man8/isa*" | ||