Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/rng-tools: fix build with updated jitterentropy-library
@ 2022-12-28 18:11 Bernd Kuhls
  2022-12-28 20:02 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Kuhls @ 2022-12-28 18:11 UTC (permalink / raw)
  To: buildroot; +Cc: Matt Weber

Commit a8807ddbe2 bumped package jitterentropy-library to version 3.4.1
which broke building rng-tools.

Add two upstream patches which improve jitterentropy-library detection.

Fixes:
http://autobuild.buildroot.net/results/a6f/a6f1381b3d1aa2a27412286167f5c8be5f6fdaf8/

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 ...ropy-detection-to-look-for-the-setti.patch | 30 ++++++++++++++
 ...ropy-library-to-timeout-fail-on-long.patch | 39 +++++++++++++++++++
 2 files changed, 69 insertions(+)
 create mode 100644 package/rng-tools/0002-Adjust-jitterentropy-detection-to-look-for-the-setti.patch
 create mode 100644 package/rng-tools/0003-Adjust-jitterentropy-library-to-timeout-fail-on-long.patch

diff --git a/package/rng-tools/0002-Adjust-jitterentropy-detection-to-look-for-the-setti.patch b/package/rng-tools/0002-Adjust-jitterentropy-detection-to-look-for-the-setti.patch
new file mode 100644
index 0000000000..553842640d
--- /dev/null
+++ b/package/rng-tools/0002-Adjust-jitterentropy-detection-to-look-for-the-setti.patch
@@ -0,0 +1,30 @@
+From e2698477e8abf623c18ab28d33cc894ec882a706 Mon Sep 17 00:00:00 2001
+From: Neil Horman <neil.horman@privafy.com>
+Date: Fri, 18 Mar 2022 18:59:52 -0400
+Subject: [PATCH] Adjust jitterentropy detection to look for the settick
+ function
+
+Theres no great way to detect if jitterentropy has the internal timer
+feature enabled so we have to look for a function that is only defined
+when it is enabled
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+[downloaded from upstream commit
+ https://github.com/nhorman/rng-tools/commit/e2698477e8abf623c18ab28d33cc894ec882a706]
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index e16e1a0..0f5a38e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -94,7 +94,7 @@ AS_IF(
+ 		AC_SEARCH_LIBS(jent_version,jitterentropy,
+ 				[AM_CONDITIONAL([JITTER], [true])
+ 				AC_DEFINE([HAVE_JITTER],1,[Enable JITTER])
+-				AC_CHECK_LIB(jitterentropy, jent_entropy_switch_notime_impl,
++				AC_CHECK_LIB(jitterentropy, jent_notime_settick,
+ 				[AC_DEFINE([HAVE_JITTER_NOTIME],1,[Enable JITTER_NOTIME])],
+ 				[],-lpthread)],
+ 				AC_MSG_NOTICE([No Jitterentropy library found]),-lpthread)
diff --git a/package/rng-tools/0003-Adjust-jitterentropy-library-to-timeout-fail-on-long.patch b/package/rng-tools/0003-Adjust-jitterentropy-library-to-timeout-fail-on-long.patch
new file mode 100644
index 0000000000..9d8dbe2d0b
--- /dev/null
+++ b/package/rng-tools/0003-Adjust-jitterentropy-library-to-timeout-fail-on-long.patch
@@ -0,0 +1,39 @@
+From c29424f10a0dcbd18ac25607fa1c81c18a960e81 Mon Sep 17 00:00:00 2001
+From: Neil Horman <nhorman@tuxdriver.com>
+Date: Mon, 16 May 2022 13:38:54 -0400
+Subject: [PATCH] Adjust jitterentropy library to timeout/fail on long delay
+
+[Bernd: removed description of unrelated part of the patch]
+
+Also while we're at it, I might have a build solution for the presence
+of internal timers.  When jitterentropy is built without internal
+timers, jent_notime_init is defined publically, but when it is built
+with timers, its declared as a static symbol, preenting resolution, so
+we can test to see if the function exists.  If it does we _don't_ have
+notime support. The logic is a bit backwards, but i think it works
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+[downloaded configure.ac patch from upstream commit
+ https://github.com/nhorman/rng-tools/commit/57be6d4c90e78ea9ad036a3a6e9b09822ed4d219]
+---
+ configure.ac  |  6 ++---
+ rngd_jitter.c | 62 ++++++++++++++++++++++++++++++++++++++-------------
+ 2 files changed, 49 insertions(+), 19 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 52f2bb5..0af64e7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -101,9 +101,9 @@ AS_IF(
+ 		AC_SEARCH_LIBS(jent_version,jitterentropy,
+ 				[AM_CONDITIONAL([JITTER], [true])
+ 				AC_DEFINE([HAVE_JITTER],1,[Enable JITTER])
+-				AC_CHECK_LIB(jitterentropy, jent_notime_settick,
+-				[AC_DEFINE([HAVE_JITTER_NOTIME],1,[Enable JITTER_NOTIME])],
+-				[],-lpthread)],
++				AC_CHECK_LIB(jitterentropy, jent_notime_init,
++				[],
++				[AC_DEFINE([HAVE_JITTER_NOTIME],1, [Enable JITTER_NOTIME])],-lpthread)],
+ 				AC_MSG_NOTICE([No Jitterentropy library found]),-lpthread)
+ 	], [AC_MSG_NOTICE([Disabling JITTER entropy source])]
+ )
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/rng-tools: fix build with updated jitterentropy-library
  2022-12-28 18:11 [Buildroot] [PATCH 1/1] package/rng-tools: fix build with updated jitterentropy-library Bernd Kuhls
@ 2022-12-28 20:02 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-12-28 20:02 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: Matt Weber, buildroot

On Wed, 28 Dec 2022 19:11:49 +0100
Bernd Kuhls <bernd.kuhls@t-online.de> wrote:

> Commit a8807ddbe2 bumped package jitterentropy-library to version 3.4.1
> which broke building rng-tools.
> 
> Add two upstream patches which improve jitterentropy-library detection.
> 
> Fixes:
> http://autobuild.buildroot.net/results/a6f/a6f1381b3d1aa2a27412286167f5c8be5f6fdaf8/
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
>  ...ropy-detection-to-look-for-the-setti.patch | 30 ++++++++++++++
>  ...ropy-library-to-timeout-fail-on-long.patch | 39 +++++++++++++++++++
>  2 files changed, 69 insertions(+)
>  create mode 100644 package/rng-tools/0002-Adjust-jitterentropy-detection-to-look-for-the-setti.patch
>  create mode 100644 package/rng-tools/0003-Adjust-jitterentropy-library-to-timeout-fail-on-long.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-12-28 20:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-28 18:11 [Buildroot] [PATCH 1/1] package/rng-tools: fix build with updated jitterentropy-library Bernd Kuhls
2022-12-28 20:02 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox