aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support
diff options
context:
space:
mode:
authorBian Naimeng <biannm@cn.fujitsu.com>2015-02-15 14:45:56 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2015-02-27 09:35:51 +0100
commitbea242bbeed7a635da5175550083a197d7b91bcf (patch)
tree4dc091e4ea7cef64a7180381a0e7264de1611ecb /meta-oe/recipes-support
parent728cc037c38933f25d086638ebd52bcaa8c8aa3b (diff)
downloadmeta-openembedded-bea242bbeed7a635da5175550083a197d7b91bcf.tar.gz
meta-openembedded-bea242bbeed7a635da5175550083a197d7b91bcf.tar.bz2
meta-openembedded-bea242bbeed7a635da5175550083a197d7b91bcf.zip
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/recipes-support')
-rw-r--r--meta-oe/recipes-support/lm_sensors/lmsensors/sensord.service11
-rw-r--r--meta-oe/recipes-support/lm_sensors/lmsensors_3.3.5.bb19
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 @@
+[Unit]
+Description=Sensor Information Logging
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/sensord.conf
+PIDFile=@LOCALSTATEDIR@/run/sensord.pid
+ExecStart=@SBINDIR@/sensord $SENSORD_ARGS
+
+[Install]
+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"
SRC_URI = "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-${PV}.tar.bz2 \
file://fancontrol.init \
file://sensord.init \
+ file://sensord.service \
"
SRC_URI[md5sum] = "da506dedceb41822e64865f6ba34828a"
SRC_URI[sha256sum] = "5dae6a665e1150159a93743c4ff1943a7efe02cd9d3bb12c4805e7d7adcf4fcf"
-inherit update-rc.d
+inherit update-rc.d systemd
RDEPENDS_${PN}-dev = ""
@@ -24,6 +25,10 @@ INITSCRIPT_NAME_${PN}-sensord = "sensord"
INITSCRIPT_PARAMS_${PN}-fancontrol = "defaults 66"
INITSCRIPT_PARAMS_${PN}-sensord = "defaults 67"
+SYSTEMD_PACKAGES = "${PN}-sensord"
+SYSTEMD_SERVICE_${PN}-sensord = "sensord.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
S = "${WORKDIR}/lm_sensors-${PV}"
EXTRA_OEMAKE = 'LINUX=${STAGING_KERNEL_DIR} EXLDFLAGS="${LDFLAGS}" \
@@ -49,6 +54,16 @@ do_install() {
# Install sensord init script
install -m 0755 ${WORKDIR}/sensord.init ${D}${sysconfdir}/init.d/sensord
+
+ # Insall sensord service script
+ if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/sensord.service ${D}${systemd_unitdir}/system
+
+ sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/sensord.service
+ sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/sensord.service
+ sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/sensord.service
+ fi
}
# libsensors packages
@@ -90,7 +105,7 @@ FILES_${PN}-sensors-doc = "${mandir}/man1 ${mandir}/man5"
RDEPENDS_${PN}-sensors = "${PN}-libsensors"
# sensord logging daemon
-FILES_${PN}-sensord = "${sbindir}/sensord ${sysconfdir}/init.d/sensord"
+FILES_${PN}-sensord = "${sbindir}/sensord ${sysconfdir}/init.d/sensord ${systemd_unitdir}/system/sensord.service"
FILES_${PN}-sensord-dbg = "${bindir}/.debug/sensord"
FILES_${PN}-sensord-doc = "${mandir}/man8/sensord.8"
RDEPENDS_${PN}-sensord = "${PN}-sensors rrdtool"