diff options
author | Bian Naimeng <biannm@cn.fujitsu.com> | 2015-02-15 14:45:56 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2015-02-27 09:35:51 +0100 |
commit | bea242bbeed7a635da5175550083a197d7b91bcf (patch) | |
tree | 4dc091e4ea7cef64a7180381a0e7264de1611ecb /meta-oe | |
parent | 728cc037c38933f25d086638ebd52bcaa8c8aa3b (diff) | |
download | meta-openembedded-bea242bbeed7a635da5175550083a197d7b91bcf.tar.gz |
lmsensors: add systemd supported.
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r-- | meta-oe/recipes-support/lm_sensors/lmsensors/sensord.service | 11 | ||||
-rw-r--r-- | meta-oe/recipes-support/lm_sensors/lmsensors_3.3.5.bb | 19 |
2 files changed, 28 insertions, 2 deletions
diff --git a/meta-oe/recipes-support/lm_sensors/lmsensors/sensord.service b/meta-oe/recipes-support/lm_sensors/lmsensors/sensord.service new file mode 100644 index 000000000..4836d8ff0 --- /dev/null +++ b/meta-oe/recipes-support/lm_sensors/lmsensors/sensord.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Sensor Information Logging | ||
3 | |||
4 | [Service] | ||
5 | Type=forking | ||
6 | EnvironmentFile=-@SYSCONFDIR@/sensord.conf | ||
7 | PIDFile=@LOCALSTATEDIR@/run/sensord.pid | ||
8 | ExecStart=@SBINDIR@/sensord $SENSORD_ARGS | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-oe/recipes-support/lm_sensors/lmsensors_3.3.5.bb b/meta-oe/recipes-support/lm_sensors/lmsensors_3.3.5.bb index 113c6fccf..d2cd31716 100644 --- a/meta-oe/recipes-support/lm_sensors/lmsensors_3.3.5.bb +++ b/meta-oe/recipes-support/lm_sensors/lmsensors_3.3.5.bb | |||
@@ -10,11 +10,12 @@ DEPENDS = "sysfsutils virtual/libiconv bison-native flex-native rrdtool" | |||
10 | SRC_URI = "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-${PV}.tar.bz2 \ | 10 | SRC_URI = "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-${PV}.tar.bz2 \ |
11 | file://fancontrol.init \ | 11 | file://fancontrol.init \ |
12 | file://sensord.init \ | 12 | file://sensord.init \ |
13 | file://sensord.service \ | ||
13 | " | 14 | " |
14 | SRC_URI[md5sum] = "da506dedceb41822e64865f6ba34828a" | 15 | SRC_URI[md5sum] = "da506dedceb41822e64865f6ba34828a" |
15 | SRC_URI[sha256sum] = "5dae6a665e1150159a93743c4ff1943a7efe02cd9d3bb12c4805e7d7adcf4fcf" | 16 | SRC_URI[sha256sum] = "5dae6a665e1150159a93743c4ff1943a7efe02cd9d3bb12c4805e7d7adcf4fcf" |
16 | 17 | ||
17 | inherit update-rc.d | 18 | inherit update-rc.d systemd |
18 | 19 | ||
19 | RDEPENDS_${PN}-dev = "" | 20 | RDEPENDS_${PN}-dev = "" |
20 | 21 | ||
@@ -24,6 +25,10 @@ INITSCRIPT_NAME_${PN}-sensord = "sensord" | |||
24 | INITSCRIPT_PARAMS_${PN}-fancontrol = "defaults 66" | 25 | INITSCRIPT_PARAMS_${PN}-fancontrol = "defaults 66" |
25 | INITSCRIPT_PARAMS_${PN}-sensord = "defaults 67" | 26 | INITSCRIPT_PARAMS_${PN}-sensord = "defaults 67" |
26 | 27 | ||
28 | SYSTEMD_PACKAGES = "${PN}-sensord" | ||
29 | SYSTEMD_SERVICE_${PN}-sensord = "sensord.service" | ||
30 | SYSTEMD_AUTO_ENABLE = "disable" | ||
31 | |||
27 | S = "${WORKDIR}/lm_sensors-${PV}" | 32 | S = "${WORKDIR}/lm_sensors-${PV}" |
28 | 33 | ||
29 | EXTRA_OEMAKE = 'LINUX=${STAGING_KERNEL_DIR} EXLDFLAGS="${LDFLAGS}" \ | 34 | EXTRA_OEMAKE = 'LINUX=${STAGING_KERNEL_DIR} EXLDFLAGS="${LDFLAGS}" \ |
@@ -49,6 +54,16 @@ do_install() { | |||
49 | 54 | ||
50 | # Install sensord init script | 55 | # Install sensord init script |
51 | install -m 0755 ${WORKDIR}/sensord.init ${D}${sysconfdir}/init.d/sensord | 56 | install -m 0755 ${WORKDIR}/sensord.init ${D}${sysconfdir}/init.d/sensord |
57 | |||
58 | # Insall sensord service script | ||
59 | if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
60 | install -d ${D}${systemd_unitdir}/system | ||
61 | install -m 0644 ${WORKDIR}/sensord.service ${D}${systemd_unitdir}/system | ||
62 | |||
63 | sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/sensord.service | ||
64 | sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/sensord.service | ||
65 | sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/sensord.service | ||
66 | fi | ||
52 | } | 67 | } |
53 | 68 | ||
54 | # libsensors packages | 69 | # libsensors packages |
@@ -90,7 +105,7 @@ FILES_${PN}-sensors-doc = "${mandir}/man1 ${mandir}/man5" | |||
90 | RDEPENDS_${PN}-sensors = "${PN}-libsensors" | 105 | RDEPENDS_${PN}-sensors = "${PN}-libsensors" |
91 | 106 | ||
92 | # sensord logging daemon | 107 | # sensord logging daemon |
93 | FILES_${PN}-sensord = "${sbindir}/sensord ${sysconfdir}/init.d/sensord" | 108 | FILES_${PN}-sensord = "${sbindir}/sensord ${sysconfdir}/init.d/sensord ${systemd_unitdir}/system/sensord.service" |
94 | FILES_${PN}-sensord-dbg = "${bindir}/.debug/sensord" | 109 | FILES_${PN}-sensord-dbg = "${bindir}/.debug/sensord" |
95 | FILES_${PN}-sensord-doc = "${mandir}/man8/sensord.8" | 110 | FILES_${PN}-sensord-doc = "${mandir}/man8/sensord.8" |
96 | RDEPENDS_${PN}-sensord = "${PN}-sensors rrdtool" | 111 | RDEPENDS_${PN}-sensord = "${PN}-sensors rrdtool" |