diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-apps/rng-tools | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-apps/rng-tools')
-rw-r--r-- | sys-apps/rng-tools/Manifest | 2 | ||||
-rw-r--r-- | sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch | 71 | ||||
-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-initd-r1-4.1 | 20 | ||||
-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 | 18 | ||||
-rw-r--r-- | sys-apps/rng-tools/rng-tools-4-r7.ebuild | 36 | ||||
-rw-r--r-- | sys-apps/rng-tools/rng-tools-5.ebuild | 38 |
11 files changed, 387 insertions, 0 deletions
diff --git a/sys-apps/rng-tools/Manifest b/sys-apps/rng-tools/Manifest new file mode 100644 index 000000000000..e8ef399c125d --- /dev/null +++ b/sys-apps/rng-tools/Manifest @@ -0,0 +1,2 @@ +DIST rng-tools-4.tar.gz 110943 SHA256 b71bdfd4222c05e8316001556be90e1606f2a1bac3efde60153bd84e873cc195 SHA512 328627a9ede924026c7a7c391b04be05f098d713d35f7f38d939d52b794853b4f6db3ae125568710ab5a59640236b343f3e9fc0f735806b020cc675c02f80b08 WHIRLPOOL da58bc7d3b7d9cdf6d83d258717f22ba3552482a690311fa2c820e4ce125a5e6c6e498e0b63461ed6c9dc16dff77b2cb47377933845fb9397efa205183346e5b +DIST rng-tools-5.tar.gz 122182 SHA256 60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e SHA512 58047c37cad4f5f1210b696e4dba122878f78e57d05d9cb822f79234240ecce31efd2d39061fea1eb5b2e81d48d8c3bf6b92d06451f1ce5d5db7117704e89c50 WHIRLPOOL 073dbeb9d27189db44658a9f25657b93a320b125fbfc8230f7ce7849b8e7c1f7802b4c3a53de3417525b02739194fab8a6e5eb03d5db317a23deb275d72fbb21 diff --git a/sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch b/sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch new file mode 100644 index 000000000000..5ff34da861b4 --- /dev/null +++ b/sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch @@ -0,0 +1,71 @@ +From: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org> +Subject: [PATCH] Fix assemby textrels on rdrand_asm.S on PIC x86 + +This patch fixes the assembly in rdrand_asm.S 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 + +This patch is released under the GPLv2 or a higher version license as is the original file +as long as reference to the author and the tester are included in the final code. + +Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=469962 +Upstream-status: Not sent yet +Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org> +Reported-by: cilly <cilly@cilly.mine.nu> +Tested-by: Anthony Basile <blueness@gentoo.org> + +--- rng-tools/rdrand_asm.S ++++ rng-tools/rdrand_asm.S +@@ -49,6 +49,7 @@ + ret + ENDPROC(x86_rdrand_nlong) + ++#define INIT_PIC() + #define SETPTR(var,ptr) leaq var(%rip),ptr + #define PTR0 %rdi + #define PTR1 %rsi +@@ -84,7 +85,16 @@ + ret + ENDPROC(x86_rdrand_nlong) + ++#if defined(__PIC__) ++#undef __i686 /* gcc builtin define gets in our way */ ++#define INIT_PIC() \ ++ call __i686.get_pc_thunk.bx ; \ ++ addl $_GLOBAL_OFFSET_TABLE_, %ebx ++#define SETPTR(var,ptr) leal (var)@GOTOFF(%ebx),ptr ++#else ++#define INIT_PIC() + #define SETPTR(var,ptr) movl $(var),ptr ++#endif + #define PTR0 %eax + #define PTR1 %edx + #define PTR2 %ecx +@@ -101,6 +111,7 @@ + movl 8(%ebp), %eax + movl 12(%ebp), %edx + #endif ++ INIT_PIC() + + SETPTR(aes_round_keys, PTR2) + +@@ -166,6 +177,17 @@ + #endif + ret + ENDPROC(x86_aes_mangle) ++ ++#if defined(__i386__) && defined(__PIC__) ++ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits ++.globl __i686.get_pc_thunk.bx ++ .hidden __i686.get_pc_thunk.bx ++ .type __i686.get_pc_thunk.bx,@function ++__i686.get_pc_thunk.bx: ++ movl (%esp), %ebx ++ ret ++#endif ++ + /* + * AES round keys for an arbitrary key: + * 00102030405060708090A0B0C0D0E0F0 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 000000000000..5fa5f0b4ecf7 --- /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> +Tested-by: Anthony Basile <blueness@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,19 @@ + jmp 4b + ENDPROC(x86_rdseed_or_rdrand_bytes) + ++#if defined(__PIC__) ++#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 +203,7 @@ + movl 8(%ebp), %eax + movl 12(%ebp), %edx + push %esi ++ INIT_PIC() + #endif + movl $512, CTR3 /* Number of rounds */ + +@@ -280,6 +294,7 @@ + movdqa %xmm7, (7*16)(PTR1) + + #ifdef __i386__ ++ END_PIC() + pop %esi + pop %ebp + #endif +@@ -294,6 +309,7 @@ + push %ebp + mov %esp, %ebp + movl 8(%ebp), %eax ++ INIT_PIC() + #endif + + SETPTR(aes_round_keys, PTR1) +@@ -323,6 +339,7 @@ + call 1f + + #ifdef __i386__ ++ END_PIC() + pop %ebp + #endif + ret +@@ -343,6 +360,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 000000000000..77e5db583458 --- /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 000000000000..edc61d4316f6 --- /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 +# $Id$ + +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-initd-r1-4.1 b/sys-apps/rng-tools/files/rngd-initd-r1-4.1 new file mode 100644 index 000000000000..1e63c847d370 --- /dev/null +++ b/sys-apps/rng-tools/files/rngd-initd-r1-4.1 @@ -0,0 +1,20 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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*" + +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} ${DEVICE:+--rng-device ${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 000000000000..04793437e2d7 --- /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 000000000000..129a522e5686 --- /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 000000000000..582bac6aefed --- /dev/null +++ b/sys-apps/rng-tools/metadata.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>base-system</herd> + <herd>proxy-maintainers</herd> + <maintainer> + <email>idella4@gentoo.org</email> + <name>Ian Delaney</name> + </maintainer> + <maintainer> + <email>gokturk@binghamton.edu</email> + <name>Gokturk Yuksek</name> + <description>Proxy maintainer, CC him on bugs.</description> + </maintainer> + <upstream> + <remote-id type="sourceforge">gkernel</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-apps/rng-tools/rng-tools-4-r7.ebuild b/sys-apps/rng-tools/rng-tools-4-r7.ebuild new file mode 100644 index 000000000000..323f0459b7e2 --- /dev/null +++ b/sys-apps/rng-tools/rng-tools-4-r7.ebuild @@ -0,0 +1,36 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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" + +RDEPEND="selinux? ( sec-policy/selinux-rngd )" +DEPEND="" + +src_prepare() { + echo 'bin_PROGRAMS = randstat' >> contrib/Makefile.am + epatch "${FILESDIR}"/test-for-argp.patch + epatch "${FILESDIR}"/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 +} 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 000000000000..fb83acfa2f2c --- /dev/null +++ b/sys-apps/rng-tools/rng-tools-5.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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="dev-libs/libgcrypt:0 + dev-libs/libgpg-error" +RDEPEND="${DEPEND} + selinux? ( sec-policy/selinux-rngd )" + +src_prepare() { + echo 'bin_PROGRAMS = randstat' >> contrib/Makefile.am + epatch "${FILESDIR}"/test-for-argp.patch\ + "${FILESDIR}"/${P}-fix-textrels-on-PIC-x86.patch + eautoreconf + + sed -i '/^AR /d' Makefile.in || die + 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 +} |