From patchwork Wed Feb 5 18:26:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 1233971 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rockwellcollins.com Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48CVPt0k6wz9sRK for ; Thu, 6 Feb 2020 05:26:26 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 980EF86804; Wed, 5 Feb 2020 18:26:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8d0qWUqoU7LX; Wed, 5 Feb 2020 18:26:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 1B27A86749; Wed, 5 Feb 2020 18:26:19 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 795681BF5A4 for ; Wed, 5 Feb 2020 18:26:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7662B85C1D for ; Wed, 5 Feb 2020 18:26:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 63GPj1Od7JfS for ; Wed, 5 Feb 2020 18:26:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from secvs04.rockwellcollins.com (smtpimr.rockwellcollins.com [205.175.225.130]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 8A5618558F for ; Wed, 5 Feb 2020 18:26:17 +0000 (UTC) IronPort-SDR: U+5otV2YlfjVQor29PIfhC8vd2XyEmqIiUeF1nVlRLgt+PRM1D6sFSw5pZZAzivHLFpuX38k38 3mwEIkYKAAoxTdSIpW8U4JJieXL7/fBSv+VlJ8iu1MHnlwYAuTKchxN7NlUrrieuQP6UYq1zkx kZL4FcV4YoIMQU8Mzthw5ms0jc3dSpISZWc1YUqB2fe2kSf4Q+ouQo110jdoi81VtnMG+j0iH/ myBy+SiCwNFLkKXslqWpq8D+fh0++HiPj7H8v+ApRanl92vhxyDBaMIW3dRN9MhLDYa3mD/DCM rHQ= Received: from ofwgwc03.rockwellcollins.com (HELO dtulimr01.rockwellcollins.com) ([205.175.225.12]) by secvs04.rockwellcollins.com with ESMTP; 05 Feb 2020 12:26:09 -0600 X-Received: from gravy.rockwellcollins.lab (gravy.rockwellcollins.lab [10.148.114.119]) by dtulimr01.rockwellcollins.com (Postfix) with ESMTP id 81ACC60354; Wed, 5 Feb 2020 12:26:09 -0600 (CST) From: Matt Weber To: buildroot@buildroot.org Date: Wed, 5 Feb 2020 12:26:08 -0600 Message-Id: <20200205182608.22695-1-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH] package/rng-tools: make jitterentropy conditional X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matt Weber MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 --- 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]