summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/rng-tools
diff options
context:
space:
mode:
authorDengke Du <dengke.du@windriver.com>2017-08-25 02:14:28 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-27 22:29:44 +0100
commitd374897100ae756df72677d47c9c70c7fefca192 (patch)
tree8f78bc54be97d6ad180e5d2e2672e2db8de9c80d /meta/recipes-support/rng-tools
parenta2b278a6eaa9e9b48d858e3be6712267c0122598 (diff)
downloadopenembedded-core-d374897100ae756df72677d47c9c70c7fefca192.tar.gz
openembedded-core-d374897100ae756df72677d47c9c70c7fefca192.tar.bz2
openembedded-core-d374897100ae756df72677d47c9c70c7fefca192.zip
rng-tools: add systemd service file
Add systemd service file for rng-tools. Signed-off-by: Dengke Du <dengke.du@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/rng-tools')
-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 de6e5f9a76..4a66bed643 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 = "${SOURCEFORGE_MIRROR}/gkernel/${BP}.tar.gz \
file://underquote.patch \
file://rng-tools-5-fix-textrels-on-PIC-x86.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"
@@ -38,7 +40,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"