* [Buildroot] [PATCH v5 1/2] package/jitterentropy-library: new package
@ 2019-10-22 18:17 Matt Weber
2019-10-22 18:17 ` [Buildroot] [PATCH v5 2/2] package/rng-tools: bump to 6.7 Matt Weber
2019-10-22 18:39 ` [Buildroot] [PATCH v5 1/2] package/jitterentropy-library: new package Thomas Petazzoni
0 siblings, 2 replies; 4+ messages in thread
From: Matt Weber @ 2019-10-22 18:17 UTC (permalink / raw)
To: buildroot
New library to support rng-tools using a CPU source as a backup entropy
source when a kernel provided rng isn't present.
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
Changes
v5
[Thomas
- Added upstreamable changes to Makefile cleanup patch and submitted
upstream. (restored man install and created optional lib strip)
- Removed clang optimization pragma fix
v4
[Matt
- Added include folder creation in Makefile cleanup patch to cover
case of when it might not exist on a rebuild
[Romain
- Force no optimization for case where Clang is used to compile and
doesn't respect GCC pragmas
v1 -> v3
- No changes
foo
---
DEVELOPERS | 1 +
package/Config.in | 1 +
.../0001-Makefile-cleanup-install.patch | 55 +++++++++++++++++++
package/jitterentropy-library/Config.in | 6 ++
.../jitterentropy-library.hash | 5 ++
.../jitterentropy-library.mk | 25 +++++++++
6 files changed, 93 insertions(+)
create mode 100644 package/jitterentropy-library/0001-Makefile-cleanup-install.patch
create mode 100644 package/jitterentropy-library/Config.in
create mode 100644 package/jitterentropy-library/jitterentropy-library.hash
create mode 100644 package/jitterentropy-library/jitterentropy-library.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 906ccae006..9a64fccb60 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1541,6 +1541,7 @@ F: package/iperf/
F: package/iperf3/
F: package/iputils/
F: package/iw/
+F: package/jitterentropy-library/
F: package/kvm-unit-tests/
F: package/kvmtool/
F: package/libcsv/
diff --git a/package/Config.in b/package/Config.in
index c8ff524e83..c7bb726812 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1400,6 +1400,7 @@ menu "Hardware handling"
source "package/gnu-efi/Config.in"
source "package/hackrf/Config.in"
source "package/hidapi/Config.in"
+ source "package/jitterentropy-library/Config.in"
source "package/lcdapi/Config.in"
source "package/let-me-create/Config.in"
source "package/libaio/Config.in"
diff --git a/package/jitterentropy-library/0001-Makefile-cleanup-install.patch b/package/jitterentropy-library/0001-Makefile-cleanup-install.patch
new file mode 100644
index 0000000000..7d209008c9
--- /dev/null
+++ b/package/jitterentropy-library/0001-Makefile-cleanup-install.patch
@@ -0,0 +1,55 @@
+From 83b1d46ae48eed576cf3dff0ffd7e772c8e638e4 Mon Sep 17 00:00:00 2001
+From: Matt Weber <matthew.weber@rockwellcollins.com>
+Date: Mon, 9 Sep 2019 20:42:14 -0500
+Subject: [PATCH] Makefile: cleanup install
+
+Support the ability to rebuild and redeploy without a clean. This
+required some force linking and forced man archive creation.
+
+Provide the ability to override the stripping of the shared lib for
+cases where a embedded target build may want to control stripping
+or provide cross arch tools.
+
+Upstream: https://github.com/smuellerDD/jitterentropy-library/pull/10
+
+Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
+---
+ Makefile | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5e31276..a575f32 100644
+--- a/Makefile
++++ b/Makefile
+@@ -14,6 +14,8 @@ LIBDIR := lib
+ # include target directory
+ INCDIR := include
+
++INSTALL_STRIP ?= install -s
++
+ NAME := jitterentropy
+ LIBMAJOR=$(shell cat jitterentropy-base.c | grep define | grep MAJVERSION | awk '{print $$3}')
+ LIBMINOR=$(shell cat jitterentropy-base.c | grep define | grep MINVERSION | awk '{print $$3}')
+@@ -49,14 +51,15 @@ scan: $(OBJS)
+ install:
+ install -d -m 0755 $(DESTDIR)$(PREFIX)/share/man/man3
+ install -m 644 doc/$(NAME).3 $(DESTDIR)$(PREFIX)/share/man/man3/
+- gzip -9 $(DESTDIR)$(PREFIX)/share/man/man3/$(NAME).3
++ gzip -f -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_STRIP) -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)
+- ln -s lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so.$(LIBMAJOR)
+- ln -s lib$(NAME).so.$(LIBMAJOR) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so
++ ln -sf lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so.$(LIBMAJOR)
++ ln -sf lib$(NAME).so.$(LIBMAJOR) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so
+
+ clean:
+ @- $(RM) $(NAME)
+--
+2.17.1
+
diff --git a/package/jitterentropy-library/Config.in b/package/jitterentropy-library/Config.in
new file mode 100644
index 0000000000..02f8ff6164
--- /dev/null
+++ b/package/jitterentropy-library/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_JITTERENTROPY_LIBRARY
+ bool "libjitterentropy"
+ help
+ Hardware RNG based on CPU timing jitter.
+
+ https://github.com/smuellerDD/jitterentropy-library
diff --git a/package/jitterentropy-library/jitterentropy-library.hash b/package/jitterentropy-library/jitterentropy-library.hash
new file mode 100644
index 0000000000..5846f2147d
--- /dev/null
+++ b/package/jitterentropy-library/jitterentropy-library.hash
@@ -0,0 +1,5 @@
+# Locally computed
+sha256 38519115c6b750b7fa15547826123a7821b271535c168823259e609b42847223 jitterentropy-library-2.1.2.tar.gz
+sha256 c3352794eff829a3c8097b77e4cbc9f1faf5c3f47a8abed960a0f411cbc6ab9f COPYING
+sha256 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.bsd
+sha256 e6d6a009505e345fe949e1310334fcb0747f28dae2856759de102ab66b722cb4 COPYING.gplv2
diff --git a/package/jitterentropy-library/jitterentropy-library.mk b/package/jitterentropy-library/jitterentropy-library.mk
new file mode 100644
index 0000000000..c7e78fe99f
--- /dev/null
+++ b/package/jitterentropy-library/jitterentropy-library.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# jitterentropy-library
+#
+################################################################################
+
+JITTERENTROPY_LIBRARY_VERSION = 2.1.2
+JITTERENTROPY_LIBRARY_SITE = $(call github,smuellerDD,$(JITTERENTROPY_LIBRARY_NAME),v$(JITTERENTROPY_LIBRARY_VERSION))
+JITTERENTROPY_LIBRARY_LICENSE = GPL-2.0, BSD-3-Clause
+JITTERENTROPY_LIBRARY_LICENSE_FILES = COPYING COPYING.bsd COPYING.gplv2
+JITTERENTROPY_LIBRARY_INSTALL_STAGING = YES
+
+define JITTERENTROPY_LIBRARY_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
+endef
+
+define JITTERENTROPY_LIBRARY_INSTALL_STAGING_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) INSTALL_STRIP="install" PREFIX=/usr install
+endef
+
+define JITTERENTROPY_LIBRARY_INSTALL_TARGET_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) INSTALL_STRIP="install" PREFIX=/usr install
+endef
+
+$(eval $(generic-package))
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v5 2/2] package/rng-tools: bump to 6.7
2019-10-22 18:17 [Buildroot] [PATCH v5 1/2] package/jitterentropy-library: new package Matt Weber
@ 2019-10-22 18:17 ` Matt Weber
2019-10-22 18:39 ` Thomas Petazzoni
2019-10-22 18:39 ` [Buildroot] [PATCH v5 1/2] package/jitterentropy-library: new package Thomas Petazzoni
1 sibling, 1 reply; 4+ messages in thread
From: Matt Weber @ 2019-10-22 18:17 UTC (permalink / raw)
To: buildroot
* Switch to new site and add license file hash
* Add new libsysfs dependency for rng available check
* Remove patch adding special return code when no RNG module is available.
This has been replaced by using the jitter library to always have a
source (new jitterentropy dependency)
* Change to a autotools build and add patch to allow README file to not be
found during autoreconfig
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Tested-by: Romain Naour <romain.naour@smile.fr>
---
Changes
v5
[Matt
- Added missing host-pkgconf dependency found on a fresh build.
Fixes: "possibly undefined macro: AC_MSG_ERROR"
[Thomas
- Fixed alphabetical ordering in Config.in of select
- Removed redundant automake and autconf host dependencies
v4
- None
v2 -> v3
[Thomas P
- Add patch to set AM_INIT_AUTOMAKE to foreign to prevent missing
README file from breaking the reconfigure. Thanks Fabrice for
already starting the upstream up this.
v1 -> v2
[Thomas P
- Added host automake/autotools dependencies and checked for no
libtool dependency.
[Baruch
- Removed cut paste error in comment for autoreconf
---
.../0001-configure.ac-fix-autoreconf.patch | 34 +++++++++++++++++++
package/rng-tools/0001-rngd-exit-code.patch | 22 ------------
package/rng-tools/Config.in | 2 ++
package/rng-tools/rng-tools.hash | 6 ++--
package/rng-tools/rng-tools.mk | 11 ++++--
package/rng-tools/rngd.service | 1 -
6 files changed, 48 insertions(+), 28 deletions(-)
create mode 100644 package/rng-tools/0001-configure.ac-fix-autoreconf.patch
delete mode 100644 package/rng-tools/0001-rngd-exit-code.patch
diff --git a/package/rng-tools/0001-configure.ac-fix-autoreconf.patch b/package/rng-tools/0001-configure.ac-fix-autoreconf.patch
new file mode 100644
index 0000000000..567a7a2891
--- /dev/null
+++ b/package/rng-tools/0001-configure.ac-fix-autoreconf.patch
@@ -0,0 +1,34 @@
+From 1af1b4aab717a58da1dff8888c36c741b0f6ac03 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 5 Apr 2019 19:22:22 +0200
+Subject: [PATCH] configure.ac: fix autoreconf
+
+Use foreign instead of gnu in AM_INIT_AUTOMAKE otherwise autoreconf will
+fail on:
+Makefile.am: error: required file './README' not found
+
+Upstream:
+https://github.com/nhorman/rng-tools/commit/1af1b4aab717a58da1dff8888c36c741b0f6ac03
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Signed-off-by: Matt Weber <matthew.weber@rockwellcollins.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index d00a6f1..26b4806 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -21,7 +21,7 @@ AC_INIT(rng-tools, 6.7, [Neil Horman <nhorman@tuxdriver.com>])
+ AC_PREREQ(2.52)
+ AC_CONFIG_SRCDIR([rngd.c])
+ AC_CANONICAL_TARGET
+-AM_INIT_AUTOMAKE([gnu])
++AM_INIT_AUTOMAKE([foreign])
+ AC_CONFIG_HEADERS([rng-tools-config.h])
+ AC_CONFIG_MACRO_DIRS([m4])
+
+--
+2.17.1
+
diff --git a/package/rng-tools/0001-rngd-exit-code.patch b/package/rng-tools/0001-rngd-exit-code.patch
deleted file mode 100644
index 709e20c70d..0000000000
--- a/package/rng-tools/0001-rngd-exit-code.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Exit with a special value when RNG modules are not available
-
-Instead of returning with an error, exit with a special value when the
-RNG kernel modules are not present in the kernel. This is not really a
-hard failure.
-
-Patch borrowed from Fedora, at
-http://pkgs.fedoraproject.org/cgit/rng-tools.git/tree/rngd-exit-code.patch.
-
-Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
-
---- a/rngd.c
-+++ b/rngd.c
-@@ -319,7 +319,7 @@ int main(int argc, char **argv)
- message(LOG_DAEMON|LOG_ERR,
- "Maybe RNG device modules are not loaded\n");
- }
-- return 1;
-+ return 66;
- }
-
- if (arguments->verbose) {
diff --git a/package/rng-tools/Config.in b/package/rng-tools/Config.in
index b00477d336..bbcf4db843 100644
--- a/package/rng-tools/Config.in
+++ b/package/rng-tools/Config.in
@@ -2,8 +2,10 @@ config BR2_PACKAGE_RNG_TOOLS
bool "rng-tools"
depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS || !(BR2_i386 || BR2_x86_64) # libgcrypt
select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL
+ select BR2_PACKAGE_JITTERENTROPY_LIBRARY
# For rdrand ligcrypt is required and it's not obvious to users
select BR2_PACKAGE_LIBGCRYPT if BR2_i386 || BR2_x86_64
+ select BR2_PACKAGE_LIBSYSFS
help
Daemon to use hardware random number generators.
diff --git a/package/rng-tools/rng-tools.hash b/package/rng-tools/rng-tools.hash
index 09769e4622..a0771034fe 100644
--- a/package/rng-tools/rng-tools.hash
+++ b/package/rng-tools/rng-tools.hash
@@ -1,3 +1,3 @@
-# From http://sourceforge.net/projects/gkernel/files/rng-tools/5/
-md5 6726cdc6fae1f5122463f24ae980dd68 rng-tools-5.tar.gz
-sha1 3092768ac45315a5dcc0170d05566d1d00dbad96 rng-tools-5.tar.gz
+# Locally computed
+sha256 b85e3530dbf943b6da03ebecaf64d0a4febfcc4f562fc7f8d886483906b15f08 rng-tools-6.7.tar.gz
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
diff --git a/package/rng-tools/rng-tools.mk b/package/rng-tools/rng-tools.mk
index bbb1a64c15..fa23b3316f 100644
--- a/package/rng-tools/rng-tools.mk
+++ b/package/rng-tools/rng-tools.mk
@@ -4,10 +4,17 @@
#
################################################################################
-RNG_TOOLS_VERSION = 5
-RNG_TOOLS_SITE = http://downloads.sourceforge.net/project/gkernel/rng-tools/$(RNG_TOOLS_VERSION)
+RNG_TOOLS_VERSION = 6.7
+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_AUTORECONF = YES
+
+RNG_TOOLS_CONF_OPTS = \
+ --without-nistbeacon \
+ --without-pkcs11
# Work around for uClibc or musl toolchains which lack argp_*()
# functions.
diff --git a/package/rng-tools/rngd.service b/package/rng-tools/rngd.service
index c0bcffe59e..11386d1e5d 100644
--- a/package/rng-tools/rngd.service
+++ b/package/rng-tools/rngd.service
@@ -3,7 +3,6 @@ Description=Hardware RNG Entropy Gatherer Daemon
[Service]
ExecStart=/usr/sbin/rngd -f $DAEMON_ARGS
-SuccessExitStatus=66
EnvironmentFile=-/etc/default/rngd
[Install]
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v5 1/2] package/jitterentropy-library: new package
2019-10-22 18:17 [Buildroot] [PATCH v5 1/2] package/jitterentropy-library: new package Matt Weber
2019-10-22 18:17 ` [Buildroot] [PATCH v5 2/2] package/rng-tools: bump to 6.7 Matt Weber
@ 2019-10-22 18:39 ` Thomas Petazzoni
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2019-10-22 18:39 UTC (permalink / raw)
To: buildroot
On Tue, 22 Oct 2019 13:17:31 -0500
Matt Weber <matthew.weber@rockwellcollins.com> wrote:
> +JITTERENTROPY_LIBRARY_VERSION = 2.1.2
> +JITTERENTROPY_LIBRARY_SITE = $(call github,smuellerDD,$(JITTERENTROPY_LIBRARY_NAME),v$(JITTERENTROPY_LIBRARY_VERSION))
> +JITTERENTROPY_LIBRARY_LICENSE = GPL-2.0, BSD-3-Clause
It is actually GPL-2.0 or BSD-3-Clause, so I fixed that up and applied. Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v5 2/2] package/rng-tools: bump to 6.7
2019-10-22 18:17 ` [Buildroot] [PATCH v5 2/2] package/rng-tools: bump to 6.7 Matt Weber
@ 2019-10-22 18:39 ` Thomas Petazzoni
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2019-10-22 18:39 UTC (permalink / raw)
To: buildroot
On Tue, 22 Oct 2019 13:17:32 -0500
Matt Weber <matthew.weber@rockwellcollins.com> wrote:
> * Switch to new site and add license file hash
> * Add new libsysfs dependency for rng available check
> * Remove patch adding special return code when no RNG module is available.
> This has been replaced by using the jitter library to always have a
> source (new jitterentropy dependency)
> * Change to a autotools build and add patch to allow README file to not be
> found during autoreconfig
>
> Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
> Tested-by: Romain Naour <romain.naour@smile.fr>
>
> ---
> Changes
> v5
> [Matt
> - Added missing host-pkgconf dependency found on a fresh build.
> Fixes: "possibly undefined macro: AC_MSG_ERROR"
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-10-22 18:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-22 18:17 [Buildroot] [PATCH v5 1/2] package/jitterentropy-library: new package Matt Weber
2019-10-22 18:17 ` [Buildroot] [PATCH v5 2/2] package/rng-tools: bump to 6.7 Matt Weber
2019-10-22 18:39 ` Thomas Petazzoni
2019-10-22 18:39 ` [Buildroot] [PATCH v5 1/2] package/jitterentropy-library: new package Thomas Petazzoni
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.