From patchwork Mon Oct 21 21:38:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 1180887 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.133; helo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xqlB5Ndsz9sP3 for ; Tue, 22 Oct 2019 08:38:46 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A791B87EC5; Mon, 21 Oct 2019 21:38:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qGtVZHoc+z32; Mon, 21 Oct 2019 21:38:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id B4B0C87ED1; Mon, 21 Oct 2019 21:38:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 15BE31BF32C for ; Mon, 21 Oct 2019 21:38:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 10AF287ED1 for ; Mon, 21 Oct 2019 21:38:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id saaIu+35Qozy for ; Mon, 21 Oct 2019 21:38:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from da1vs02.rockwellcollins.com (da1vs02.rockwellcollins.com [205.175.227.29]) by hemlock.osuosl.org (Postfix) with ESMTPS id C51C887EBB for ; Mon, 21 Oct 2019 21:38:40 +0000 (UTC) IronPort-SDR: 986QYPZ726qnN38JMvFUkt1p8SGvNC6metHtXcKiEcbnXFhTMKo8a3JqC8TpAlzJIapBEzSe0O GwTL4KW8k9Q1zzwBox9daCt5iVYHNsWZL2m2lamYqmidP/j9XEfQXO77T0764rOkVC0Y++7XFx HTsoCIpGsvr67NZEFN7EBCk3HIG+bUb5CmpVMAwIZook/LmI/FfuGcByW33HY1boWKUSZ/KKMP JHOo2SBDm4+WpN90ymi4JZjVSHySnnmYKMI5fFhmozFu7+Lk2R08Do/C9bLqRYkdzSoDjqDeb4 L9M= Received: from ofwda1n02.rockwellcollins.com (HELO crulimr01.rockwellcollins.com) ([205.175.227.14]) by da1vs02.rockwellcollins.com with ESMTP; 21 Oct 2019 16:38:40 -0500 X-Received: from biscuits.rockwellcollins.lab (biscuits.rockwellcollins.lab [10.148.119.137]) by crulimr01.rockwellcollins.com (Postfix) with ESMTP id C2FB360335; Mon, 21 Oct 2019 16:38:39 -0500 (CDT) From: Matt Weber To: buildroot@buildroot.org Date: Mon, 21 Oct 2019 16:38:38 -0500 Message-Id: <20191021213839.46139-1-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH v4 1/2] package/jitterentropy-library: new package 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "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 --- Changes 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 --- DEVELOPERS | 1 + package/Config.in | 1 + .../0001-Makefile-cleanup-install.patch | 43 +++++++++++++++++++ package/jitterentropy-library/Config.in | 6 +++ .../jitterentropy-library.hash | 5 +++ .../jitterentropy-library.mk | 27 ++++++++++++ 6 files changed, 83 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..5234b072b1 --- /dev/null +++ b/package/jitterentropy-library/0001-Makefile-cleanup-install.patch @@ -0,0 +1,43 @@ +From f94975948ff259f86b14d36d3f3ede2e41e41ff4 Mon Sep 17 00:00:00 2001 +From: Matt Weber +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 +- create include folder before copying headers + +Signed-off-by: Matthew Weber +--- + Makefile | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/Makefile b/Makefile +index 5e31276..575ee2d 100644 +--- a/Makefile ++++ b/Makefile +@@ -47,16 +47,13 @@ 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 -d -m 0755 $(DESTDIR)$(PREFIX)/$(INCDIR) ++ 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..62aea1b516 --- /dev/null +++ b/package/jitterentropy-library/jitterentropy-library.mk @@ -0,0 +1,27 @@ +################################################################################ +# +# 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 + # CFLAGS is being forced to not optimize for the case where Clang doesn't + # respect "#pragma GCC optimize" in jitterentropy-base.c + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="-O0" +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))