summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDengke Du <dengke.du@windriver.com>2016-09-29 15:32:18 +0800
committerDengke Du <dengke.du@windriver.com>2016-09-30 00:55:42 -0400
commit65f138952d1e0942e73bea4eca028650439bbfc9 (patch)
treef0dd2a7e2e7dd13034ae99b55f7778fa960d07e3
parent5d8a968ecdf40babe452b0ac63d94a7a163710ae (diff)
downloadopenembedded-core-contrib-dengke/add-systemd-service-for-rng_tools.tar.gz
openembedded-core-contrib-dengke/add-systemd-service-for-rng_tools.tar.bz2
openembedded-core-contrib-dengke/add-systemd-service-for-rng_tools.zip
rng-tools: add systemd service filedengke/add-systemd-service-for-rng_tools
Add systemd service file for rng-tools. Signed-off-by: Dengke Du <dengke.du@windriver.com>
-rw-r--r--meta/recipes-support/rng-tools/rng-tools/rngd.service9
-rw-r--r--meta/recipes-support/rng-tools/rng-tools_5.bb14
2 files changed, 21 insertions, 2 deletions
diff --git a/meta/recipes-support/rng-tools/rng-tools/rngd.service b/meta/recipes-support/rng-tools/rng-tools/rngd.service
new file mode 100644
index 0000000000..b94ad50209
--- /dev/null
+++ b/meta/recipes-support/rng-tools/rng-tools/rngd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Hardware RNG Entropy Gatherer Daemon
+
+[Service]
+ExecStart=@SBINDIR@/rngd -f -r /dev/urandom
+SuccessExitStatus=66
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-support/rng-tools/rng-tools_5.bb b/meta/recipes-support/rng-tools/rng-tools_5.bb
index 913a092fd6..e9786f9016 100644
--- a/meta/recipes-support/rng-tools/rng-tools_5.bb
+++ b/meta/recipes-support/rng-tools/rng-tools_5.bb
@@ -8,7 +8,9 @@ SRC_URI = "http://heanet.dl.sourceforge.net/sourceforge/gkernel/${BP}.tar.gz \
file://underquote.patch \
file://uclibc-libuargp-configure.patch \
file://init \
- file://default"
+ file://default \
+ file://rngd.service \
+"
SRC_URI[md5sum] = "6726cdc6fae1f5122463f24ae980dd68"
SRC_URI[sha256sum] = "60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e"
@@ -20,7 +22,7 @@ python () {
d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
}
-inherit autotools update-rc.d
+inherit autotools update-rc.d systemd
PACKAGECONFIG = "libgcrypt"
PACKAGECONFIG_libc-musl = "libargp"
@@ -40,7 +42,15 @@ do_install_append() {
install -d "${D}${sysconfdir}/default"
install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/rng-tools
fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 644 ${WORKDIR}/rngd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/rngd.service
+ fi
}
INITSCRIPT_NAME = "rng-tools"
INITSCRIPT_PARAMS = "start 30 2 3 4 5 . stop 30 0 6 1 ."
+
+SYSTEMD_SERVICE_${PN} = "rngd.service"