All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Integrated the jitter entropy daemon to work around slow boot problems for Yocto
@ 2018-11-09  9:12 Hongxu Jia
  2018-11-09  9:12 ` [PATCH 1/2] rng-tools: 5 -> 6.6 Hongxu Jia
  2018-11-09  9:12 ` [PATCH 2/2] libjitterentropy: add 2.1.2 Hongxu Jia
  0 siblings, 2 replies; 12+ messages in thread
From: Hongxu Jia @ 2018-11-09  9:12 UTC (permalink / raw)
  To: openembedded-core, richard.purdie

The following changes since commit bb06900a1f29fdd4066f6d7e7a961d230c2e9438:

  perf: Disable libunwind for ARC & RISCV64 (2018-11-06 12:15:59 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib hongxu/add-jitter
  http://cgit.openembedded.org/openembedded-core-contrib/log/?h=hongxu/add-jitter

Hongxu Jia (2):
  rng-tools: 5 -> 6.6
  libjitterentropy: add 2.1.2

 .../files/0001-fix-do_install-failure-on-oe.patch  | 33 ++++++++
 .../libjitterentropy/libjitterentropy_2.1.2.bb     | 28 +++++++
 ...1-If-the-libc-is-lacking-argp-use-libargp.patch | 10 +--
 ...rgument-to-control-the-libargp-dependency.patch | 21 +++--
 .../rng-tools/rng-tools/read_error_msg.patch       | 98 ----------------------
 .../rng-tools-5-fix-textrels-on-PIC-x86.patch      | 35 +++++---
 .../rng-tools/rng-tools/underquote.patch           | 27 ++++--
 .../rng-tools/{rng-tools_5.bb => rng-tools_6.6.bb} | 25 ++++--
 8 files changed, 139 insertions(+), 138 deletions(-)
 create mode 100644 meta/recipes-support/libjitterentropy/files/0001-fix-do_install-failure-on-oe.patch
 create mode 100644 meta/recipes-support/libjitterentropy/libjitterentropy_2.1.2.bb
 delete mode 100644 meta/recipes-support/rng-tools/rng-tools/read_error_msg.patch
 rename meta/recipes-support/rng-tools/{rng-tools_5.bb => rng-tools_6.6.bb} (72%)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] rng-tools: 5 -> 6.6
  2018-11-09  9:12 [PATCH 0/2] Integrated the jitter entropy daemon to work around slow boot problems for Yocto Hongxu Jia
@ 2018-11-09  9:12 ` Hongxu Jia
  2018-11-09 22:50   ` richard.purdie
  2018-11-09  9:12 ` [PATCH 2/2] libjitterentropy: add 2.1.2 Hongxu Jia
  1 sibling, 1 reply; 12+ messages in thread
From: Hongxu Jia @ 2018-11-09  9:12 UTC (permalink / raw)
  To: openembedded-core, richard.purdie

- Update SRC_URI, previously upstream is dead, latest update is 2014

- Drop read_error_msg.patch

- Rework do_configure and do_compile

- Enable jitterentropy

License-Update: Upstream changed, but license is still gplv2

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 ...1-If-the-libc-is-lacking-argp-use-libargp.patch | 10 +--
 ...rgument-to-control-the-libargp-dependency.patch | 21 +++--
 .../rng-tools/rng-tools/read_error_msg.patch       | 98 ----------------------
 .../rng-tools-5-fix-textrels-on-PIC-x86.patch      | 35 +++++---
 .../rng-tools/rng-tools/underquote.patch           | 27 ++++--
 .../rng-tools/{rng-tools_5.bb => rng-tools_6.6.bb} | 25 ++++--
 6 files changed, 78 insertions(+), 138 deletions(-)
 delete mode 100644 meta/recipes-support/rng-tools/rng-tools/read_error_msg.patch
 rename meta/recipes-support/rng-tools/{rng-tools_5.bb => rng-tools_6.6.bb} (72%)

diff --git a/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch b/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch
index 4bd9d31..06d1d94 100644
--- a/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch
+++ b/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch
@@ -1,7 +1,7 @@
-From 99679fda405e535a282f04a4decc2381154a749f Mon Sep 17 00:00:00 2001
+From 06ba71887f667d45dd231a782a2751f36e8fe025 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
+Subject: [PATCH 1/4] If the libc is lacking argp, use libargp
 
 Patch pulled from Gentoo:
 
@@ -23,10 +23,10 @@ Signed-off-by: Christopher Larson <chris_larson@mentor.com>
  1 file changed, 22 insertions(+)
 
 diff --git a/configure.ac b/configure.ac
-index 27a2dba..04fcd25 100644
+index 4e799dc..c4a5dd8 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -82,6 +82,28 @@ AS_IF(
+@@ -135,6 +135,28 @@ AS_IF(
  	]
  )
  
@@ -56,5 +56,5 @@ index 27a2dba..04fcd25 100644
  dnl Configure options
  dnl -----------------
 -- 
-2.2.1
+2.7.4
 
diff --git a/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch b/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch
index 1c8a79c..be60fe9 100644
--- a/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch
+++ b/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch
@@ -1,23 +1,26 @@
-From afc8712a9e6c72fbd03c36f84ecf8703e5d22a8c Mon Sep 17 00:00:00 2001
+From 711e2f76890e3c5b08f64859d9fd913ddbec7d50 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
+Date: Mon, 22 Oct 2018 15:26:47 +0800
+Subject: [PATCH 2/4] 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>
+
+Rebase to 6.6
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 ---
  configure.ac | 55 ++++++++++++++++++++++++++++++++++++-------------------
  1 file changed, 36 insertions(+), 19 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 04fcd25..11a5321 100644
+index c4a5dd8..dd1c30f 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -32,6 +32,13 @@ AC_ARG_WITH([libgcrypt],
- 	[with_libgcrypt=check]
+@@ -40,6 +40,13 @@ AC_ARG_WITH([nistbeacon],
+ 	[with_nistbeacon=check]
  )
  
 +AC_ARG_WITH([libargp],
@@ -29,8 +32,8 @@ index 04fcd25..11a5321 100644
 +
  dnl Make sure anyone changing configure.ac/Makefile.am has a clue
  AM_MAINTAINER_MODE
- 
-@@ -82,27 +89,37 @@ AS_IF(
+ AM_PROG_AS
+@@ -135,27 +142,37 @@ AS_IF(
  	]
  )
  
@@ -88,5 +91,5 @@ index 04fcd25..11a5321 100644
  dnl -----------------
  dnl Configure options
 -- 
-2.2.1
+2.7.4
 
diff --git a/meta/recipes-support/rng-tools/rng-tools/read_error_msg.patch b/meta/recipes-support/rng-tools/rng-tools/read_error_msg.patch
deleted file mode 100644
index 8aa13bf..0000000
--- a/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/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch b/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch
index 93a5864..614adab 100644
--- a/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch
+++ b/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch
@@ -1,5 +1,10 @@
-From: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
-Subject: [PATCH] Fix assemby textrels on rdrand_asm.S on PIC x86
+From d8b1bb8edd99b2898720b4f10d292a67d532db48 Mon Sep 17 00:00:00 2001
+From: "Francisco Blas Izquierdo Riera (klondike)" <klondike@gentoo.org>
+Date: Mon, 22 Oct 2018 15:29:36 +0800
+Subject: [PATCH 4/4] Fix assemby textrels on rdrand_asm.S on PIC x86
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
 
 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.
@@ -19,11 +24,14 @@ Reported-by: Manuel Rüger <mrueg@gentoo.org>
 Tested-by: Anthony Basile <blueness@gentoo.org>
 
 Upstream-Status: Pending
+---
+ rdrand_asm.S | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
 
-Index: rng-tools-5/rdrand_asm.S
-===================================================================
---- rng-tools-5.orig/rdrand_asm.S
-+++ rng-tools-5/rdrand_asm.S
+diff --git a/rdrand_asm.S b/rdrand_asm.S
+index b5d260a..7811cf2 100644
+--- a/rdrand_asm.S
++++ b/rdrand_asm.S
 @@ -2,6 +2,7 @@
   * Copyright (c) 2011-2014, Intel Corporation
   * Authors: Fenghua Yu <fenghua.yu@intel.com>,
@@ -32,7 +40,7 @@ Index: rng-tools-5/rdrand_asm.S
   *
   * 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)
+@@ -172,7 +173,19 @@ ENTRY(x86_rdseed_or_rdrand_bytes)
  	jmp	4b
  ENDPROC(x86_rdseed_or_rdrand_bytes)
  
@@ -52,7 +60,7 @@ Index: rng-tools-5/rdrand_asm.S
  #define PTR0	%eax
  #define PTR1	%edx
  #define PTR2	%ecx
-@@ -190,6 +203,7 @@ ENTRY(x86_aes_mangle)
+@@ -188,6 +201,7 @@ ENTRY(x86_aes_mangle)
  	movl	8(%ebp), %eax
  	movl	12(%ebp), %edx
  	push	%esi
@@ -60,7 +68,7 @@ Index: rng-tools-5/rdrand_asm.S
  #endif
  	movl	$512, CTR3	/* Number of rounds */
  	
-@@ -280,6 +294,7 @@ offset = offset + 16
+@@ -278,6 +292,7 @@ offset = offset + 16
  	movdqa	%xmm7, (7*16)(PTR1)
  
  #ifdef __i386__
@@ -68,7 +76,7 @@ Index: rng-tools-5/rdrand_asm.S
  	pop	%esi
  	pop	%ebp
  #endif
-@@ -294,6 +309,7 @@ ENTRY(x86_aes_expand_key)
+@@ -292,6 +307,7 @@ ENTRY(x86_aes_expand_key)
  	push	%ebp
  	mov	%esp, %ebp
  	movl	8(%ebp), %eax
@@ -76,7 +84,7 @@ Index: rng-tools-5/rdrand_asm.S
  #endif
  
  	SETPTR(aes_round_keys, PTR1)
-@@ -323,6 +339,7 @@ ENTRY(x86_aes_expand_key)
+@@ -321,6 +337,7 @@ ENTRY(x86_aes_expand_key)
  	call	1f
  
  #ifdef __i386__
@@ -84,7 +92,7 @@ Index: rng-tools-5/rdrand_asm.S
  	pop	%ebp
  #endif
  	ret
-@@ -343,6 +360,16 @@ ENTRY(x86_aes_expand_key)
+@@ -341,6 +358,16 @@ ENTRY(x86_aes_expand_key)
  
  ENDPROC(x86_aes_expand_key)
  
@@ -101,3 +109,6 @@ Index: rng-tools-5/rdrand_asm.S
  	.bss
  	.balign 64
  aes_round_keys:
+-- 
+2.7.4
+
diff --git a/meta/recipes-support/rng-tools/rng-tools/underquote.patch b/meta/recipes-support/rng-tools/rng-tools/underquote.patch
index afd08d5..aa4bbcb 100644
--- a/meta/recipes-support/rng-tools/rng-tools/underquote.patch
+++ b/meta/recipes-support/rng-tools/rng-tools/underquote.patch
@@ -1,4 +1,8 @@
-Fix underquoted m4 entry. This causes a failure if gcrypt isn't present:
+From 03fe7efa1bc04a83fb9b6787998e7baa7ee90646 Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Mon, 22 Oct 2018 15:27:41 +0800
+Subject: [PATCH 3/4] 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
@@ -9,11 +13,17 @@ RP
 
 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(
+Rebase to 6.6
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index dd1c30f..88d2be3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -124,7 +124,7 @@ AS_IF(
  	[test "x$with_libgcrypt" != "xno"],
  	[
  		AC_CHECK_HEADER([gcrypt.h],
@@ -22,7 +32,7 @@ Index: rng-tools-5/configure.ac
  				[gcrypt],
  				[gcry_check_version], ,
  				[
-@@ -80,7 +80,7 @@ AS_IF(
+@@ -133,7 +133,7 @@ AS_IF(
  						AC_MSG_NOTICE([libgcrypt support disabled])
  					fi
  				]
@@ -31,3 +41,6 @@ Index: rng-tools-5/configure.ac
  			[if test "x$with_libgcrypt" != "xcheck"; then
  				AC_MSG_FAILURE([libgcrypt headers not found]); else
  				AC_MSG_NOTICE([libgcrypt support disabled])
+-- 
+2.7.4
+
diff --git a/meta/recipes-support/rng-tools/rng-tools_5.bb b/meta/recipes-support/rng-tools/rng-tools_6.6.bb
similarity index 72%
rename from meta/recipes-support/rng-tools/rng-tools_5.bb
rename to meta/recipes-support/rng-tools/rng-tools_6.6.bb
index 6765667..033af99 100644
--- a/meta/recipes-support/rng-tools/rng-tools_5.bb
+++ b/meta/recipes-support/rng-tools/rng-tools_6.6.bb
@@ -1,27 +1,38 @@
 SUMMARY = "Random number generator daemon"
 LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=0b6f033afe6db235e559456585dc8cdc"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/gkernel/${BP}.tar.gz \
+SRC_URI = "git://github.com/nhorman/rng-tools.git \
            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://rng-tools-5-fix-textrels-on-PIC-x86.patch \
-           file://read_error_msg.patch \
            file://init \
            file://default \
            file://rngd.service \
 "
+SRCREV = "4ebc21d6f387bb7b4b3f6badc429e27b21c0a6ee"
+S = "${WORKDIR}/git"
 
-SRC_URI[md5sum] = "6726cdc6fae1f5122463f24ae980dd68"
-SRC_URI[sha256sum] = "60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e"
+inherit autotools update-rc.d systemd pkgconfig
 
-inherit autotools update-rc.d systemd
+DEPENDS = "curl \
+           libxml2 \
+           openssl \
+           sysfsutils \
+           libgcrypt \
+          "
 
-PACKAGECONFIG = "libgcrypt"
+PACKAGECONFIG ??= "libgcrypt libjitterentropy"
 PACKAGECONFIG_libc-musl = "libargp"
 PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
 PACKAGECONFIG[libgcrypt] = "--with-libgcrypt,--without-libgcrypt,libgcrypt,"
+PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,--disable-jitterntropy,libjitterentropy"
+
+# Refer autogen.sh in rng-tools
+do_configure_prepend() {
+    cp ${S}/README.md ${S}/README
+}
 
 do_install_append() {
     # Only install the init script when 'sysvinit' is in DISTRO_FEATURES.
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/2] libjitterentropy: add 2.1.2
  2018-11-09  9:12 [PATCH 0/2] Integrated the jitter entropy daemon to work around slow boot problems for Yocto Hongxu Jia
  2018-11-09  9:12 ` [PATCH 1/2] rng-tools: 5 -> 6.6 Hongxu Jia
@ 2018-11-09  9:12 ` Hongxu Jia
  2018-11-09 10:30   ` richard.purdie
  1 sibling, 1 reply; 12+ messages in thread
From: Hongxu Jia @ 2018-11-09  9:12 UTC (permalink / raw)
  To: openembedded-core, richard.purdie

From the following kernel commit we know: Fedora has integrated the jitter
entropy daemon to work around slow boot problems, especially on VM's that
don't support virtio-rng

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=81e69df38e2911b642ec121dec319fad2a4782f3

Do the same thing for Yocto.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../files/0001-fix-do_install-failure-on-oe.patch  | 33 ++++++++++++++++++++++
 .../libjitterentropy/libjitterentropy_2.1.2.bb     | 28 ++++++++++++++++++
 2 files changed, 61 insertions(+)
 create mode 100644 meta/recipes-support/libjitterentropy/files/0001-fix-do_install-failure-on-oe.patch
 create mode 100644 meta/recipes-support/libjitterentropy/libjitterentropy_2.1.2.bb

diff --git a/meta/recipes-support/libjitterentropy/files/0001-fix-do_install-failure-on-oe.patch b/meta/recipes-support/libjitterentropy/files/0001-fix-do_install-failure-on-oe.patch
new file mode 100644
index 0000000..30ff4fe
--- /dev/null
+++ b/meta/recipes-support/libjitterentropy/files/0001-fix-do_install-failure-on-oe.patch
@@ -0,0 +1,33 @@
+From 00cefca0eefecec657969b50cd4e1ed5b057a857 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 25 Oct 2018 16:30:06 +0800
+Subject: [PATCH] fix do_install failure on oe
+
+- Do not strip at do_install
+
+- Create includedir
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 5e31276..76fcbfa 100644
+--- a/Makefile
++++ b/Makefile
+@@ -51,7 +51,8 @@ install:
+ 	install -m 644 doc/$(NAME).3 $(DESTDIR)$(PREFIX)/share/man/man3/
+ 	gzip -9 $(DESTDIR)$(PREFIX)/share/man/man3/$(NAME).3
+ 	install -d -m 0755 $(DESTDIR)$(PREFIX)/$(LIBDIR)
+-	install -m 0755 -s lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/
++	install -m 0755 lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/
++	install -d -m 0755 $(DESTDIR)$(PREFIX)/$(INCDIR)/
+ 	install -m 0644 jitterentropy.h $(DESTDIR)$(PREFIX)/$(INCDIR)/
+ 	install -m 0644 jitterentropy-base-user.h $(DESTDIR)$(PREFIX)/$(INCDIR)/
+ 	$(RM) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so.$(LIBMAJOR)
+-- 
+2.7.4
+
diff --git a/meta/recipes-support/libjitterentropy/libjitterentropy_2.1.2.bb b/meta/recipes-support/libjitterentropy/libjitterentropy_2.1.2.bb
new file mode 100644
index 0000000..3b5b4e4
--- /dev/null
+++ b/meta/recipes-support/libjitterentropy/libjitterentropy_2.1.2.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Hardware RNG based on CPU timing jitter"
+DESCRIPTION = "The Jitter RNG provides a noise source using the CPU execution timing jitter. \
+It does not depend on any system resource other than a high-resolution time \
+stamp. It is a small-scale, yet fast entropy source that is viable in almost \
+all environments and on a lot of CPU architectures."
+HOMEPAGE = "http://www.chronox.de/jent.html"
+LICENSE = "GPLv2+ | BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e52365752b36cfcd7f9601d80de7d8c6 \
+                    file://COPYING.gplv2;md5=eb723b61539feef013de476e68b5c50a \
+                    file://COPYING.bsd;md5=66a5cedaf62c4b2637025f049f9b826f \
+                   "
+SRC_URI = "git://github.com/smuellerDD/jitterentropy-library.git \
+           file://0001-fix-do_install-failure-on-oe.patch \
+          "
+SRCREV = "f5a80c6f3fcc6deebd0eabf75324f48aed1afbce"
+S = "${WORKDIR}/git"
+
+do_configure[noexec] = "1"
+
+LDFLAGS += "-Wl,-O0"
+
+do_install () {
+    oe_runmake install INCDIR="/include" \
+                       DESTDIR="${D}" \
+                       PREFIX="${exec_prefix}" \
+                       LIBDIR="${baselib}"
+}
+
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] libjitterentropy: add 2.1.2
  2018-11-09  9:12 ` [PATCH 2/2] libjitterentropy: add 2.1.2 Hongxu Jia
@ 2018-11-09 10:30   ` richard.purdie
  2018-11-09 14:18     ` Hongxu Jia
  0 siblings, 1 reply; 12+ messages in thread
From: richard.purdie @ 2018-11-09 10:30 UTC (permalink / raw)
  To: Hongxu Jia, openembedded-core

On Fri, 2018-11-09 at 17:12 +0800, Hongxu Jia wrote:
> From the following kernel commit we know: Fedora has integrated the
> jitter
> entropy daemon to work around slow boot problems, especially on VM's
> that
> don't support virtio-rng
> 
> 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=81e69df38e2911b642ec121dec319fad2a4782f3
> 
> Do the same thing for Yocto.
> 
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>

I'm not convinced this is going to help. The userspace support comes up
quite late and the kernel blocking has already happened before that
point when I last saw these issues. This was why I just enabled the
virtio rng passthrough everywhere...

Is libjitterentropy actually helping your use cases?

Cheers,

Richard



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] libjitterentropy: add 2.1.2
  2018-11-09 10:30   ` richard.purdie
@ 2018-11-09 14:18     ` Hongxu Jia
  0 siblings, 0 replies; 12+ messages in thread
From: Hongxu Jia @ 2018-11-09 14:18 UTC (permalink / raw)
  To: richard.purdie, openembedded-core

On 2018/11/9 下午6:30, richard.purdie@linuxfoundation.org wrote:
> On Fri, 2018-11-09 at 17:12 +0800, Hongxu Jia wrote:
>>  From the following kernel commit we know: Fedora has integrated the
>> jitter
>> entropy daemon to work around slow boot problems, especially on VM's
>> that
>> don't support virtio-rng
>>
>>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=81e69df38e2911b642ec121dec319fad2a4782f3
>> Do the same thing for Yocto.
>>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> I'm not convinced this is going to help. The userspace support comes up
> quite late and the kernel blocking has already happened before that
> point when I last saw these issues. This was why I just enabled the
> virtio rng passthrough everywhere...

Yes, if VM support virtio-rng, we indeed do not need it, but for VM not 
support virtio-rng, it makes sense.


> Is libjitterentropy actually helping your use cases?

Yes, it helps,  I use runqemu without  virtio-rng  on qemumips64 to 
simulate VM that don't support virtio-rng

With libjitterentropy and rng-tools, it takes <60s to init crng (after 
rngd-tools started successfully)

[   48.967114] random: crng init done

Fri Nov  9 14:06:49 2018: Starting random number generator daemon
Fri Nov  9 14:06:50 2018: Initalizing available sources
Fri Nov  9 14:06:50 2018:
Fri Nov  9 14:06:50 2018: Failed to init entropy source hwrng
Fri Nov  9 14:06:50 2018:
Fri Nov  9 14:07:05 2018: Enabling JITTER rng support
Fri Nov  9 14:07:06 2018:
Fri Nov  9 14:07:06 2018: Initalizing entropy source jitter
Fri Nov  9 14:07:06 2018:
Fri Nov  9 14:07:06 2018: .
Fri Nov  9 14:07:06 2018: Starting OpenBSD Secure Shell server: sshd
Fri Nov  9 14:07:06 2018: done.
Fri Nov  9 14:07:07 2018: hwclock: can't open '/dev/misc/rtc': No such 
file or directory
Fri Nov  9 14:07:07 2018: Starting syslogd/klogd: done
Nov  9 14:07:07 qemumips64 user.notice kernel: [   48.967114] random: 
crng init done


Without libjitterentropy and rng-tools, it takes >2minutes to init crng 
(there are some other

virtual device to generate noise for entropy)

[  124.728869] random: crng init done


By the way, without virtio-rng, /dev/hwrng is dead on guest, that's the 
reason why I upgrade

rng-tools and integrate libjitterentropy, previously old rng-tools hung 
minutes in this situation.


//Hongxu


> Cheers,
>
> Richard
>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] rng-tools: 5 -> 6.6
  2018-11-09  9:12 ` [PATCH 1/2] rng-tools: 5 -> 6.6 Hongxu Jia
@ 2018-11-09 22:50   ` richard.purdie
  2018-11-09 23:00     ` Richard Purdie
  2018-11-10  1:14     ` Hongxu Jia
  0 siblings, 2 replies; 12+ messages in thread
From: richard.purdie @ 2018-11-09 22:50 UTC (permalink / raw)
  To: Hongxu Jia, openembedded-core

On Fri, 2018-11-09 at 17:12 +0800, Hongxu Jia wrote:
> -PACKAGECONFIG = "libgcrypt"
> +PACKAGECONFIG ??= "libgcrypt libjitterentropy"
>  PACKAGECONFIG_libc-musl = "libargp"
>  PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
>  PACKAGECONFIG[libgcrypt] = "--with-libgcrypt,--without-libgcrypt,libgcrypt,"
> +PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,--disable-jitterntropy,libjitterentropy"
> +
> +# Refer autogen.sh in rng-tools
> +do_configure_prepend() {
> +    cp ${S}/README.md ${S}/README
> +}
>  
>  do_install_append() {
>      # Only install the init script when 'sysvinit' is in DISTRO_FEATURES.

This fails on musl, likely as the libc-musl override wasn't tweaked. It
also means that the no libjitterentropy case wasn't tested as there is
a typo likely causing this:

https://autobuilder.yoctoproject.org/typhoon/#/builders/11/builds/190/steps/7/logs/step1b

There are also other weird hangs being observed on the autobuilder
after these changes. I can't prove its this patchset but I am
suspicious and its something in master-next as things were working just
fine until we started poking around all this again :(

https://autobuilder.yoctoproject.org/typhoon/#/builders/34/builds/182/steps/7/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/2/builds/188/steps/7/logs/stdio


Cheers,

Richard





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] rng-tools: 5 -> 6.6
  2018-11-09 22:50   ` richard.purdie
@ 2018-11-09 23:00     ` Richard Purdie
  2018-11-10  1:14     ` Hongxu Jia
  1 sibling, 0 replies; 12+ messages in thread
From: Richard Purdie @ 2018-11-09 23:00 UTC (permalink / raw)
  To: Hongxu Jia, openembedded-core

On Fri, 2018-11-09 at 22:50 +0000, richard.purdie@linuxfoundation.org
wrote:
> On Fri, 2018-11-09 at 17:12 +0800, Hongxu Jia wrote:
> > -PACKAGECONFIG = "libgcrypt"
> > +PACKAGECONFIG ??= "libgcrypt libjitterentropy"
> >  PACKAGECONFIG_libc-musl = "libargp"
> >  PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-
> > standalone,"
> >  PACKAGECONFIG[libgcrypt] = "--with-libgcrypt,--without-
> > libgcrypt,libgcrypt,"
> > +PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,
> > --disable-jitterntropy,libjitterentropy"
> > +
> > +# Refer autogen.sh in rng-tools
> > +do_configure_prepend() {
> > +    cp ${S}/README.md ${S}/README
> > +}
> >  
> >  do_install_append() {
> >      # Only install the init script when 'sysvinit' is in
> > DISTRO_FEATURES.
> 
> This fails on musl, likely as the libc-musl override wasn't tweaked.
> It
> also means that the no libjitterentropy case wasn't tested as there
> is
> a typo likely causing this:
> 
> 
https://autobuilder.yoctoproject.org/typhoon/#/builders/11/builds/190/steps/7/logs/step1b

The above is definitely from the typo and musl misconfiguration in this
patch.

> There are also other weird hangs being observed on the autobuilder
> after these changes. I can't prove its this patchset but I am
> suspicious and its something in master-next as things were working
> just
> fine until we started poking around all this again :(
> 
> 
https://autobuilder.yoctoproject.org/typhoon/#/builders/34/builds/182/steps/7/logs/stdio
> 
https://autobuilder.yoctoproject.org/typhoon/#/builders/2/builds/188/steps/7/logs/stdio

Looking further into the above shows:

NOTE:
======================================================================
NOTE: ERROR: tearDownClass (opkg.OpkgRepoTest)
NOTE: ----------------------------------------------------------------------
NOTE: Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/nightly-x32/build/meta/lib/oeqa/core/case.py", line 36, in _oeTearDownClass
    clss.tearDownClassMethod()
  File "/home/pokybuild/yocto-worker/nightly-x32/build/meta/lib/oeqa/runtime/cases/opkg.py", line 29, in tearDownClass
    cls.repo_server.stop()
  File "/home/pokybuild/yocto-worker/nightly-x32/build/meta/lib/oeqa/utils/httpserver.py", line 36, in stop
    self.process.join()
  File "/usr/lib/python3.6/multiprocessing/process.py", line 124, in join
    res = self._popen.wait(timeout)
  File "/usr/lib/python3.6/multiprocessing/popen_fork.py", line 50, in wait
    return self.poll(os.WNOHANG if timeout == 0.0 else 0)
  File "/usr/lib/python3.6/multiprocessing/popen_fork.py", line 28, in poll
    pid, sts = os.waitpid(self.pid, flag)
  File "/home/pokybuild/yocto-worker/nightly-x32/build/meta/classes/testimage.bbclass", line 166, in sigterm_exception
    raise RuntimeError
RuntimeError

which is probably other patches in -next but raises some questions
about why an error like this would just hang.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] rng-tools: 5 -> 6.6
  2018-11-09 22:50   ` richard.purdie
  2018-11-09 23:00     ` Richard Purdie
@ 2018-11-10  1:14     ` Hongxu Jia
  2018-11-10  2:22       ` Hongxu Jia
  1 sibling, 1 reply; 12+ messages in thread
From: Hongxu Jia @ 2018-11-10  1:14 UTC (permalink / raw)
  To: richard.purdie, openembedded-core

On 2018/11/10 上午6:50, richard.purdie@linuxfoundation.org wrote:
> On Fri, 2018-11-09 at 17:12 +0800, Hongxu Jia wrote:
>> -PACKAGECONFIG = "libgcrypt"
>> +PACKAGECONFIG ??= "libgcrypt libjitterentropy"
>>   PACKAGECONFIG_libc-musl = "libargp"
>>   PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
>>   PACKAGECONFIG[libgcrypt] = "--with-libgcrypt,--without-libgcrypt,libgcrypt,"
>> +PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,--disable-jitterntropy,libjitterentropy"
>> +
>> +# Refer autogen.sh in rng-tools
>> +do_configure_prepend() {
>> +    cp ${S}/README.md ${S}/README
>> +}
>>   
>>   do_install_append() {
>>       # Only install the init script when 'sysvinit' is in DISTRO_FEATURES.
> This fails on musl, likely as the libc-musl override wasn't tweaked. It
> also means that the no libjitterentropy case wasn't tested as there is
> a typo likely causing this:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/11/builds/190/steps/7/logs/step1b

Sorry, I am working on it

//Hongxu

> There are also other weird hangs being observed on the autobuilder
> after these changes. I can't prove its this patchset but I am
> suspicious and its something in master-next as things were working just
> fine until we started poking around all this again :(
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/34/builds/182/steps/7/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#/builders/2/builds/188/steps/7/logs/stdio
>
>
> Cheers,
>
> Richard
>
>
>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] rng-tools: 5 -> 6.6
  2018-11-10  1:14     ` Hongxu Jia
@ 2018-11-10  2:22       ` Hongxu Jia
  2018-11-11 10:18         ` richard.purdie
  0 siblings, 1 reply; 12+ messages in thread
From: Hongxu Jia @ 2018-11-10  2:22 UTC (permalink / raw)
  To: richard.purdie, openembedded-core

[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

On 2018/11/10 上午9:14, Hongxu Jia wrote:
>
>
>> There are also other weird hangs being observed on the autobuilder
>> after these changes. I can't prove its this patchset but I am
>> suspicious and its something in master-next as things were working just
>> fine until we started poking around all this again :(
>>
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/34/builds/182/steps/7/logs/stdio 
>>
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/2/builds/188/steps/7/logs/stdio 
>>

I am trying to catch the issue patches

//Hongxu


[-- Attachment #2: Type: text/html, Size: 1549 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] rng-tools: 5 -> 6.6
  2018-11-10  2:22       ` Hongxu Jia
@ 2018-11-11 10:18         ` richard.purdie
  2018-11-12  2:10           ` Hongxu Jia
  0 siblings, 1 reply; 12+ messages in thread
From: richard.purdie @ 2018-11-11 10:18 UTC (permalink / raw)
  To: Hongxu Jia, openembedded-core

On Sat, 2018-11-10 at 10:22 +0800, Hongxu Jia wrote:
> On 2018/11/10 上午9:14, Hongxu Jia wrote:
> > 
> > > There are also other weird hangs being observed on the
> > > autobuilder 
> > > after these changes. I can't prove its this patchset but I am 
> > > suspicious and its something in master-next as things were
> > > working just 
> > > fine until we started poking around all this again :( 
> > > 
> > > 
https://autobuilder.yoctoproject.org/typhoon/#/builders/34/builds/182/steps/7/logs/stdio
> > >  
> > > 
https://autobuilder.yoctoproject.org/typhoon/#/builders/2/builds/188/steps/7/logs/stdio
> > >  
> 
> I am trying to catch the issue patches

I dropped all the rng pieces from -next and the current build is
looking a lot happier from a timeout perspective. It does seem to
mainly affect x86, particularly the x32 target for some reason but its
not exclusive to that.

Even if its kernel config or something like that, it still seems like
its a regression to cause hangs when we didn't have any before...

Cheers,

Richard



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] rng-tools: 5 -> 6.6
  2018-11-11 10:18         ` richard.purdie
@ 2018-11-12  2:10           ` Hongxu Jia
  2018-11-12 13:32             ` richard.purdie
  0 siblings, 1 reply; 12+ messages in thread
From: Hongxu Jia @ 2018-11-12  2:10 UTC (permalink / raw)
  To: richard.purdie, openembedded-core

[-- Attachment #1: Type: text/plain, Size: 640 bytes --]

On 2018/11/11 下午6:18, richard.purdie@linuxfoundation.org wrote:
>> I am trying to catch the issue patches
> I dropped all the rng pieces from -next and the current build is
> looking a lot happier from a timeout perspective. It does seem to
> mainly affect x86, particularly the x32 target for some reason but its
> not exclusive to that.

The rng-tools is not installed to any image by default,

I curious why it affect run time test

//Hongxu


> Even if its kernel config or something like that, it still seems like
> its a regression to cause hangs when we didn't have any before...
>
> Cheers,
>
> Richard
>


[-- Attachment #2: Type: text/html, Size: 1489 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] rng-tools: 5 -> 6.6
  2018-11-12  2:10           ` Hongxu Jia
@ 2018-11-12 13:32             ` richard.purdie
  0 siblings, 0 replies; 12+ messages in thread
From: richard.purdie @ 2018-11-12 13:32 UTC (permalink / raw)
  To: Hongxu Jia, openembedded-core

On Mon, 2018-11-12 at 10:10 +0800, Hongxu Jia wrote:
> On 2018/11/11 下午6:18, richard.purdie@linuxfoundation.org wrote:
> > > I am trying to catch the issue patches
> > 
> > I dropped all the rng pieces from -next and the current build is
> > looking a lot happier from a timeout perspective. It does seem to
> > mainly affect x86, particularly the x32 target for some reason but
> > its
> > not exclusive to that.
> 
> The rng-tools is not installed to any image by default,
> I curious why it affect run time test

I found we could still get the timeout issues with the rng patches
removed so I think its something to do with the testimage changes. I'm
continuing to try and figure out which patches are causing it but I
don't think its the rng ones now. Sorry for the false alarm, its tricky
to figure out where a problem like this is from.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-11-12 13:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-09  9:12 [PATCH 0/2] Integrated the jitter entropy daemon to work around slow boot problems for Yocto Hongxu Jia
2018-11-09  9:12 ` [PATCH 1/2] rng-tools: 5 -> 6.6 Hongxu Jia
2018-11-09 22:50   ` richard.purdie
2018-11-09 23:00     ` Richard Purdie
2018-11-10  1:14     ` Hongxu Jia
2018-11-10  2:22       ` Hongxu Jia
2018-11-11 10:18         ` richard.purdie
2018-11-12  2:10           ` Hongxu Jia
2018-11-12 13:32             ` richard.purdie
2018-11-09  9:12 ` [PATCH 2/2] libjitterentropy: add 2.1.2 Hongxu Jia
2018-11-09 10:30   ` richard.purdie
2018-11-09 14:18     ` Hongxu Jia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.