mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-09-17 00:08:08 +00:00
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>
This commit is contained in:
parent
3cf446ff20
commit
26d60d24a4
35
meta-oe/recipes-extended/haveged/haveged/haveged.sysvinit
Executable file
35
meta-oe/recipes-extended/haveged/haveged/haveged.sysvinit
Executable file
@ -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
|
||||||
@ -7,12 +7,13 @@ LIC_FILES_CHKSUM="file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
|
|||||||
|
|
||||||
SRC_URI = "http://www.issihosts.com/haveged/haveged-${PV}.tar.gz \
|
SRC_URI = "http://www.issihosts.com/haveged/haveged-${PV}.tar.gz \
|
||||||
file://remove-systemd-unit-503.patch \
|
file://remove-systemd-unit-503.patch \
|
||||||
|
file://haveged.sysvinit \
|
||||||
"
|
"
|
||||||
|
|
||||||
SRC_URI[md5sum] = "015ff58cd10607db0e0de60aeca2f5f8"
|
SRC_URI[md5sum] = "015ff58cd10607db0e0de60aeca2f5f8"
|
||||||
SRC_URI[sha256sum] = "9c2363ed9542a6784ff08e247182137e71f2ddb79e8e6c1ac4ad50d21ced3715"
|
SRC_URI[sha256sum] = "9c2363ed9542a6784ff08e247182137e71f2ddb79e8e6c1ac4ad50d21ced3715"
|
||||||
|
|
||||||
inherit autotools systemd
|
inherit autotools update-rc.d systemd
|
||||||
|
|
||||||
EXTRA_OECONF = "\
|
EXTRA_OECONF = "\
|
||||||
--enable-init=service.redhat \
|
--enable-init=service.redhat \
|
||||||
@ -21,10 +22,16 @@ EXTRA_OECONF = "\
|
|||||||
--enable-threads=no \
|
--enable-threads=no \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
INITSCRIPT_PACKAGES = "${PN}"
|
||||||
|
INITSCRIPT_NAME = "haveged"
|
||||||
|
INITSCRIPT_PARAMS_${PN} = "defaults 9"
|
||||||
|
|
||||||
SYSTEMD_PACKAGES = "${PN}"
|
SYSTEMD_PACKAGES = "${PN}"
|
||||||
SYSTEMD_SERVICE_${PN} = "haveged.service"
|
SYSTEMD_SERVICE_${PN} = "haveged.service"
|
||||||
|
|
||||||
do_install_append() {
|
do_install_append() {
|
||||||
|
install -D -m 755 ${WORKDIR}/haveged.sysvinit ${D}${sysconfdir}/init.d/haveged
|
||||||
|
|
||||||
mkdir -p ${D}${systemd_unitdir}/system
|
mkdir -p ${D}${systemd_unitdir}/system
|
||||||
install -p -m644 ${B}/init.d/haveged.service ${D}${systemd_unitdir}/system
|
install -p -m644 ${B}/init.d/haveged.service ${D}${systemd_unitdir}/system
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user