All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Weber <matthew.weber@rockwellcollins.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/rng-tools: make jitterentropy conditional
Date: Wed,  5 Feb 2020 12:26:08 -0600	[thread overview]
Message-ID: <20200205182608.22695-1-matthew.weber@rockwellcollins.com> (raw)

The update of rng-tools from 5 to 6.7 introduced a change where
the jitterentropy library was enabled by default instead of
returning a special 66 return code to hangle the case of no
hwrng. This patch reverts that change and allows a user to
select when to enable the jitterentropy source. The bug
documents an issue of when a hwrng is enabled with jitterentropy
there is a longer boot time.

Fixes:
https://bugs.busybox.net/show_bug.cgi?id=12511

Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
 package/rng-tools/Config.in    | 1 -
 package/rng-tools/rng-tools.mk | 9 ++++++++-
 package/rng-tools/rngd.service | 1 +
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/package/rng-tools/Config.in b/package/rng-tools/Config.in
index 71514260e6..ddcc221d06 100644
--- a/package/rng-tools/Config.in
+++ b/package/rng-tools/Config.in
@@ -4,7 +4,6 @@ config BR2_PACKAGE_RNG_TOOLS
 	# pthread_setaffinity_np
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
 	select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL
-	select BR2_PACKAGE_JITTERENTROPY_LIBRARY
 	# For rdrand & darn ligcrypt is required and it's not obvious to users
 	select BR2_PACKAGE_LIBGCRYPT if BR2_i386 || BR2_x86_64 || BR2_powerpc64le
 	select BR2_PACKAGE_LIBSYSFS
diff --git a/package/rng-tools/rng-tools.mk b/package/rng-tools/rng-tools.mk
index 274079044c..e458fbb8eb 100644
--- a/package/rng-tools/rng-tools.mk
+++ b/package/rng-tools/rng-tools.mk
@@ -8,7 +8,7 @@ RNG_TOOLS_VERSION = 6.8
 RNG_TOOLS_SITE = $(call github,nhorman,$(RNG_TOOLS_NAME),v$(RNG_TOOLS_VERSION))
 RNG_TOOLS_LICENSE = GPL-2.0
 RNG_TOOLS_LICENSE_FILES = COPYING
-RNG_TOOLS_DEPENDENCIES = libsysfs jitterentropy-library host-pkgconf
+RNG_TOOLS_DEPENDENCIES = libsysfs host-pkgconf
 # From git
 RNG_TOOLS_AUTORECONF = YES
 
@@ -29,6 +29,13 @@ else
 RNG_TOOLS_CONF_OPTS += --without-libgcrypt
 endif
 
+ifeq ($(BR2_PACKAGE_JITTERENTROPY_LIBRARY),y)
+RNG_TOOLS_DEPENDENCIES += jitterentropy-library
+RNG_TOOLS_CONF_OPTS += --enable-jitterentropy
+else
+RNG_TOOLS_CONF_OPTS += --disable-jitterentropy
+endif
+
 define RNG_TOOLS_INSTALL_INIT_SYSV
 	$(INSTALL) -D -m 755 package/rng-tools/S21rngd \
 		$(TARGET_DIR)/etc/init.d/S21rngd
diff --git a/package/rng-tools/rngd.service b/package/rng-tools/rngd.service
index 11386d1e5d..c0bcffe59e 100644
--- a/package/rng-tools/rngd.service
+++ b/package/rng-tools/rngd.service
@@ -3,6 +3,7 @@ Description=Hardware RNG Entropy Gatherer Daemon
 
 [Service]
 ExecStart=/usr/sbin/rngd -f $DAEMON_ARGS
+SuccessExitStatus=66
 EnvironmentFile=-/etc/default/rngd
 
 [Install]
-- 
2.17.1

             reply	other threads:[~2020-02-05 18:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05 18:26 Matt Weber [this message]
2020-02-05 19:32 ` [Buildroot] [PATCH] package/rng-tools: make jitterentropy conditional Thomas Petazzoni
2020-02-05 20:46   ` Matthew Weber
2020-02-06  1:12     ` Matthew Weber
2020-02-08 19:12       ` Peter Korsgaard
2020-02-11 15:03         ` Matthew Weber
2020-02-11 15:21           ` Yegor Yefremov
2020-02-13 17:07             ` Matthew Weber
2020-05-18  7:48               ` Thomas Petazzoni
2020-05-19 22:08                 ` Matthew Weber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200205182608.22695-1-matthew.weber@rockwellcollins.com \
    --to=matthew.weber@rockwellcollins.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.