diff options
author | 2014-10-21 16:21:54 +0200 | |
---|---|---|
committer | 2014-10-21 16:21:54 +0200 | |
commit | 954bea4f442f98fc8c32872662cce0bca8754e72 (patch) | |
tree | 81152baf9ed93a96e1ab51f591fd9f319ce30cab | |
parent | Updating EAPI (diff) | |
download | klondike-954bea4f442f98fc8c32872662cce0bca8754e72.tar.gz klondike-954bea4f442f98fc8c32872662cce0bca8754e72.tar.bz2 klondike-954bea4f442f98fc8c32872662cce0bca8754e72.zip |
Add PIC version of sys-apps/rng-tools
Package-Manager: portage-2.2.8-r2
Manifest-Sign-Key: 0xA5C1A1D24B128E52
-rw-r--r-- | sys-apps/rng-tools/ChangeLog | 224 | ||||
-rw-r--r-- | sys-apps/rng-tools/Manifest | 23 | ||||
-rw-r--r-- | sys-apps/rng-tools/files/rng-tools-5-fix-textrels-on-PIC-x86.patch | 100 | ||||
-rw-r--r-- | sys-apps/rng-tools/files/rngd-confd-4.1 | 22 | ||||
-rw-r--r-- | sys-apps/rng-tools/files/rngd-initd-4.1 | 29 | ||||
-rw-r--r-- | sys-apps/rng-tools/files/rngd.service | 8 | ||||
-rw-r--r-- | sys-apps/rng-tools/files/test-for-argp.patch | 43 | ||||
-rw-r--r-- | sys-apps/rng-tools/metadata.xml | 5 | ||||
-rw-r--r-- | sys-apps/rng-tools/rng-tools-5.ebuild | 36 |
9 files changed, 490 insertions, 0 deletions
diff --git a/sys-apps/rng-tools/ChangeLog b/sys-apps/rng-tools/ChangeLog new file mode 100644 index 0000000..56ec5e0 --- /dev/null +++ b/sys-apps/rng-tools/ChangeLog @@ -0,0 +1,224 @@ +# ChangeLog for sys-apps/rng-tools +# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/ChangeLog,v 1.50 2014/08/10 20:25:06 slyfox Exp $ + + 10 Aug 2014; Sergei Trofimovich <slyfox@gentoo.org> rng-tools-2-r1.ebuild, + rng-tools-3-r1.ebuild, rng-tools-3.ebuild: + QA: drop trailing '.' from DESCRIPTION + +*rng-tools-4-r7 (24 May 2014) + + 24 May 2014; Pacho Ramos <pacho@gentoo.org> +files/rngd.service, + +rng-tools-4-r7.ebuild: + Add unit file (#510826 by Salah Coronya) + + 16 Dec 2013; Sven Vermeulen <swift@gentoo.org> rng-tools-4-r5.ebuild, + rng-tools-4-r6.ebuild: + Adding dependency to selinux-rngd + + 22 May 2013; Mike Frysinger <vapier@gentoo.org> files/rngd-initd-3, + files/rngd-initd-4, files/rngd-initd-4.1: + Change the after clause from "random" (which does not seem to have ever + existed) to "urandom" (which has been around since very old baselayout-1 days) + #470014 by Roman Žilka. + +*rng-tools-4-r6 (15 May 2013) + + 15 May 2013; Anthony G. Basile <blueness@gentoo.org> + +files/fix-textrels-on-PIC-x86.patch, +rng-tools-4-r6.ebuild: + Fix assemby textrels on rdrand_asm.S on PIC x86, bug #469962 + + 14 May 2013; Agostino Sarubbo <ago@gentoo.org> rng-tools-4-r5.ebuild: + Stable for x86, wrt bug #458826 + + 07 May 2013; Agostino Sarubbo <ago@gentoo.org> rng-tools-4-r5.ebuild: + Stable for ia64, wrt bug #458826 + + 05 May 2013; Agostino Sarubbo <ago@gentoo.org> rng-tools-4-r5.ebuild: + Stable for alpha, wrt bug #458826 + + 03 May 2013; Agostino Sarubbo <ago@gentoo.org> rng-tools-4-r5.ebuild: + Stable for ppc, wrt bug #458826 + + 02 May 2013; Agostino Sarubbo <ago@gentoo.org> rng-tools-4-r5.ebuild: + Stable for amd64, wrt bug #458826 + + 24 Dec 2012; Diego E. Pettenò <flameeyes@gentoo.org> files/rngd-initd-4.1: + Fix typo. Thanks to Chris Mayo for reporting. + + 17 Dec 2012; Diego E. Pettenò <flameeyes@gentoo.org> files/rngd-confd-4.1, + files/rngd-initd-4.1: + Remove direct uses of /dev/urandom — if the user wants to, they can do it + explicitly; also update the upper limit for the watermark in the comment so + that users know to check the poolsize (hardened can be much bigger than 4k). + No revision bump since it's non-default behaviour anyway. + +*rng-tools-4-r5 (17 Dec 2012) + + 17 Dec 2012; Diego E. Pettenò <flameeyes@gentoo.org> +rng-tools-4-r5.ebuild, + -rng-tools-4-r4.ebuild, files/rngd-initd-4.1: + Handle NO_TPM the way NO_DRNG is handled, as otherwise it can fail the same + way. + +*rng-tools-4-r4 (16 Dec 2012) + + 16 Dec 2012; Diego E. Pettenò <flameeyes@gentoo.org> +rng-tools-4-r4.ebuild, + -rng-tools-4-r3.ebuild, files/rngd-initd-4.1: + Fix init script also when using an actual RNG device. Closes bug #447464 by + Toralf Förster. + + 16 Dec 2012; Pacho Ramos <pacho@gentoo.org> metadata.xml: + Cleanup due retirement, #95685 + +*rng-tools-4-r3 (16 Dec 2012) + + 16 Dec 2012; Diego E. Pettenò <flameeyes@gentoo.org> +rng-tools-4-r3.ebuild, + -rng-tools-4-r2.ebuild, files/rngd-confd-4.1, files/rngd-initd-4.1: + More fixes to the init script if there is no device at all. Also fix handling + of rdrand, as --no-drng=0 misbehaves. + +*rng-tools-4-r2 (16 Dec 2012) + + 16 Dec 2012; Diego E. Pettenò <flameeyes@gentoo.org> +files/rngd-confd-4.1, + +files/rngd-initd-4.1, +rng-tools-4-r2.ebuild: + Update init script so that OpenRC can check on the daemon, also fix stop with + rdrand-capable CPUs (bug #442238), and disallow /dev/urandom mixin by default + (bug #292239). The init script no longer tries to second-guess the + configuration parameters, leaving the erroring out for missing sources to rngd + itself, as it was broken and would have caused more trouble when rdrand is + present. + +*rng-tools-4-r1 (11 Nov 2012) + + 11 Nov 2012; Mike Frysinger <vapier@gentoo.org> +files/rngd-confd-4, + +files/rngd-initd-4, +rng-tools-4-r1.ebuild, -rng-tools-4.ebuild: + Update init.d script to match latest version #442036 by Manuel Rüger. + +*rng-tools-4 (06 Nov 2012) + + 06 Nov 2012; Mike Frysinger <vapier@gentoo.org> +rng-tools-4.ebuild: + Version bump #438648 by Manuel Rüger. + +*rng-tools-3-r1 (19 Jul 2012) + + 19 Jul 2012; Anthony G. Basile <blueness@gentoo.org> +rng-tools-3-r1.ebuild, + +files/test-for-argp.patch: + Patch configure.ac to search for arpg in glibc or libargp, bug #292191 + +*rng-tools-3 (08 Nov 2010) + + 08 Nov 2010; Krzysztof Pawlik <nelchael@gentoo.org> + -rng-tools-2-r2.ebuild, -rng-tools-2-r3.ebuild, +files/rngd-confd-3, + -files/2-r2/rngd, +files/rngd-initd-3, +rng-tools-3.ebuild, + -files/2-r2/rngd-conf, -files/rngd_tpm_support.patch, + -files/rngd_tpm_support2.patch: + Version bump, remove old versions. rng-tools-3 contains support for TPM + devices. + + 15 Sep 2010; Robin H. Johnson <robbat2@gentoo.org> files/2-r2/rngd, + files/2-r2/rngd-conf: + Bug #292239: Make remix of /dev/urandom optional. + +*rng-tools-2-r3 (15 Sep 2010) + + 15 Sep 2010; Robin H. Johnson <robbat2@gentoo.org> + +files/rngd_tpm_support2.patch, +rng-tools-2-r3.ebuild: + New spin of the TPM patch that does not fail when TPM hardware is not + present. + +*rng-tools-2-r2 (10 Nov 2009) + + 10 Nov 2009; Robin H. Johnson <robbat2@gentoo.org> +rng-tools-2-r2.ebuild, + +files/2-r2/rngd, +files/2-r2/rngd-conf: + Add support to use TPM devices as RNG sources per Matt Domsch: + http://domsch.com/blog/?p=107. Also clean up the init script. + + 04 Sep 2009; William Hubbs <williamh@gentoo.org> -rng-tools-2.ebuild: + removed old version + +*rng-tools-2-r1 (03 Sep 2009) + + 03 Sep 2009; William Hubbs <williamh@gentoo.org> +rng-tools-2-r1.ebuild: + rev bump per robbat2 so that all users will pick up the patch. + + 15 Jul 2009; Krzysiek Pawlik <nelchael@gentoo.org> files/2/rngd: + Check /dev/hwrng, see bug #276973. + + 21 Mar 2009; Krzysiek Pawlik <nelchael@gentoo.org> rng-tools-2.ebuild: + Fix QA warnings. + + 16 Jun 2008; Krzysiek Pawlik <nelchael@gentoo.org> rng-tools-2.ebuild: + Fix autotools handling, bug #226619. + + 27 Oct 2007; Krzysiek Pawlik <nelchael@gentoo.org> rng-tools-2.ebuild: + Fix variable quoting. + + 21 Apr 2007; Krzysiek Pawlik <nelchael@gentoo.org> rng-tools-2.ebuild: + Use newinitd, newconfd and doenvd, see bug #174266. + + 03 Sep 2006; Krzysiek Pawlik <nelchael@gentoo.org> -files/rngd, + -rng-tools-1.1.ebuild: + Remove old version. + + 03 Sep 2006; Bryan Østergaard <kloeri@gentoo.org> rng-tools-2.ebuild: + Stable on Alpha, bug 139162. + + 20 Aug 2006; Simon Stelling <blubb@gentoo.org> rng-tools-2.ebuild: + stable on amd64 + + 13 Jul 2006; Aron Griffis <agriffis@gentoo.org> rng-tools-2.ebuild: + Mark 2 stable on ia64. #139162 + + 08 Jul 2006; Lars Weiler <pylon@gentoo.org> rng-tools-2.ebuild: + Stable on ppc; bug #139162. + + 04 Jul 2006; Krzysiek Pawlik <nelchael@gentoo.org> rng-tools-2.ebuild: + Stable on x86. + +*rng-tools-2 (20 Mar 2006) + + 20 Mar 2006; Krzysiek Pawlik <nelchael@gentoo.org> +files/2/rngd-conf, + +files/2/rngd, metadata.xml, -rng-tools-1.0.ebuild, +rng-tools-2.ebuild: + Added myself as maintainer, version bump and better init.d/conf.d scripts + (see bug #126852). + + 08 Feb 2006; Aron Griffis <agriffis@gentoo.org> rng-tools-1.1.ebuild: + Mark 1.1 stable on alpha + + 07 Feb 2006; Aron Griffis <agriffis@gentoo.org> rng-tools-1.1.ebuild: + Mark 1.1 stable on ia64 + + 01 Oct 2005; Bryan Østergaard <kloeri@gentoo.org> rng-tools-1.1.ebuild: + Add ~alpha + ~ia64 keywords. + + 12 Aug 2005; Robin H. Johnson <robbat2@gentoo.org> rng-tools-1.1.ebuild: + 1.1 stable on x86. + + 03 Sep 2004; Pieter Van den Abeele <pvdabeel@gentoo.org> + rng-tools-1.1.ebuild: + Masked rng-tools-1.1.ebuild stable for ppc + + 01 Jul 2004; Jeremy Huddleston <eradicator@gentoo.org> rng-tools-1.0.ebuild, + rng-tools-1.1.ebuild: + virtual/glibc -> virtual/libc + + 09 Apr 2004; David Holm <dholm@gentoo.org> rng-tools-1.1.ebuild: + Added to ~ppc. + +*rng-tools-1.1 (07 Apr 2004) + + 07 Apr 2004; Robin H. Johnson <robbat2@gentoo.org> rng-tools-1.1.ebuild, + files/rngd: + bump version, add in change from bug #47107 to use urandom as a feedback input. + + 07 Apr 2004; Travis Tilley <lv@gentoo.org> rng-tools-1.0.ebuild: + added ~amd64 keyword + +*rng-tools-1.0 (05 Oct 2003) + + 05 Oct 2003; Hanno Boeck <hanno@gentoo.org> rng-tools-1.0.ebuild, + files/rngd: + Fix for latest 2.6 kernels. Mark as x86 stable. + + 20 Aug 2003; Hanno Boeck <hanno@gentoo.org> files/rngd: + New package for using random number generators. diff --git a/sys-apps/rng-tools/Manifest b/sys-apps/rng-tools/Manifest new file mode 100644 index 0000000..e078e2f --- /dev/null +++ b/sys-apps/rng-tools/Manifest @@ -0,0 +1,23 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +AUX rng-tools-5-fix-textrels-on-PIC-x86.patch 2685 SHA256 edb9cd2439dd184df6bc5fd5c0148ba839506015917ab6a39394dff6a45a210f SHA512 918e66755d533b7255a9bba715942514a0381cc12a046e537eaa54ad2e4106485aee30defa1b84ba6f7e42adf1f3403bb2f24448c1153edbfa25f342d669818e WHIRLPOOL b0ecd30124f08b73ce05ba06d1c40db7c7834d11b850aa7e1baf461b2c1437355590b4a55d0a78daf2a107388f4f2d243f789451e97721afe5b8043dfea1fb60 +AUX rngd-confd-4.1 562 SHA256 cdbd39f7446f12a9b78e87e9f135cfd0f6f364c4fa4ade0c96084b85c32afc38 SHA512 45e0e9cbe0180162f659bf05c15ee99fb8c1b80274cd8744384ba7f791b1c9a46a63e81eea665b4f492c13b7d5cc1fdb6e524a49a25af77f3791f527b31f688b WHIRLPOOL 87634cea70a1c8ffa7598cc8b0d93c79578433cc21b58bb13bc9144502b9502e2c4f151bcf282ad4ccef44a931f1be5d1e87ff7b9b6d07cfa0a4c288b4172ec3 +AUX rngd-initd-4.1 897 SHA256 56780a5d0a3348a08ab19ba56e591f60f84665417ce9893d7b669fbc442bf1d4 SHA512 43d6612c6d6376a21b4522369688908e24544311632277a8dadc2a7c91ed664f7cf6610bab6592040fb10ca4adb98d2136134879bcfeeb25159c55cf9c0f6799 WHIRLPOOL c740a965b0e47dcae0d2ac01d01d3cf5e3f9ce4c5df626d75de82f3b5fe232391bafd43be099439cf6445f362ad7681d782db9497e6a13008d221fb8663579e5 +AUX rngd.service 133 SHA256 a05b1075157d39302106221594e1640479fae5dee4595de09442901a3a2d1648 SHA512 51e9ea84b624cda8d3689d6a9a8d60da4a556aa9d2a1a04e698d9a1490717aa47172e152c93711f8d04be8a5b68b1dfd568a762bd8ee7219afb7cdfff15657d2 WHIRLPOOL 093b0cd19a147abd9fc10f366c2c5a167d31b839d755cf2e56f6ae35409b6eb764db0651858d20dc95b71fe1d90b4ca33bde88053c80e40665613d132357366a +AUX test-for-argp.patch 1318 SHA256 222ee3b8bfbe4827140a67af4b8d170aaa135d5317e3a40b236f8d79a06c4274 SHA512 9418bea246052391e9dab1583a7e44c47f87c34d39860c76bf11090fd397ea70ec76cb7e4c91afbe1f18a19c6f8767e0e6ceec02fbd7ef8204e8ab168f3077d8 WHIRLPOOL a54d1e8f4d3e1070cda067120318d775f0a768836984c831cc84929801d29e5f7c694e90e96926e52af57d509a52d4340c3cf9ee847782927d3dfa16fa3f758b +DIST rng-tools-5.tar.gz 122182 SHA256 60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e SHA512 58047c37cad4f5f1210b696e4dba122878f78e57d05d9cb822f79234240ecce31efd2d39061fea1eb5b2e81d48d8c3bf6b92d06451f1ce5d5db7117704e89c50 WHIRLPOOL 073dbeb9d27189db44658a9f25657b93a320b125fbfc8230f7ce7849b8e7c1f7802b4c3a53de3417525b02739194fab8a6e5eb03d5db317a23deb275d72fbb21 +EBUILD rng-tools-5.ebuild 977 SHA256 16f48112dff835b41f6d46f1ecdb5e5147e586bcc2468f8d9def5ed3e3cccfbb SHA512 19ffb189e2477c754f2b34ff35cf3cae2b42157f02c8cf578e7733af893dae4cf10b1531a5120b9fb4d6fe15b98b9cb5fa46a4fbb1eb04fd39d7528afed46b6d WHIRLPOOL 44f33651484630267e37ee6006ba39aff7ed0104d31c045360f2dcef3490063b0776f7ebd8cb748f214ac6ca5346f398382d182b1cf62c34925b0e18928326d2 +MISC ChangeLog 8348 SHA256 e89bd74e3a661421f3cda3ac5c9e31cd062dfa7b43ce900e1b4eb4815c60618e SHA512 1cf789d3afc358627532387816be99489464bbf56994b4a2035c608f2394cccf6f01056ec25131862f5741cc5f5f6d58334d3edda7e0bd38e8b1ebed81254110 WHIRLPOOL 9e8237e4ea96d8c736ce7d09021ed371405d1a28638c61e02b63f235e04cdf596a1d5e59be73734a3c489726c9ff5079787c18f4b48628b29132ad583b26d07f +MISC metadata.xml 165 SHA256 23a8851c12bd4cf7cf0528250ad5605be6b0780bbec0c51331d6d2c618c13f6a SHA512 3f1bee5d098a4e5874df3af56169397cc3ed526f9c56004b9ccaa4c5cf02d4affd894400b88f50f3c19bf5ba3ae06f3d4d2cfa5c15e97b7d4c33053e5f0f63c5 WHIRLPOOL 070ba3ff0b1ea000c90d8af13cdac14693dc5d9dcc8d8ba89cf9bdbe91196e3cf9e72bd2f01cd5efc1ddab63b83184159298d1ee891bc123107ea6891ad612d2 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iQEcBAEBCAAGBQJURmwCAAoJEKXBodJLEo5SDIoIAMX2EKD+fr9YJ9g6GqUsFozM +He51QlIdP9zMZsM77bj+6UAT86RUY2CIwySMwjN6Fm+EmASzEZJyTzTuMxRTIh9k +BQRCraoe3mNdOOLfnm2c7otRk9GH5u1Aas1+XiexTs1hdWQC31cZnLELm2Q1BEVP +GPexMtyxGw9WVWKwAxiHo47Aa7F7s8dEcSlNS/CRMPYfKFekM54pADIiBVqoT7KD +hkZHYHnI022CxBESiAa7Qr6UaVQNIHGBXry6p1Pfwt4sKRICVKUkFodcYdsazmIo +os6amcCS9bfQjKv+SBsMJlOg5q4aTTF8MMigZfO4guqvMO0GDJ9TWbtesRzpZd8= +=4Wmo +-----END PGP SIGNATURE----- diff --git a/sys-apps/rng-tools/files/rng-tools-5-fix-textrels-on-PIC-x86.patch b/sys-apps/rng-tools/files/rng-tools-5-fix-textrels-on-PIC-x86.patch new file mode 100644 index 0000000..7e7f4a6 --- /dev/null +++ b/sys-apps/rng-tools/files/rng-tools-5-fix-textrels-on-PIC-x86.patch @@ -0,0 +1,100 @@ +From: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org> +Subject: [PATCH] Fix assemby textrels on rdrand_asm.S on PIC x86 + +This patch updates the fixes in the assembly in rdrand_asm.S in +sys-apps/rng-tools-5 so it won't generate textrels on PIC systems. +The main fixes are in the use of leal in SETPTR for such systems, the rest is +the usual PIC support stuff. + +This should fix Gentoo bug #469962 and help fix #518210 + +This patch is released under the GPLv2 or a higher version license as is the +original file as long as the author and the tester are credited. + +Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=469962 +Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=518210 +Upstream-status: Not sent yet +Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org> +Reported-by: cilly <cilly@cilly.mine.nu> +Reported-by: Manuel Rüger <mrueg@gentoo.org> + +--- rng-tools/rdrand_asm.S ++++ rng-tools/rdrand_asm.S +@@ -2,6 +2,7 @@ + * Copyright (c) 2011-2014, Intel Corporation + * Authors: Fenghua Yu <fenghua.yu@intel.com>, + * H. Peter Anvin <hpa@linux.intel.com> ++ * PIC code by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, +@@ -174,7 +175,20 @@ + jmp 4b + ENDPROC(x86_rdseed_or_rdrand_bytes) + ++#if defined(__PIC__) ++#undef __i686 /* gcc builtin define gets in our way */ ++#define INIT_PIC() \ ++ pushl %ebx ; \ ++ call __x86.get_pc_thunk.bx ; \ ++ addl $_GLOBAL_OFFSET_TABLE_, %ebx ++#define END_PIC() \ ++ popl %ebx ++#define SETPTR(var,ptr) leal (var)@GOTOFF(%ebx),ptr ++#else ++#define INIT_PIC() ++#define END_PIC() + #define SETPTR(var,ptr) movl $(var),ptr ++#endif + #define PTR0 %eax + #define PTR1 %edx + #define PTR2 %ecx +@@ -190,6 +204,7 @@ + movl 8(%ebp), %eax + movl 12(%ebp), %edx + push %esi ++ INIT_PIC() + #endif + movl $512, CTR3 /* Number of rounds */ + +@@ -280,6 +295,7 @@ + movdqa %xmm7, (7*16)(PTR1) + + #ifdef __i386__ ++ END_PIC() + pop %esi + pop %ebp + #endif +@@ -294,6 +310,7 @@ + push %ebp + mov %esp, %ebp + movl 8(%ebp), %eax ++ INIT_PIC() + #endif + + SETPTR(aes_round_keys, PTR1) +@@ -323,6 +340,7 @@ + call 1f + + #ifdef __i386__ ++ END_PIC() + pop %ebp + #endif + ret +@@ -343,6 +361,16 @@ + + ENDPROC(x86_aes_expand_key) + ++#if defined(__i386__) && defined(__PIC__) ++ .section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat ++ .globl __x86.get_pc_thunk.bx ++ .hidden __x86.get_pc_thunk.bx ++ .type __x86.get_pc_thunk.bx, @function ++__x86.get_pc_thunk.bx: ++ movl (%esp), %ebx ++ ret ++#endif ++ + .bss + .balign 64 + aes_round_keys: diff --git a/sys-apps/rng-tools/files/rngd-confd-4.1 b/sys-apps/rng-tools/files/rngd-confd-4.1 new file mode 100644 index 0000000..77e5db5 --- /dev/null +++ b/sys-apps/rng-tools/files/rngd-confd-4.1 @@ -0,0 +1,22 @@ +# /etc/conf.d/rngd + +# Please see "/usr/sbin/rngd --help" and "man rngd" for more information + +# If a single device is preferred, then specify it here, otherwise we will +# search for suitable devices. +#DEVICE= + +# Random step (Number of bytes written to random-device at a time): +STEP=64 + +# Should TPM be avoided? +# NO_TPM=0 + +# Should RDRAND be avoided? Please note that unless this is commented +# out, RDRAND _will_ be disabled, as any value will cause it to be +# disabled. +# NO_DRNG=1 + +# Fill watermark +# 0 <= n <= `sysctl kernel.random.poolsize` +WATERMARK=2048 diff --git a/sys-apps/rng-tools/files/rngd-initd-4.1 b/sys-apps/rng-tools/files/rngd-initd-4.1 new file mode 100644 index 0000000..1f0c6e9 --- /dev/null +++ b/sys-apps/rng-tools/files/rngd-initd-4.1 @@ -0,0 +1,29 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/files/rngd-initd-4.1,v 1.7 2013/05/22 05:16:17 vapier Exp $ + +depend() { + need localmount + after urandom + provide entropy +} + +# Do NOT add /dev/tpm to this. +DEFAULT_DEVICE="/dev/hw_random* /dev/hwrandom* /dev/i810_rng /dev/hwrng*" + +find_device() { + local d + # The echo is to cause globbing + for d in $(echo ${DEFAULT_DEVICE}) ; do + [ -e "${d}" ] && echo "${d}" + done +} + +RNG_DEVICE="${DEVICE:-$(find_device)}" + +command=/usr/sbin/rngd +pidfile="/var/run/${SVCNAME}.pid" +command_args="--pid-file ${pidfile} --background --random-step ${STEP:-64} ${NO_TPM:+--no-tpm=1} ${NO_DRNG:+--no-drng=1} --fill-watermark ${WATERMARK} ${RNG_DEVICE:+--rng-device ${RNG_DEVICE}}" +start_stop_daemon_args="--wait 1000" +retry="SIGKILL/5000" diff --git a/sys-apps/rng-tools/files/rngd.service b/sys-apps/rng-tools/files/rngd.service new file mode 100644 index 0000000..0479343 --- /dev/null +++ b/sys-apps/rng-tools/files/rngd.service @@ -0,0 +1,8 @@ +[Unit] +Description=Hardware RNG Entropy Gatherer Daemon + +[Service] +ExecStart=/usr/sbin/rngd -f + +[Install] +WantedBy=multi-user.target diff --git a/sys-apps/rng-tools/files/test-for-argp.patch b/sys-apps/rng-tools/files/test-for-argp.patch new file mode 100644 index 0000000..129a522 --- /dev/null +++ b/sys-apps/rng-tools/files/test-for-argp.patch @@ -0,0 +1,43 @@ +On glibc systems, argp is provided by libc. However, on +uclibc and other systems which lack argp in their C library, +argp might be provided by a stand alone library, libargp. +This patch adds tests to the build system to find who provides +argp. + +X-Gentoo-Bug: 292191 +X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=292191 +Reported-by: Ed Wildgoose <gentoo@wildgooses.com> +Signed-off-by: Anthony G. Basile <blueness@gentoo.org> + + +--- configure.ac.orig 2012-05-26 22:45:42.753478198 +0000 ++++ configure.ac 2012-05-27 00:36:23.175844081 +0000 +@@ -47,6 +47,28 @@ + dnl Checks for optional library functions + dnl ------------------------------------- + ++dnl First check if we have argp available from libc ++AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM( ++ [#include <argp.h>], ++ [int argc=1; char *argv[]={"test"}; argp_parse(0,argc,argv,0,0,0); return 0;] ++ )], ++ [libc_has_argp="true"], ++ [libc_has_argp="false"] ++) ++ ++dnl If libc doesn't provide argp, then test for libargp ++if test "$libc_has_argp" = "false" ; then ++ AC_MSG_WARN("libc does not have argp") ++ AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"]) ++ ++ if test "$have_argp" = "false"; then ++ AC_MSG_ERROR("no libargp found") ++ else ++ LIBS+=" -largp" ++ fi ++fi ++ + dnl ----------------- + dnl Configure options + dnl ----------------- diff --git a/sys-apps/rng-tools/metadata.xml b/sys-apps/rng-tools/metadata.xml new file mode 100644 index 0000000..659da0c --- /dev/null +++ b/sys-apps/rng-tools/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>base-system</herd> +</pkgmetadata> diff --git a/sys-apps/rng-tools/rng-tools-5.ebuild b/sys-apps/rng-tools/rng-tools-5.ebuild new file mode 100644 index 0000000..3fa7248 --- /dev/null +++ b/sys-apps/rng-tools/rng-tools-5.ebuild @@ -0,0 +1,36 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/rng-tools-4-r7.ebuild,v 1.1 2014/05/24 10:01:14 pacho Exp $ + +EAPI="5" + +inherit eutils autotools systemd toolchain-funcs + +DESCRIPTION="Daemon to use hardware random number generators" +HOMEPAGE="http://gkernel.sourceforge.net/" +SRC_URI="mirror://sourceforge/gkernel/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~x86" +IUSE="selinux" + +DEPEND="selinux? ( sec-policy/selinux-rngd )" +RDEPEND="${DEPEND}" + +src_prepare() { + echo 'bin_PROGRAMS = randstat' >> contrib/Makefile.am + epatch "${FILESDIR}"/test-for-argp.patch + epatch "${FILESDIR}"/${P}-fix-textrels-on-PIC-x86.patch + eautoreconf + + sed -i '/^AR /d' Makefile.in + tc-export AR +} + +src_install() { + default + newinitd "${FILESDIR}"/rngd-initd-4.1 rngd + newconfd "${FILESDIR}"/rngd-confd-4.1 rngd + systemd_dounit "${FILESDIR}"/rngd.service +} |