diff options
author | Saul Wold <sgw@linux.intel.com> | 2016-02-12 10:55:36 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-15 16:28:43 +0000 |
commit | ce3df21122d7fc4ede6fe36009afb297004672ef (patch) | |
tree | bab787be43aaef2830ebb6069917c20d3955a180 /meta | |
parent | 36b43b233c841b3c09fc17e04686b4b758780963 (diff) | |
download | poky-ce3df21122d7fc4ede6fe36009afb297004672ef.tar.gz |
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>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-support/rng-tools/rng-tools/default | 3 | ||||
-rw-r--r-- | meta/recipes-support/rng-tools/rng-tools/init | 49 | ||||
-rw-r--r-- | meta/recipes-support/rng-tools/rng-tools_5.bb | 38 |
3 files changed, 90 insertions, 0 deletions
diff --git a/meta/recipes-support/rng-tools/rng-tools/default b/meta/recipes-support/rng-tools/rng-tools/default new file mode 100644 index 0000000000..7aede9be03 --- /dev/null +++ b/meta/recipes-support/rng-tools/rng-tools/default | |||
@@ -0,0 +1,3 @@ | |||
1 | # Specify rng device | ||
2 | #RNG_DEVICE=/dev/hwrng | ||
3 | RNG_DEVICE=/dev/urandom | ||
diff --git a/meta/recipes-support/rng-tools/rng-tools/init b/meta/recipes-support/rng-tools/rng-tools/init new file mode 100644 index 0000000000..7cf78393a4 --- /dev/null +++ b/meta/recipes-support/rng-tools/rng-tools/init | |||
@@ -0,0 +1,49 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # This is an init script for openembedded | ||
4 | # Copy it to /etc/init.d/rng-tools and type | ||
5 | # > update-rc.d rng-tools defaults 60 | ||
6 | # | ||
7 | |||
8 | rngd=/usr/sbin/rngd | ||
9 | test -x "$rngd" || exit 1 | ||
10 | |||
11 | if [ -e /etc/default/rng-tools ]; then | ||
12 | . /etc/default/rng-tools | ||
13 | fi | ||
14 | |||
15 | if [ -n "$RNG_DEVICE" ]; then | ||
16 | EXTRA_ARGS="-- -r $RNG_DEVICE" | ||
17 | fi | ||
18 | |||
19 | |||
20 | case "$1" in | ||
21 | start) | ||
22 | echo -n "Starting random number generator daemon" | ||
23 | start-stop-daemon -S -q -x $rngd $EXTRA_ARGS | ||
24 | echo "." | ||
25 | ;; | ||
26 | stop) | ||
27 | echo -n "Stopping random number generator daemon" | ||
28 | start-stop-daemon -K -q -n rngd | ||
29 | echo "." | ||
30 | ;; | ||
31 | reload|force-reload) | ||
32 | echo -n "Signalling rng daemon restart" | ||
33 | start-stop-daemon -K -q -s 1 -x $rngd | ||
34 | start-stop-daemon -K -q -s 1 -x $rngd | ||
35 | ;; | ||
36 | restart) | ||
37 | echo -n "Stopping random number generator daemon" | ||
38 | start-stop-daemon -K -q -n rngd | ||
39 | echo "." | ||
40 | echo -n "Starting random number generator daemon" | ||
41 | start-stop-daemon -S -q -x $rngd $EXTRA_ARGS | ||
42 | echo "." | ||
43 | ;; | ||
44 | *) | ||
45 | echo "Usage: /etc/init.d/rng-tools {start|stop|reload|restart|force-reload}" | ||
46 | exit 1 | ||
47 | esac | ||
48 | |||
49 | exit 0 | ||
diff --git a/meta/recipes-support/rng-tools/rng-tools_5.bb b/meta/recipes-support/rng-tools/rng-tools_5.bb new file mode 100644 index 0000000000..67f53f2998 --- /dev/null +++ b/meta/recipes-support/rng-tools/rng-tools_5.bb | |||
@@ -0,0 +1,38 @@ | |||
1 | SUMMARY = "Random number generator daemon" | ||
2 | LICENSE = "GPLv2" | ||
3 | LIC_FILES_CHKSUM = "file://COPYING;md5=0b6f033afe6db235e559456585dc8cdc" | ||
4 | DEPENDS_append_libc-uclibc = " argp-standalone" | ||
5 | |||
6 | SRC_URI = "http://heanet.dl.sourceforge.net/sourceforge/gkernel/${BP}.tar.gz \ | ||
7 | file://init \ | ||
8 | file://default" | ||
9 | |||
10 | SRC_URI[md5sum] = "6726cdc6fae1f5122463f24ae980dd68" | ||
11 | SRC_URI[sha256sum] = "60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e" | ||
12 | |||
13 | # As the recipe doesn't inherit systemd.bbclass, we need to set this variable | ||
14 | # manually to avoid unnecessary postinst/preinst generated. | ||
15 | python () { | ||
16 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): | ||
17 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") | ||
18 | } | ||
19 | |||
20 | inherit autotools update-rc.d | ||
21 | |||
22 | RDEPENDS_${PN} = "libgcrypt" | ||
23 | |||
24 | do_install_append() { | ||
25 | # Only install the init script when 'sysvinit' is in DISTRO_FEATURES. | ||
26 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
27 | install -d "${D}${sysconfdir}/init.d" | ||
28 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rng-tools | ||
29 | sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir}/,' \ | ||
30 | ${D}${sysconfdir}/init.d/rng-tools | ||
31 | |||
32 | install -d "${D}${sysconfdir}/default" | ||
33 | install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/rng-tools | ||
34 | fi | ||
35 | } | ||
36 | |||
37 | INITSCRIPT_NAME = "rng-tools" | ||
38 | INITSCRIPT_PARAMS = "start 30 S . stop 30 0 6 1 ." | ||