1 |
commit: a35142f9dcb21c96f08207fada56341d0ec8e20a |
2 |
Author: Gokturk Yuksek <gokturk <AT> binghamton <DOT> edu> |
3 |
AuthorDate: Tue Sep 22 10:09:09 2015 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 1 08:08:52 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a35142f9 |
7 |
|
8 |
sys-apps/rng-tools: do not specify rng device in init script #481254 |
9 |
|
10 |
Linux hw_random driver provides a unified interface for multiple RNGs |
11 |
and the RNG source is exposed through /dev/hwrng device node. There is |
12 |
no need for the init script to look for other device nodes under |
13 |
/dev. By default, rngd uses /dev/hwrng as the entropy source, |
14 |
therefore it's not required to specify it on the command line |
15 |
explicitly. |
16 |
|
17 |
The creation of /dev/hwrng requires CONFIG_DEVTMPFS support in the |
18 |
kernel. Due to the way hw_random module is written, some device |
19 |
managers may fail to create /dev/hwrng successfuly. Mdev, for example, |
20 |
incorrectly creates /dev/hw_random instead of /dev/hwrng, mistaking |
21 |
module's own name for the device node's name (see related bug |
22 |
561102). However, per gentoo wiki [1], CONFIG_DEVTMPFS is part of the |
23 |
mdev setup and these systems will have two device nodes |
24 |
(/dev/hw_random and /dev/hwrng) that point to the same device. Even in |
25 |
such setups, rngd will successfuly find /dev/hwrng. |
26 |
|
27 |
[1] https://wiki.gentoo.org/index.php?title=Mdev&oldid=246636 |
28 |
|
29 |
Gentoo-Bug: https://bugs.gentoo.org/481254 |
30 |
|
31 |
Package-Manager: portage-2.2.20.1 |
32 |
|
33 |
sys-apps/rng-tools/rng-tools-5-r2.ebuild | 40 ++++++++++++++++++++++++++++++++ |
34 |
1 file changed, 40 insertions(+) |
35 |
|
36 |
diff --git a/sys-apps/rng-tools/rng-tools-5-r2.ebuild b/sys-apps/rng-tools/rng-tools-5-r2.ebuild |
37 |
new file mode 100644 |
38 |
index 0000000..f32feff |
39 |
--- /dev/null |
40 |
+++ b/sys-apps/rng-tools/rng-tools-5-r2.ebuild |
41 |
@@ -0,0 +1,40 @@ |
42 |
+# Copyright 1999-2015 Gentoo Foundation |
43 |
+# Distributed under the terms of the GNU General Public License v2 |
44 |
+# $Id$ |
45 |
+ |
46 |
+EAPI=5 |
47 |
+ |
48 |
+inherit eutils autotools systemd toolchain-funcs |
49 |
+ |
50 |
+DESCRIPTION="Daemon to use hardware random number generators" |
51 |
+HOMEPAGE="http://gkernel.sourceforge.net/" |
52 |
+SRC_URI="mirror://sourceforge/gkernel/${P}.tar.gz" |
53 |
+ |
54 |
+LICENSE="GPL-2" |
55 |
+SLOT="0" |
56 |
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~x86" |
57 |
+IUSE="selinux" |
58 |
+ |
59 |
+DEPEND="dev-libs/libgcrypt:0 |
60 |
+ dev-libs/libgpg-error" |
61 |
+RDEPEND="${DEPEND} |
62 |
+ selinux? ( sec-policy/selinux-rngd )" |
63 |
+ |
64 |
+src_prepare() { |
65 |
+ echo 'bin_PROGRAMS = randstat' >> contrib/Makefile.am |
66 |
+ epatch "${FILESDIR}"/test-for-argp.patch |
67 |
+ epatch "${FILESDIR}"/${P}-fix-textrels-on-PIC-x86.patch #469962 |
68 |
+ epatch "${FILESDIR}"/${P}-man-fill-watermark.patch #555094 |
69 |
+ epatch "${FILESDIR}"/${P}-man-rng-device.patch #555106 |
70 |
+ eautoreconf |
71 |
+ |
72 |
+ sed -i '/^AR /d' Makefile.in || die |
73 |
+ tc-export AR |
74 |
+} |
75 |
+ |
76 |
+src_install() { |
77 |
+ default |
78 |
+ newinitd "${FILESDIR}"/rngd-initd-r1-4.1 rngd |
79 |
+ newconfd "${FILESDIR}"/rngd-confd-4.1 rngd |
80 |
+ systemd_dounit "${FILESDIR}"/rngd.service |
81 |
+} |