Skip to contentSkip to conversation

Integrated the jitter entropy daemon to work around slow boot problems for Yocto

PATCH In review Hongxu Jia 2 participants 12 messages Nov 9, 2018 – Nov 12, 2018

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover Integrated the jitter entropy daemon to work around slow boot problems for Yocto

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%)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/2 rng-tools: 5 -> 6.6

- 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

---
 ...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%)
meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch +5 -5
index 4bd9d31..06d1d94 100644
@@ -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 <[email protected]>
 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 <[email protected]>
  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
 
meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch +12 -9
index 1c8a79c..be60fe9 100644
@@ -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 <[email protected]>
-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 <[email protected]>
+
+Rebase to 6.6
+Signed-off-by: Hongxu Jia <[email protected]>
 ---
  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
 
meta/recipes-support/rng-tools/rng-tools/read_error_msg.patch deleted +0 -98

98 lines not on this page · raw message

meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch +23 -12
index 93a5864..614adab 100644
@@ -1,5 +1,10 @@
-From: Francisco Blas Izquierdo Riera (klondike) <[email protected]>
-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)" <[email protected]>
+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 <[email protected]>
 Tested-by: Anthony Basile <[email protected]>
 
 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 <[email protected]>,
@@ -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
+
meta/recipes-support/rng-tools/rng-tools/underquote.patch +20 -7
index afd08d5..aa4bbcb 100644
@@ -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 <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta/recipes-support/rng-tools/rng-tools_6.6.bb renamed from meta/recipes-support/rng-tools/rng-tools_5.bb +18 -7
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
@@ -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.
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 1/2] rng-tools: 5 -> 6.6

Quoted 4 lines · Hongxu Jia
meta/recipes-support/rng-tools/rng-tools_6.6.bb renamed from meta/recipes-support/rng-tools/rng-tools_5.bb +1 -1
-PACKAGECONFIG = "libgcrypt"
+PACKAGECONFIG ??= "libgcrypt libjitterentropy"
 PACKAGECONFIG_libc-musl = "libargp"
 PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"

meta/recipes-support/rng-tools/rng-tools_6.6.bb line 38

Quoted 10 lines
meta/recipes-support/rng-tools/rng-tools_6.6.bb renamed from meta/recipes-support/rng-tools/rng-tools_5.bb +6 -0
 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

#3 lore raw

Re: [PATCH 1/2] rng-tools: 5 -> 6.6

Quoted 16 lines · On Fri, 2018-11-09 at 22:50 +0000, [email protected] wrote:
Quoted 15 lines · Hongxu Jia
meta/recipes-support/rng-tools/rng-tools_6.6.bb renamed from meta/recipes-support/rng-tools/rng-tools_5.bb +1 -1
-PACKAGECONFIG = "libgcrypt"
+PACKAGECONFIG ??= "libgcrypt libjitterentropy"
 PACKAGECONFIG_libc-musl = "libargp"
 PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-

standalone,"
PACKAGECONFIG[libgcrypt] = "--with-libgcrypt,--without-
libgcrypt,libgcrypt,"

meta/recipes-support/rng-tools/rng-tools_6.6.bb renamed from meta/recipes-support/rng-tools/rng-tools_5.bb +6 -1
+PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,
--disable-jitterntropy,libjitterentropy"
+
+# Refer autogen.sh in rng-tools
+do_configure_prepend() {
+    cp ${S}/README.md ${S}/README
+}
Quoted 11 lines
Quoted 3 lines

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.

Quoted 7 lines

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

Quoted 1 line

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

author
#4 lore raw

Re: [PATCH 1/2] rng-tools: 5 -> 6.6

In reply to [email protected]
Quoted 13 lines · On 2018/11/10 上午6:50, [email protected] wrote:
Quoted 12 lines · Hongxu Jia
meta/recipes-support/rng-tools/rng-tools_6.6.bb renamed from meta/recipes-support/rng-tools/rng-tools_5.bb +7 -1
-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
+}
Quoted 7 lines
Quoted 2 lines
  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

Quoted 15 lines

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

author
#5 lore raw

Re: [PATCH 1/2] rng-tools: 5 -> 6.6

Quoted 11 lines · Hongxu Jia
Quoted 11 lines

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

#6 lore raw

Re: [PATCH 1/2] rng-tools: 5 -> 6.6

Quoted 10 lines · Hongxu Jia
Quoted 9 lines · Hongxu Jia
Quoted 9 lines

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

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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

Quoted 3 lines
Quoted 1 line
Quoted 1 line

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

author
#7 lore raw

Re: [PATCH 1/2] rng-tools: 5 -> 6.6

Quoted 5 lines · On 2018/11/11 下午6:18, [email protected] wrote:
Quoted 1 line

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

Quoted 7 lines

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

#8 lore raw

Re: [PATCH 1/2] rng-tools: 5 -> 6.6

Quoted 11 lines · Hongxu Jia
Quoted 7 lines · On 2018/11/11 下午6:18, [email protected] wrote:
Quoted 1 line

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

author
#9 lore raw

PATCH 2/2 libjitterentropy: add 2.1.2

In reply to Hongxu Jia

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.

---
 .../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
meta/recipes-support/libjitterentropy/files/0001-fix-do_install-failure-on-oe.patch new file +33 -0
new file mode 100644
index 0000000..30ff4fe
@@ -0,0 +1,33 @@
+From 00cefca0eefecec657969b50cd4e1ed5b057a857 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta/recipes-support/libjitterentropy/libjitterentropy_2.1.2.bb new file +28 -0
new file mode 100644
index 0000000..3b5b4e4
@@ -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}"
+}
+
Signature · 1 line
2.7.4
#10 lore raw

Re: [PATCH 2/2] libjitterentropy: add 2.1.2

Quoted 7 lines · Hongxu Jia

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

Quoted 4 lines

Do the same thing for Yocto.

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

author
#11 lore raw

Re: [PATCH 2/2] libjitterentropy: add 2.1.2

Quoted 8 lines · On 2018/11/9 下午6:30, [email protected] wrote:
Quoted 7 lines · Hongxu Jia

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

Quoted 8 lines

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

Quoted 3 lines

Do the same thing for Yocto.

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.

Quoted 1 line

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

Quoted 4 lines

Cheers,

Richard