summaryrefslogtreecommitdiffstats
path: root/import-layers/yocto-poky/meta/recipes-support/rng-tools
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2018-02-25 22:55:05 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-03-15 14:22:49 +0000
commitd7bf8c17eca8f8c89898a7794462c773c449e983 (patch)
treed18618fca85ca5f0c077032cc7b009344b60f663 /import-layers/yocto-poky/meta/recipes-support/rng-tools
parente2b5abdc9f28cdf8578e5b9be803c8e697443c20 (diff)
downloadtalos-openbmc-d7bf8c17eca8f8c89898a7794462c773c449e983.tar.gz
talos-openbmc-d7bf8c17eca8f8c89898a7794462c773c449e983.zip
Yocto 2.4
Move OpenBMC to Yocto 2.4(rocko) Tested: Built and verified Witherspoon and Palmetto images Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-support/rng-tools')
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/default3
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch103
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/rngd.service9
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/uclibc-libuargp-configure.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch2
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools_5.bb18
6 files changed, 128 insertions, 70 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/default b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/default
index 7aede9be0..ab7cd9327 100644
--- a/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/default
+++ b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/default
@@ -1,3 +1,2 @@
# Specify rng device
-#RNG_DEVICE=/dev/hwrng
-RNG_DEVICE=/dev/urandom
+RNG_DEVICE=/dev/hwrng
diff --git a/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch
new file mode 100644
index 000000000..93a5864a4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch
@@ -0,0 +1,103 @@
+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/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/rngd.service b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/rngd.service
new file mode 100644
index 000000000..b94ad5020
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/rngd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Hardware RNG Entropy Gatherer Daemon
+
+[Service]
+ExecStart=@SBINDIR@/rngd -f -r /dev/urandom
+SuccessExitStatus=66
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/uclibc-libuargp-configure.patch b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/uclibc-libuargp-configure.patch
deleted file mode 100644
index e691315d1..000000000
--- a/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/uclibc-libuargp-configure.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-In case of uclibc, use libuargp
-
-If we use uclibc for system libraries, select libuargp
-
-Upstream-Status: Pending
-
-Signed-off-by: Maxin B. John <maxin.john@intel.com>
----
-diff -Naur rng-tools-5-orig/configure.ac rng-tools-5/configure.ac
---- rng-tools-5-orig/configure.ac 2016-02-24 18:11:24.023690235 +0200
-+++ rng-tools-5/configure.ac 2016-02-24 18:14:49.763118138 +0200
-@@ -39,6 +39,13 @@
- [with_libargp=check]
- )
-
-+AC_ARG_ENABLE([uclibc],
-+ AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
-+ use_uclibc=yes, use_uclibc=no)
-+AM_CONDITIONAL(USE_UCLIBC, test "x$use_uclibc" = "xyes")
-+AS_IF([test "x$use_uclibc" = "xyes"], [AC_DEFINE(USE_UCLIBC)])
-+AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
-+
- dnl Make sure anyone changing configure.ac/Makefile.am has a clue
- AM_MAINTAINER_MODE
-
-@@ -101,7 +108,7 @@
- [need_libargp=no],
- [need_libargp=yes
- if test "x$with_libargp" = "xno"; then
-- AC_MSG_FAILURE([libargp disabled and libc does not have argp])
-+ AC_MSG_WARN([libargp disabled and libc does not have argp])
- fi]
- )
- ],
-@@ -110,7 +117,7 @@
-
- dnl Check for libargp
- AS_IF(
-- [test "x$need_libargp" = "xyes"],
-+ [test "x$need_libargp" = "xyes" -a "x$use_uclibc" = "xno"],
- [
- AC_CHECK_LIB(
- [argp],
-@@ -120,6 +127,19 @@
- )
- ]
- )
-+
-+dnl Check for libuargp
-+AS_IF(
-+ [test "x$use_uclibc" = "xyes"],
-+ [
-+ AC_CHECK_LIB(
-+ [uargp],
-+ [argp_parse],
-+ [LIBS="$LIBS -luargp"],
-+ [AC_MSG_FAILURE([libuargp not found])]
-+ )
-+ ]
-+)
-
- dnl -----------------
- dnl Configure options
diff --git a/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch
index 142257181..afd08d577 100644
--- a/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch
+++ b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch
@@ -7,6 +7,8 @@ Fix underquoted m4 entry. This causes a failure if gcrypt isn't present:
RP
2016/2/16
+Upstream-Status: Pending
+
Index: rng-tools-5/configure.ac
===================================================================
--- rng-tools-5.orig/configure.ac
diff --git a/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools_5.bb b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools_5.bb
index 9329e8ad3..4a66bed64 100644
--- a/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools_5.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools_5.bb
@@ -6,9 +6,11 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/gkernel/${BP}.tar.gz \
file://0001-If-the-libc-is-lacking-argp-use-libargp.patch \
file://0002-Add-argument-to-control-the-libargp-dependency.patch \
file://underquote.patch \
- file://uclibc-libuargp-configure.patch \
+ file://rng-tools-5-fix-textrels-on-PIC-x86.patch \
file://init \
- file://default"
+ file://default \
+ file://rngd.service \
+"
SRC_URI[md5sum] = "6726cdc6fae1f5122463f24ae980dd68"
SRC_URI[sha256sum] = "60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e"
@@ -20,13 +22,11 @@ python () {
d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
}
-inherit autotools update-rc.d
+inherit autotools update-rc.d systemd
PACKAGECONFIG = "libgcrypt"
PACKAGECONFIG_libc-musl = "libargp"
-PACKAGECONFIG_libc-uclibc = "libuargp"
PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
-PACKAGECONFIG[libuargp] = "--enable-uclibc,,,"
PACKAGECONFIG[libgcrypt] = "--with-libgcrypt,--without-libgcrypt,libgcrypt,"
do_install_append() {
@@ -40,7 +40,15 @@ do_install_append() {
install -d "${D}${sysconfdir}/default"
install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/rng-tools
fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 644 ${WORKDIR}/rngd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/rngd.service
+ fi
}
INITSCRIPT_NAME = "rng-tools"
INITSCRIPT_PARAMS = "start 30 2 3 4 5 . stop 30 0 6 1 ."
+
+SYSTEMD_SERVICE_${PN} = "rngd.service"
OpenPOWER on IntegriCloud