diff options
Diffstat (limited to 'external/poky/meta/recipes-support/rng-tools/rng-tools')
8 files changed, 12 insertions, 405 deletions
diff --git a/external/poky/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch b/external/poky/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch deleted file mode 100644 index 4bd9d31c..00000000 --- a/external/poky/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 99679fda405e535a282f04a4decc2381154a749f Mon Sep 17 00:00:00 2001 -From: Christopher Larson <chris_larson@mentor.com> -Date: Mon, 15 Feb 2016 15:59:58 -0700 -Subject: [PATCH 1/2] If the libc is lacking argp, use libargp - -Patch pulled from Gentoo: - - 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> - -Upstream-Status: Pending -Signed-off-by: Christopher Larson <chris_larson@mentor.com> ---- - configure.ac | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 27a2dba..04fcd25 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -82,6 +82,28 @@ AS_IF( - ] - ) - -+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 ----------------- --- -2.2.1 - diff --git a/external/poky/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch b/external/poky/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch deleted file mode 100644 index 1c8a79ce..00000000 --- a/external/poky/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch +++ /dev/null @@ -1,92 +0,0 @@ -From afc8712a9e6c72fbd03c36f84ecf8703e5d22a8c Mon Sep 17 00:00:00 2001 -From: Christopher Larson <chris_larson@mentor.com> -Date: Mon, 15 Feb 2016 16:11:32 -0700 -Subject: [PATCH 2/2] Add argument to control the libargp dependency - -This ensures that the builds are always deterministic. If the argument isn't -passed, the default behavior is to use libargp if the libc doesn't have argp. - -Upstream-Status: Pending -Signed-off-by: Christopher Larson <chris_larson@mentor.com> ---- - configure.ac | 55 ++++++++++++++++++++++++++++++++++++------------------- - 1 file changed, 36 insertions(+), 19 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 04fcd25..11a5321 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -32,6 +32,13 @@ AC_ARG_WITH([libgcrypt], - [with_libgcrypt=check] - ) - -+AC_ARG_WITH([libargp], -+ AS_HELP_STRING([--without-libargp], -+ [Disable libargp support. Systems whose libc lacks argp can use libargp instead. (Default: check if libc lacks argp)]), -+ [with_libargp=$withval], -+ [with_libargp=check] -+) -+ - dnl Make sure anyone changing configure.ac/Makefile.am has a clue - AM_MAINTAINER_MODE - -@@ -82,27 +89,37 @@ AS_IF( - ] - ) - --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 Determine if we need libargp: either user requested, or libc has no argp -+AS_IF( -+ [test "x$with_libargp" != "xyes"], -+ [ -+ 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;] -+ )], -+ [need_libargp=no], -+ [need_libargp=yes -+ if test "x$with_libargp" = "xno"; then -+ AC_MSG_FAILURE([libargp disabled and libc does not have argp]) -+ fi] -+ ) -+ ], -+ [need_libargp=yes], - ) - --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 Check for libargp -+AS_IF( -+ [test "x$need_libargp" = "xyes"], -+ [ -+ AC_CHECK_LIB( -+ [argp], -+ [argp_parse], -+ [LIBS="$LIBS -largp"], -+ [AC_MSG_FAILURE([libargp not found])] -+ ) -+ ] -+) - - dnl ----------------- - dnl Configure options --- -2.2.1 - diff --git a/external/poky/meta/recipes-support/rng-tools/rng-tools/default b/external/poky/meta/recipes-support/rng-tools/rng-tools/default index ab7cd932..b9f8e036 100644 --- a/external/poky/meta/recipes-support/rng-tools/rng-tools/default +++ b/external/poky/meta/recipes-support/rng-tools/rng-tools/default @@ -1,2 +1 @@ -# Specify rng device -RNG_DEVICE=/dev/hwrng +EXTRA_ARGS="-r /dev/hwrng" diff --git a/external/poky/meta/recipes-support/rng-tools/rng-tools/init b/external/poky/meta/recipes-support/rng-tools/rng-tools/init index 7cf78393..13f0ecd3 100644 --- a/external/poky/meta/recipes-support/rng-tools/rng-tools/init +++ b/external/poky/meta/recipes-support/rng-tools/rng-tools/init @@ -1,26 +1,19 @@ -#! /bin/sh +#!/bin/sh # # This is an init script for openembedded -# Copy it to /etc/init.d/rng-tools and type +# Copy it to @SYSCONFDIR@/init.d/rng-tools and type # > update-rc.d rng-tools defaults 60 # -rngd=/usr/sbin/rngd +rngd=@SBINDIR@/rngd test -x "$rngd" || exit 1 -if [ -e /etc/default/rng-tools ]; then - . /etc/default/rng-tools -fi - -if [ -n "$RNG_DEVICE" ]; then - EXTRA_ARGS="-- -r $RNG_DEVICE" -fi - +[ -r @SYSCONFDIR@/default/rng-tools ] && . "@SYSCONFDIR@/default/rng-tools" case "$1" in start) echo -n "Starting random number generator daemon" - start-stop-daemon -S -q -x $rngd $EXTRA_ARGS + start-stop-daemon -S -q -x $rngd -- $EXTRA_ARGS echo "." ;; stop) @@ -38,11 +31,11 @@ case "$1" in start-stop-daemon -K -q -n rngd echo "." echo -n "Starting random number generator daemon" - start-stop-daemon -S -q -x $rngd $EXTRA_ARGS + start-stop-daemon -S -q -x $rngd -- $EXTRA_ARGS echo "." ;; *) - echo "Usage: /etc/init.d/rng-tools {start|stop|reload|restart|force-reload}" + echo "Usage: @SYSCONFDIR@/init.d/rng-tools {start|stop|reload|restart|force-reload}" exit 1 esac diff --git a/external/poky/meta/recipes-support/rng-tools/rng-tools/read_error_msg.patch b/external/poky/meta/recipes-support/rng-tools/rng-tools/read_error_msg.patch deleted file mode 100644 index 8aa13bf8..00000000 --- a/external/poky/meta/recipes-support/rng-tools/rng-tools/read_error_msg.patch +++ /dev/null @@ -1,98 +0,0 @@ -rng-tools: modify 'read error' message - -Make the 'read error' message more descriptive. - -Copied from https://bugzilla.redhat.com/attachment.cgi?id=1295857 -and modified in one place to apply successfully. Error message during -bootstrap modified to show device name. - -Upstream-Status: pending - -Signed-off-by: Joe Slater <joe.slater@windriver.com> - - ---- a/rngd.c -+++ b/rngd.c -@@ -247,8 +247,11 @@ static void do_loop(int random_step) - continue; /* failed, no work */ - - retval = iter->xread(buf, sizeof buf, iter); -- if (retval) -+ if (retval) { -+ message(LOG_DAEMON|LOG_ERR, -+ "Error reading from entropy source\n"); - continue; /* failed, no work */ -+ } - - work_done = true; - ---- a/rngd_entsource.c -+++ b/rngd_entsource.c -@@ -63,10 +63,8 @@ int xread(void *buf, size_t size, struct - size -= r; - } - -- if (size) { -- message(LOG_DAEMON|LOG_ERR, "read error\n"); -+ if (size) - return -1; -- } - return 0; - } - -@@ -152,7 +150,7 @@ error_out: - } - - /* Initialize entropy source */ --static int discard_initial_data(struct rng *ent_src) -+static int discard_initial_data(struct rng *ent_src, int *buf) - { - /* Trash 32 bits of what is probably stale (non-random) - * initial state from the RNG. For Intel's, 8 bits would -@@ -164,10 +162,12 @@ static int discard_initial_data(struct r - xread(tempbuf, sizeof(tempbuf), ent_src); - - /* Return 32 bits of bootstrap data */ -- xread(tempbuf, sizeof(tempbuf), ent_src); -+ if (xread(tempbuf, sizeof(tempbuf), ent_src) != 0) -+ return -1; - -- return tempbuf[0] | (tempbuf[1] << 8) | -+ *buf = tempbuf[0] | (tempbuf[1] << 8) | - (tempbuf[2] << 16) | (tempbuf[3] << 24); -+ return 0; - } - - /* -@@ -175,6 +175,8 @@ static int discard_initial_data(struct r - */ - int init_entropy_source(struct rng *ent_src) - { -+ int bootstrap; -+ - ent_src->rng_fd = open(ent_src->rng_name, O_RDONLY); - if (ent_src->rng_fd == -1) { - return 1; -@@ -182,7 +184,11 @@ int init_entropy_source(struct rng *ent_ - src_list_add(ent_src); - /* Bootstrap FIPS tests */ - ent_src->fipsctx = malloc(sizeof(fips_ctx_t)); -- fips_init(ent_src->fipsctx, discard_initial_data(ent_src)); -+ if (discard_initial_data(ent_src, &bootstrap) != 0) { -+ message(LOG_ERR|LOG_INFO, "Read failure in %s during bootstrap\n",ent_src->rng_name); -+ return 1; -+ } -+ fips_init(ent_src->fipsctx, bootstrap); - return 0; - } - ---- a/rngtest.c -+++ b/rngtest.c -@@ -335,6 +335,7 @@ static int discard_initial_data(void) - - return tempbuf[0] | (tempbuf[1] << 8) | - (tempbuf[2] << 16) | (tempbuf[3] << 24); -+ - } - - static void do_rng_fips_test_loop( void ) diff --git a/external/poky/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch b/external/poky/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch deleted file mode 100644 index 93a5864a..00000000 --- a/external/poky/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch +++ /dev/null @@ -1,103 +0,0 @@ -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 -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> - -Upstream-Status: Pending - -Index: rng-tools-5/rdrand_asm.S -=================================================================== ---- rng-tools-5.orig/rdrand_asm.S -+++ rng-tools-5/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 @@ ENTRY(x86_rdseed_or_rdrand_bytes) - 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 @@ ENTRY(x86_aes_mangle) - movl 8(%ebp), %eax - movl 12(%ebp), %edx - push %esi -+ INIT_PIC() - #endif - movl $512, CTR3 /* Number of rounds */ - -@@ -280,6 +294,7 @@ offset = offset + 16 - movdqa %xmm7, (7*16)(PTR1) - - #ifdef __i386__ -+ END_PIC() - pop %esi - pop %ebp - #endif -@@ -294,6 +309,7 @@ ENTRY(x86_aes_expand_key) - push %ebp - mov %esp, %ebp - movl 8(%ebp), %eax -+ INIT_PIC() - #endif - - SETPTR(aes_round_keys, PTR1) -@@ -323,6 +339,7 @@ ENTRY(x86_aes_expand_key) - call 1f - - #ifdef __i386__ -+ END_PIC() - pop %ebp - #endif - ret -@@ -343,6 +360,16 @@ ENTRY(x86_aes_expand_key) - - 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/external/poky/meta/recipes-support/rng-tools/rng-tools/rngd.service b/external/poky/meta/recipes-support/rng-tools/rng-tools/rngd.service index f0355db1..aaaaa290 100644 --- a/external/poky/meta/recipes-support/rng-tools/rng-tools/rngd.service +++ b/external/poky/meta/recipes-support/rng-tools/rng-tools/rngd.service @@ -2,11 +2,12 @@ Description=Hardware RNG Entropy Gatherer Daemon DefaultDependencies=no After=systemd-udev-settle.service -Before=sysinit.target +Before=sysinit.target shutdown.target +Conflicts=shutdown.target [Service] -ExecStart=@SBINDIR@/rngd -f -r /dev/hwrng -SuccessExitStatus=66 +EnvironmentFile=-@SYSCONFDIR@/default/rng-tools +ExecStart=@SBINDIR@/rngd -f $EXTRA_ARGS [Install] WantedBy=multi-user.target diff --git a/external/poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch b/external/poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch deleted file mode 100644 index afd08d57..00000000 --- a/external/poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch +++ /dev/null @@ -1,33 +0,0 @@ -Fix underquoted m4 entry. This causes a failure if gcrypt isn't present: - -| configure: libgcrypt support disabled -| ../rng-tools-5/configure: line 4345: ac_fn_c_try_link: command not found -| configure: error: in `/media/build1/poky/build/tmp/work/i586-poky-linux/rng-tools/5-r0/build': - -RP -2016/2/16 - -Upstream-Status: Pending - -Index: rng-tools-5/configure.ac -=================================================================== ---- rng-tools-5.orig/configure.ac -+++ rng-tools-5/configure.ac -@@ -71,7 +71,7 @@ AS_IF( - [test "x$with_libgcrypt" != "xno"], - [ - AC_CHECK_HEADER([gcrypt.h], -- AC_CHECK_LIB( -+ [AC_CHECK_LIB( - [gcrypt], - [gcry_check_version], , - [ -@@ -80,7 +80,7 @@ AS_IF( - AC_MSG_NOTICE([libgcrypt support disabled]) - fi - ] -- ), -+ )], - [if test "x$with_libgcrypt" != "xcheck"; then - AC_MSG_FAILURE([libgcrypt headers not found]); else - AC_MSG_NOTICE([libgcrypt support disabled]) |