summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-apps/rng-tools/files
downloadgentoo-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/files')
-rw-r--r--sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch71
-rw-r--r--sys-apps/rng-tools/files/rng-tools-5-fix-textrels-on-PIC-x86.patch100
-rw-r--r--sys-apps/rng-tools/files/rngd-confd-4.122
-rw-r--r--sys-apps/rng-tools/files/rngd-initd-4.129
-rw-r--r--sys-apps/rng-tools/files/rngd-initd-r1-4.120
-rw-r--r--sys-apps/rng-tools/files/rngd.service8
-rw-r--r--sys-apps/rng-tools/files/test-for-argp.patch43
7 files changed, 293 insertions, 0 deletions
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 -----------------