All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/jitterentropy-library: new package
@ 2019-09-10  2:37 Matt Weber
  2019-09-10  2:37 ` [Buildroot] [PATCH 2/2] package/rng-tools: bump to 6.7 Matt Weber
  0 siblings, 1 reply; 7+ messages in thread
From: Matt Weber @ 2019-09-10  2:37 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>
---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 .../0001-Makefile-cleanup-install.patch       | 41 +++++++++++++++++++
 package/jitterentropy-library/Config.in       |  6 +++
 .../jitterentropy-library.hash                |  5 +++
 .../jitterentropy-library.mk                  | 25 +++++++++++
 6 files changed, 79 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 58d18a36e8..9d5e568e9b 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1523,6 +1523,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 9336261c5d..4a4d388d52 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1378,6 +1378,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..4311d1b201
--- /dev/null
+++ b/package/jitterentropy-library/0001-Makefile-cleanup-install.patch
@@ -0,0 +1,41 @@
+From 21477af2c36df184cb41ba8d34e4f320bb385912 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
+
+- drop install of man pages
+- don't strip library install
+- force symlink creation
+
+Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
+---
+ Makefile | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5e31276..a8848cc 100644
+--- a/Makefile
++++ b/Makefile
+@@ -47,16 +47,12 @@ scan:	$(OBJS)
+ 	scan-build --use-analyzer=/usr/bin/clang $(CC) -shared -Wl,-soname,lib$(NAME).so.$(LIBMAJOR) -o lib$(NAME).so.$(LIBVERSION) $(OBJS) $(LDFLAGS)
+ 
+ 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
+ 	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 -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..e047d506ad
--- /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) PREFIX=/usr install
+endef
+
+define JITTERENTROPY_LIBRARY_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) PREFIX=/usr install
+endef
+
+$(eval $(generic-package))
-- 
2.17.1

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

* [Buildroot] [PATCH 2/2] package/rng-tools: bump to 6.7
  2019-09-10  2:37 [Buildroot] [PATCH 1/2] package/jitterentropy-library: new package Matt Weber
@ 2019-09-10  2:37 ` Matt Weber
  2019-09-10  4:26   ` Baruch Siach
  2019-09-10  7:57   ` Thomas Petazzoni
  0 siblings, 2 replies; 7+ messages in thread
From: Matt Weber @ 2019-09-10  2:37 UTC (permalink / raw
  To: buildroot

- Add new libsysfs dependency for rng available check
- Remove patch adding special return code when no RNG module is available
- Remove exit code corner case in systemd script
- Add new jitterentropy dependency which always provides a entropy source

Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
 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              | 17 +++++++++++++---
 package/rng-tools/rngd.service              |  1 -
 5 files changed, 19 insertions(+), 29 deletions(-)
 delete mode 100644 package/rng-tools/0001-rngd-exit-code.patch

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..18521bdd90 100644
--- a/package/rng-tools/Config.in
+++ b/package/rng-tools/Config.in
@@ -4,6 +4,8 @@ config BR2_PACKAGE_RNG_TOOLS
 	select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL
 	# 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
+	select BR2_PACKAGE_JITTERENTROPY_LIBRARY
 	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..058abf8b36 100644
--- a/package/rng-tools/rng-tools.mk
+++ b/package/rng-tools/rng-tools.mk
@@ -4,10 +4,22 @@
 #
 ################################################################################
 
-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
+
+# configure is missing but pkg seems to not be compatible with our autoreconf
+# mechanism so we have to do it manually instead of using GPM_AUTORECONF = YES
+define RNG_TOOLS_RUN_AUTOGEN
+	cd $(@D) && PATH=$(BR_PATH) ./autogen.sh
+endef
+RNG_TOOLS_PRE_CONFIGURE_HOOKS += RNG_TOOLS_RUN_AUTOGEN
+
+RNG_TOOLS_CONF_OPTS = \
+	--without-nistbeacon \
+	--without-pkcs11
 
 # Work around for uClibc or musl toolchains which lack argp_*()
 # functions.
@@ -34,5 +46,4 @@ define RNG_TOOLS_INSTALL_INIT_SYSTEMD
 	ln -fs ../../../../usr/lib/systemd/system/rngd.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/rngd.service
 endef
-
 $(eval $(autotools-package))
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] 7+ messages in thread

* [Buildroot] [PATCH 2/2] package/rng-tools: bump to 6.7
  2019-09-10  2:37 ` [Buildroot] [PATCH 2/2] package/rng-tools: bump to 6.7 Matt Weber
@ 2019-09-10  4:26   ` Baruch Siach
  2019-09-10  7:57   ` Thomas Petazzoni
  1 sibling, 0 replies; 7+ messages in thread
From: Baruch Siach @ 2019-09-10  4:26 UTC (permalink / raw
  To: buildroot

Hi Matt,

On Mon, Sep 09, 2019 at 09:37:53PM -0500, Matt Weber wrote:
> -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
> +
> +# configure is missing but pkg seems to not be compatible with our autoreconf
> +# mechanism so we have to do it manually instead of using GPM_AUTORECONF = YES

GPM? Just say "autoreconf".

baruch

> +define RNG_TOOLS_RUN_AUTOGEN
> +	cd $(@D) && PATH=$(BR_PATH) ./autogen.sh
> +endef
> +RNG_TOOLS_PRE_CONFIGURE_HOOKS += RNG_TOOLS_RUN_AUTOGEN

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH 2/2] package/rng-tools: bump to 6.7
  2019-09-10  2:37 ` [Buildroot] [PATCH 2/2] package/rng-tools: bump to 6.7 Matt Weber
  2019-09-10  4:26   ` Baruch Siach
@ 2019-09-10  7:57   ` Thomas Petazzoni
  2019-09-10 13:05     ` Matthew Weber
  2019-09-10 17:55     ` Matthew Weber
  1 sibling, 2 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2019-09-10  7:57 UTC (permalink / raw
  To: buildroot

On Mon,  9 Sep 2019 21:37:53 -0500
Matt Weber <matthew.weber@rockwellcollins.com> wrote:

> +# configure is missing but pkg seems to not be compatible with our autoreconf
> +# mechanism so we have to do it manually instead of using GPM_AUTORECONF = YES

Then you need host-automake and host-autoconf in the dependencies, and
potentially host-libtool (if libtool is used).

But how does it fail exactly ? Perhaps it can be fixed instead ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 2/2] package/rng-tools: bump to 6.7
  2019-09-10  7:57   ` Thomas Petazzoni
@ 2019-09-10 13:05     ` Matthew Weber
  2019-09-10 17:55     ` Matthew Weber
  1 sibling, 0 replies; 7+ messages in thread
From: Matthew Weber @ 2019-09-10 13:05 UTC (permalink / raw
  To: buildroot

Thomas,

On Tue, Sep 10, 2019 at 2:57 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> On Mon,  9 Sep 2019 21:37:53 -0500
> Matt Weber <matthew.weber@rockwellcollins.com> wrote:
>
> > +# configure is missing but pkg seems to not be compatible with our autoreconf
> > +# mechanism so we have to do it manually instead of using GPM_AUTORECONF = YES
>
> Then you need host-automake and host-autoconf in the dependencies, and
> potentially host-libtool (if libtool is used).
>
> But how does it fail exactly ? Perhaps it can be fixed instead ?

None of the files are generated and checked in for use. (Maybe I'm
missing something?  I assume we have to autogen at that point if they
just provide the configure.ac)

Matt

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

* [Buildroot] [PATCH 2/2] package/rng-tools: bump to 6.7
  2019-09-10  7:57   ` Thomas Petazzoni
  2019-09-10 13:05     ` Matthew Weber
@ 2019-09-10 17:55     ` Matthew Weber
  2019-09-11  7:44       ` Thomas Petazzoni
  1 sibling, 1 reply; 7+ messages in thread
From: Matthew Weber @ 2019-09-10 17:55 UTC (permalink / raw
  To: buildroot

Thomas,


On Tue, Sep 10, 2019 at 2:57 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> On Mon,  9 Sep 2019 21:37:53 -0500
> Matt Weber <matthew.weber@rockwellcollins.com> wrote:
>
> > +# configure is missing but pkg seems to not be compatible with our autoreconf
> > +# mechanism so we have to do it manually instead of using GPM_AUTORECONF = YES
>
> Then you need host-automake and host-autoconf in the dependencies, and
> potentially host-libtool (if libtool is used).
>
> But how does it fail exactly ? Perhaps it can be fixed instead ?
>

>>> rng-tools 6.7 Configuring
>>> rng-tools 6.7 Autoreconfiguring
configure.ac:52: installing './compile'
configure.ac:23: installing './config.guess'
configure.ac:23: installing './config.sub'
configure.ac:24: installing './install-sh'
configure.ac:24: installing './missing'
Makefile.am: installing './INSTALL'
Makefile.am: error: required file './README' not found
Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
autoreconf: /home/foobar/tmp.SL6zsYai7c-buildroot/output/host/bin/automake
failed with exit status: 1
package/pkg-generic.mk:228: recipe for target
'/accts/mlweber1/tmp.SL6zsYai7c-buildroot/output/build/rng-tools-6.7/.stamp_configured'
failed
make[1]: *** [/home/foobar/tmp.SL6zsYai7c-buildroot/output/build/rng-tools-6.7/.stamp_configured]
Error 1
Makefile:84: recipe for target '_all' failed
make: *** [_all] Error 2

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

* [Buildroot] [PATCH 2/2] package/rng-tools: bump to 6.7
  2019-09-10 17:55     ` Matthew Weber
@ 2019-09-11  7:44       ` Thomas Petazzoni
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2019-09-11  7:44 UTC (permalink / raw
  To: buildroot

On Tue, 10 Sep 2019 12:55:34 -0500
Matthew Weber <matthew.weber@rockwellcollins.com> wrote:

> >>> rng-tools 6.7 Configuring
> >>> rng-tools 6.7 Autoreconfiguring  
> configure.ac:52: installing './compile'
> configure.ac:23: installing './config.guess'
> configure.ac:23: installing './config.sub'
> configure.ac:24: installing './install-sh'
> configure.ac:24: installing './missing'
> Makefile.am: installing './INSTALL'
> Makefile.am: error: required file './README' not found

This will be fixed by adjusting the AM_INIT_AUTOMAKE call in
configure.ac to pass the "foreign" argument. See
https://autotools.io/automake/options.html. This can easily be patched,
and if it's the only issue, will allow to use <pkg>_AUTORECONF = YES.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2019-09-11  7:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-10  2:37 [Buildroot] [PATCH 1/2] package/jitterentropy-library: new package Matt Weber
2019-09-10  2:37 ` [Buildroot] [PATCH 2/2] package/rng-tools: bump to 6.7 Matt Weber
2019-09-10  4:26   ` Baruch Siach
2019-09-10  7:57   ` Thomas Petazzoni
2019-09-10 13:05     ` Matthew Weber
2019-09-10 17:55     ` Matthew Weber
2019-09-11  7:44       ` 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.