All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/1] ima-evm-utils: Add as new package, version 1.2.1
@ 2019-10-29  0:34 Petr Vorel
  2019-10-29 11:02 ` [Buildroot] [External] " Matthew Weber
  2019-10-29 23:02 ` [Buildroot] " Arnout Vandecappelle
  0 siblings, 2 replies; 3+ messages in thread
From: Petr Vorel @ 2019-10-29  0:34 UTC (permalink / raw)
  To: buildroot

+ add myself as a maintainer.

Adding build and install hooks to run make in src subdirectory
(root directory asciidoc and xsltproc for manpage).

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
Changes v2->v3 (Yann):
* Use autoreconf (IMA_EVM_UTILS_AUTORECONF) instead calling ./autogen.sh

BTW I wonder if this upstream shell script build-static.sh is working:

gcc -static -o evmctl.static -include config.h src/evmctl.c src/libimaevm.c -lcrypto -lkeyutils -ldl

Because keyutils requires dynamic linking:
/home/br-test-pkg/br-arm-full-static/host/bin/arm-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I. -DPKGBUILD="\"2019-10-29\"" -DPKGVERSION="\"keyutils-1.6\"" -DAPIVERSION="\"libkeyutils-1.8\"" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -static -UNO_GLIBC_KEYERR -o keyutils.o -c keyutils.c
keyutils.c:18:10: fatal error: dlfcn.h: No such file or directory
 #include <dlfcn.h>

Kind regards,
Petr

 DEVELOPERS                               |  1 +
 package/Config.in                        |  1 +
 package/ima-evm-utils/Config.in          | 15 ++++++++++++
 package/ima-evm-utils/ima-evm-utils.hash |  3 +++
 package/ima-evm-utils/ima-evm-utils.mk   | 29 ++++++++++++++++++++++++
 5 files changed, 49 insertions(+)
 create mode 100644 package/ima-evm-utils/Config.in
 create mode 100644 package/ima-evm-utils/ima-evm-utils.hash
 create mode 100644 package/ima-evm-utils/ima-evm-utils.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index f41ac5f096..caf3ea26d4 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1891,6 +1891,7 @@ N:	Petr Kulhavy <brain@jikos.cz>
 F:	package/linuxptp/
 
 N:	Petr Vorel <petr.vorel@gmail.com>
+F:	package/ima-evm-utils/
 F:	package/iproute2/
 F:	package/iputils/
 F:	package/linux-backports/
diff --git a/package/Config.in b/package/Config.in
index a1ac5069aa..a5147ee7fa 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2169,6 +2169,7 @@ endmenu
 
 menu "Security"
 	source "package/checkpolicy/Config.in"
+	source "package/ima-evm-utils/Config.in"
 	source "package/optee-benchmark/Config.in"
 	source "package/optee-client/Config.in"
 	source "package/optee-examples/Config.in"
diff --git a/package/ima-evm-utils/Config.in b/package/ima-evm-utils/Config.in
new file mode 100644
index 0000000000..10dea5243b
--- /dev/null
+++ b/package/ima-evm-utils/Config.in
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_IMA_EVM_UTILS
+	bool "ima-evm-utils"
+	depends on BR2_USE_MMU # keyutils dependency: fork()
+	depends on !BR2_STATIC_LIBS # keyutils dependency: dlopen
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_KEYUTILS
+	help
+	  Linux Integrity Measurement Architecture (IMA)
+	  Extended Verification Module (EVM) tools.
+
+	  https://sourceforge.net/p/linux-ima/wiki/Home/
+
+comment "ima-evm-utils needs dynamic library support"
+	depends on BR2_USE_MMU
+	depends on BR2_STATIC_LIBS
diff --git a/package/ima-evm-utils/ima-evm-utils.hash b/package/ima-evm-utils/ima-evm-utils.hash
new file mode 100644
index 0000000000..24be627d20
--- /dev/null
+++ b/package/ima-evm-utils/ima-evm-utils.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 ad8471b58c4df29abd51c80d74b1501cfe3289b60d32d1b318618a8fd26c0c0a  ima-evm-utils-1.2.1.tar.gz
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
diff --git a/package/ima-evm-utils/ima-evm-utils.mk b/package/ima-evm-utils/ima-evm-utils.mk
new file mode 100644
index 0000000000..a0d3703929
--- /dev/null
+++ b/package/ima-evm-utils/ima-evm-utils.mk
@@ -0,0 +1,29 @@
+################################################################################
+#
+# ima-evm-utils
+#
+################################################################################
+
+IMA_EVM_UTILS_VERSION = 1.2.1
+IMA_EVM_UTILS_SITE = http://downloads.sourceforge.net/project/linux-ima/ima-evm-utils
+IMA_EVM_UTILS_LICENSE = GPL-2.0
+IMA_EVM_UTILS_LICENSE_FILES = COPYING
+IMA_EVM_UTILS_DEPENDENCIES = host-pkgconf keyutils openssl
+
+IMA_EVM_UTILS_AUTORECONF = YES
+
+# build just sources in src subdirectory as root directory requires asciidoc
+# and xsltproc for manpage
+define IMA_EVM_UTILS_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(IMA_EVM_UTILS_MAKE_ENV) $(MAKE) -C $(@D)/src all
+endef
+define IMA_EVM_UTILS_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(IMA_EVM_UTILS_MAKE_ENV) $(MAKE) \
+		DESTDIR="$(STAGING_DIR)" -C $(@D)/src install
+endef
+define IMA_EVM_UTILS_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(IMA_EVM_UTILS_MAKE_ENV) $(MAKE) \
+		DESTDIR="$(TARGET_DIR)" -C $(@D)/src install
+endef
+
+$(eval $(autotools-package))
-- 
2.23.0

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

* [Buildroot] [External] [PATCH v3 1/1] ima-evm-utils: Add as new package, version 1.2.1
  2019-10-29  0:34 [Buildroot] [PATCH v3 1/1] ima-evm-utils: Add as new package, version 1.2.1 Petr Vorel
@ 2019-10-29 11:02 ` Matthew Weber
  2019-10-29 23:02 ` [Buildroot] " Arnout Vandecappelle
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Weber @ 2019-10-29 11:02 UTC (permalink / raw)
  To: buildroot

Petr,

On Mon, Oct 28, 2019 at 7:35 PM Petr Vorel <petr.vorel@gmail.com> wrote:
>
> + add myself as a maintainer.
>
> Adding build and install hooks to run make in src subdirectory
> (root directory asciidoc and xsltproc for manpage).
>
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>

$ ./utils/test-pkg -p ima-evm-utils -k -d dl -d ima_testbuild
                             br-arm-full [1/6]: OK
                  br-arm-cortex-a9-glibc [2/6]: OK
                   br-arm-cortex-m4-full [3/6]: SKIPPED
                          br-x86-64-musl [4/6]: OK
                      br-arm-full-static [5/6]: SKIPPED
                            sourcery-arm [6/6]: OK
6 builds, 2 skipped, 0 build failed, 0 legal-info failed

Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>

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

* [Buildroot] [PATCH v3 1/1] ima-evm-utils: Add as new package, version 1.2.1
  2019-10-29  0:34 [Buildroot] [PATCH v3 1/1] ima-evm-utils: Add as new package, version 1.2.1 Petr Vorel
  2019-10-29 11:02 ` [Buildroot] [External] " Matthew Weber
@ 2019-10-29 23:02 ` Arnout Vandecappelle
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2019-10-29 23:02 UTC (permalink / raw)
  To: buildroot



On 29/10/2019 01:34, Petr Vorel wrote:
> + add myself as a maintainer.
> 
> Adding build and install hooks to run make in src subdirectory
> (root directory asciidoc and xsltproc for manpage).
> 
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>

 Applied to master with slight changes (see below), thanks.

 Regards,
 Arnout

> ---
> Changes v2->v3 (Yann):
> * Use autoreconf (IMA_EVM_UTILS_AUTORECONF) instead calling ./autogen.sh
> 
> BTW I wonder if this upstream shell script build-static.sh is working:
> 
> gcc -static -o evmctl.static -include config.h src/evmctl.c src/libimaevm.c -lcrypto -lkeyutils -ldl
> 
> Because keyutils requires dynamic linking:

 -static doesn't mean to *only* link statically. It means to prefer static
libraries. That's why it's still possible to link with -ldl as well.

 However, BR2_STATIC_LIBS means that no shared libraries will be allowed on the
target. You could say that we should have an option BR2_PREFER_STATIC that links
with -static but doesn't remove the .so files. But that just wastes space on the
target, because *most* so files will not be used, and it's hard to find out
which ones *are* used (because they could be dlopen'ed).


> /home/br-test-pkg/br-arm-full-static/host/bin/arm-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I. -DPKGBUILD="\"2019-10-29\"" -DPKGVERSION="\"keyutils-1.6\"" -DAPIVERSION="\"libkeyutils-1.8\"" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -static -UNO_GLIBC_KEYERR -o keyutils.o -c keyutils.c
> keyutils.c:18:10: fatal error: dlfcn.h: No such file or directory

 Note that this fails because the uclibc was configured for static only, so it
didn't install the dlfcn.h header or libdl.so.

>  #include <dlfcn.h>
> 
> Kind regards,
> Petr

[snip]
> +# build just sources in src subdirectory as root directory requires asciidoc
> +# and xsltproc for manpage

 I reworded this a bit.

> +define IMA_EVM_UTILS_BUILD_CMDS
> +	$(TARGET_MAKE_ENV) $(IMA_EVM_UTILS_MAKE_ENV) $(MAKE) -C $(@D)/src all

 IME_EVM_UTILS_MAKE_ENV is empty, so it's no use here. I removed that.


> +endef

 I added an empty line here for improved readability.

 Regards,
 Arnout

> +define IMA_EVM_UTILS_INSTALL_STAGING_CMDS
> +	$(TARGET_MAKE_ENV) $(IMA_EVM_UTILS_MAKE_ENV) $(MAKE) \
> +		DESTDIR="$(STAGING_DIR)" -C $(@D)/src install
> +endef
> +define IMA_EVM_UTILS_INSTALL_TARGET_CMDS
> +	$(TARGET_MAKE_ENV) $(IMA_EVM_UTILS_MAKE_ENV) $(MAKE) \
> +		DESTDIR="$(TARGET_DIR)" -C $(@D)/src install
> +endef
> +
> +$(eval $(autotools-package))
> 

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

end of thread, other threads:[~2019-10-29 23:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-29  0:34 [Buildroot] [PATCH v3 1/1] ima-evm-utils: Add as new package, version 1.2.1 Petr Vorel
2019-10-29 11:02 ` [Buildroot] [External] " Matthew Weber
2019-10-29 23:02 ` [Buildroot] " Arnout Vandecappelle

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.