mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 05:29:32 +00:00
rng-tools: Import recipe from meta-openembedded
Adding this recipe to oe-core will allow it to be used by qemu to provide a way to generate additional entropy needed to fix hangs with getrandom(). Additional kernel config options have already been added to the default qemu kernel configs. [YOCTO #8681] [YOCOT #8816] (From OE-Core rev: 030bc0b2f9636f5cacef29c939b323569cd5673f) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
36b43b233c
commit
ce3df21122
@@ -0,0 +1,3 @@
|
||||
# Specify rng device
|
||||
#RNG_DEVICE=/dev/hwrng
|
||||
RNG_DEVICE=/dev/urandom
|
||||
@@ -0,0 +1,49 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# This is an init script for openembedded
|
||||
# Copy it to /etc/init.d/rng-tools and type
|
||||
# > update-rc.d rng-tools defaults 60
|
||||
#
|
||||
|
||||
rngd=/usr/sbin/rngd
|
||||
test -x "$rngd" || exit 1
|
||||
|
||||
if [ -e /etc/default/rng-tools ]; then
|
||||
. /etc/default/rng-tools
|
||||
fi
|
||||
|
||||
if [ -n "$RNG_DEVICE" ]; then
|
||||
EXTRA_ARGS="-- -r $RNG_DEVICE"
|
||||
fi
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting random number generator daemon"
|
||||
start-stop-daemon -S -q -x $rngd $EXTRA_ARGS
|
||||
echo "."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping random number generator daemon"
|
||||
start-stop-daemon -K -q -n rngd
|
||||
echo "."
|
||||
;;
|
||||
reload|force-reload)
|
||||
echo -n "Signalling rng daemon restart"
|
||||
start-stop-daemon -K -q -s 1 -x $rngd
|
||||
start-stop-daemon -K -q -s 1 -x $rngd
|
||||
;;
|
||||
restart)
|
||||
echo -n "Stopping random number generator daemon"
|
||||
start-stop-daemon -K -q -n rngd
|
||||
echo "."
|
||||
echo -n "Starting random number generator daemon"
|
||||
start-stop-daemon -S -q -x $rngd $EXTRA_ARGS
|
||||
echo "."
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/rng-tools {start|stop|reload|restart|force-reload}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,38 @@
|
||||
SUMMARY = "Random number generator daemon"
|
||||
LICENSE = "GPLv2"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=0b6f033afe6db235e559456585dc8cdc"
|
||||
DEPENDS_append_libc-uclibc = " argp-standalone"
|
||||
|
||||
SRC_URI = "http://heanet.dl.sourceforge.net/sourceforge/gkernel/${BP}.tar.gz \
|
||||
file://init \
|
||||
file://default"
|
||||
|
||||
SRC_URI[md5sum] = "6726cdc6fae1f5122463f24ae980dd68"
|
||||
SRC_URI[sha256sum] = "60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e"
|
||||
|
||||
# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
|
||||
# manually to avoid unnecessary postinst/preinst generated.
|
||||
python () {
|
||||
if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
|
||||
d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
|
||||
}
|
||||
|
||||
inherit autotools update-rc.d
|
||||
|
||||
RDEPENDS_${PN} = "libgcrypt"
|
||||
|
||||
do_install_append() {
|
||||
# Only install the init script when 'sysvinit' is in DISTRO_FEATURES.
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
|
||||
install -d "${D}${sysconfdir}/init.d"
|
||||
install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rng-tools
|
||||
sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir}/,' \
|
||||
${D}${sysconfdir}/init.d/rng-tools
|
||||
|
||||
install -d "${D}${sysconfdir}/default"
|
||||
install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/rng-tools
|
||||
fi
|
||||
}
|
||||
|
||||
INITSCRIPT_NAME = "rng-tools"
|
||||
INITSCRIPT_PARAMS = "start 30 S . stop 30 0 6 1 ."
|
||||
Reference in New Issue
Block a user