summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhenhua Luo <b19537@freescale.com>2011-12-16 14:19:23 +0000
committerKoen Kooi <koen@dominion.thruhere.net>2011-12-16 15:38:14 +0100
commit7fd47b69000367319886af45151581c0ecd88310 (patch)
tree1c9a1274c1194fb1ad4d949286ccdc1b87c42cd7
parent3c76c8c4a5ca8793146ce2eaf98048d501b9c8be (diff)
downloadmeta-openembedded-7fd47b69000367319886af45151581c0ecd88310.tar.gz
rng-tools: add
Random number generator daemo. Signed-off-by: Zhenhua Luo <b19537@freescale.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
-rw-r--r--meta-oe/recipes-support/rng-tools/files/default2
-rw-r--r--meta-oe/recipes-support/rng-tools/files/init49
-rw-r--r--meta-oe/recipes-support/rng-tools/rng-tools_2.bb26
3 files changed, 77 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/rng-tools/files/default b/meta-oe/recipes-support/rng-tools/files/default
new file mode 100644
index 000000000..ab7cd9327
--- /dev/null
+++ b/meta-oe/recipes-support/rng-tools/files/default
@@ -0,0 +1,2 @@
1# Specify rng device
2RNG_DEVICE=/dev/hwrng
diff --git a/meta-oe/recipes-support/rng-tools/files/init b/meta-oe/recipes-support/rng-tools/files/init
new file mode 100644
index 000000000..5fa5959a4
--- /dev/null
+++ b/meta-oe/recipes-support/rng-tools/files/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
8rngd=/usr/sbin/rngd
9test -x "$rngd" || exit 1
10
11if [ -e /etc/default/rng-tools ]; then
12 . /etc/default/rng-tools
13fi
14
15if [ -n "$RNG_DEVICE" ]; then
16 EXTRA_ARGS="-- -r $RNG_DEVICE"
17fi
18
19
20case "$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
47esac
48
49exit 0 \ No newline at end of file
diff --git a/meta-oe/recipes-support/rng-tools/rng-tools_2.bb b/meta-oe/recipes-support/rng-tools/rng-tools_2.bb
new file mode 100644
index 000000000..ef753cff8
--- /dev/null
+++ b/meta-oe/recipes-support/rng-tools/rng-tools_2.bb
@@ -0,0 +1,26 @@
1DESCRIPTION = "Random number generator daemon"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
4DEPENDS_append_libc-uclibc = " argp-standalone"
5
6SRC_URI = "http://heanet.dl.sourceforge.net/sourceforge/gkernel/${P}.tar.gz \
7 file://init \
8 file://default"
9
10SRC_URI[md5sum] = "63d503191eabed630324c104cc024475"
11SRC_URI[sha256sum] = "1126f0ecc8cab3af14a562cddc5d8ffeef47df7eba34a7aadcdee35a25ec2b1e"
12
13inherit autotools update-rc.d
14
15do_install_append() {
16 install -d "${D}${sysconfdir}/init.d"
17 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rng-tools
18 sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir},' \
19 ${D}${sysconfdir}/init.d/rng-tools
20
21 install -d "${D}${sysconfdir}/default"
22 install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default
23}
24
25INITSCRIPT_NAME = "rng-tools"
26INITSCRIPT_PARAMS = "defaults"