aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2018-01-15 10:40:18 -0200
committerArmin Kuster <akuster808@gmail.com>2018-01-17 13:42:31 -0800
commit116423c4277ed0121d21c4aaa39fec9c8b58e098 (patch)
treee37c14c209d9a775d96c8b0443f0b2173526bed3
parent0ef53497c30b7d4328f071078ad78c2a19f72320 (diff)
downloadmeta-openembedded-contrib-116423c4277ed0121d21c4aaa39fec9c8b58e098.tar.gz
meta-openembedded-contrib-116423c4277ed0121d21c4aaa39fec9c8b58e098.tar.bz2
meta-openembedded-contrib-116423c4277ed0121d21c4aaa39fec9c8b58e098.zip
haveged: Add sysvinit support
The haveged daemon is also useful on sysvinit-based systems, so we add a init script for this use-case. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rwxr-xr-xmeta-oe/recipes-extended/haveged/haveged/haveged.sysvinit35
-rw-r--r--meta-oe/recipes-extended/haveged/haveged_1.9.1.bb9
2 files changed, 43 insertions, 1 deletions
diff --git a/meta-oe/recipes-extended/haveged/haveged/haveged.sysvinit b/meta-oe/recipes-extended/haveged/haveged/haveged.sysvinit
new file mode 100755
index 0000000000..98b8857e77
--- /dev/null
+++ b/meta-oe/recipes-extended/haveged/haveged/haveged.sysvinit
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+pidfile=/var/run/haveged.pid
+
+# source function library
+. /etc/init.d/functions
+
+case "$1" in
+ start)
+ echo -n "Starting havege entropy daemon... "
+ start-stop-daemon --start --quiet --pidfile $pidfile --name haveged --startas haveged -- -w 1024 -v 0 && success || failure
+ echo
+ ;;
+ stop)
+ echo -n "Stopping havege entropy daemon... "
+ start-stop-daemon --stop --quiet --pidfile $pidfile --name haveged
+ success
+ echo
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ status haveged
+ ;;
+ *)
+ echo "Usage: /etc/init.d/haveged {start|stop|restart|status}"
+ exit 1
+esac
+
+exit 0
diff --git a/meta-oe/recipes-extended/haveged/haveged_1.9.1.bb b/meta-oe/recipes-extended/haveged/haveged_1.9.1.bb
index bb44c41387..419c85f510 100644
--- a/meta-oe/recipes-extended/haveged/haveged_1.9.1.bb
+++ b/meta-oe/recipes-extended/haveged/haveged_1.9.1.bb
@@ -7,12 +7,13 @@ LIC_FILES_CHKSUM="file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
SRC_URI = "http://www.issihosts.com/haveged/haveged-${PV}.tar.gz \
file://remove-systemd-unit-503.patch \
+ file://haveged.sysvinit \
"
SRC_URI[md5sum] = "015ff58cd10607db0e0de60aeca2f5f8"
SRC_URI[sha256sum] = "9c2363ed9542a6784ff08e247182137e71f2ddb79e8e6c1ac4ad50d21ced3715"
-inherit autotools systemd
+inherit autotools update-rc.d systemd
EXTRA_OECONF = "\
--enable-init=service.redhat \
@@ -21,10 +22,16 @@ EXTRA_OECONF = "\
--enable-threads=no \
"
+INITSCRIPT_PACKAGES = "${PN}"
+INITSCRIPT_NAME = "haveged"
+INITSCRIPT_PARAMS_${PN} = "defaults 9"
+
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "haveged.service"
do_install_append() {
+ install -D -m 755 ${WORKDIR}/haveged.sysvinit ${D}${sysconfdir}/init.d/haveged
+
mkdir -p ${D}${systemd_unitdir}/system
install -p -m644 ${B}/init.d/haveged.service ${D}${systemd_unitdir}/system
}