From ec19d0a8ece756c3f9c2360247af8db7a83ed6cf Mon Sep 17 00:00:00 2001 From: Trevor Woerner Date: Wed, 30 May 2018 11:20:22 -0400 Subject: tpm2-tools: cleanup and update Cleanup the tpm2-tools recipe such that there is a recipe for building the latest release (the default) and one for building the latest, auto-incrementing version from git master placing all pieces common to the two recipes into an include file. Update release from 3.0.3 to 3.0.4. Signed-off-by: Trevor Woerner --- meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools.inc | 11 ++++ ...tools-use-dynamic-linkage-with-tpm2-abrmd.patch | 63 ---------------------- .../recipes-tpm/tpm2-tools/tpm2-tools_3.0.4.bb | 7 +++ meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_git.bb | 48 +++++------------ 4 files changed, 32 insertions(+), 97 deletions(-) create mode 100644 meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools.inc delete mode 100644 meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools/0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch create mode 100644 meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_3.0.4.bb (limited to 'meta-tpm2') diff --git a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools.inc b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools.inc new file mode 100644 index 0000000..8f74e85 --- /dev/null +++ b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools.inc @@ -0,0 +1,11 @@ +SUMMARY = "Tools for TPM2" +DESCRIPTION = "This project builds a set of command-line tools for \ +interacting with a TPM (Trusted Platform Module) 2." +HOMEPAGE = "https://github.com/tpm2-software/tpm2-tools" +SECTION = "security/tpm" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=91b7c548d73ea16537799e8060cea819" + +DEPENDS = "tpm2-abrmd tpm2-tss openssl curl autoconf-archive-native" + +inherit autotools pkgconfig diff --git a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools/0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools/0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch deleted file mode 100644 index 0333089..0000000 --- a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools/0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 1c29c5206be61edb9ebb165f5e4ae2f5eceb5608 Mon Sep 17 00:00:00 2001 -From: Jia Zhang -Date: Fri, 16 Feb 2018 20:31:58 -0500 -Subject: [PATCH] tpm2-tools: use dynamic linkage with tpm2-abrmd - -tpm2-abrmd has huge dependencies and they are not necessary to be involved -in initramfs. - -Signed-off-by: Jia Zhang ---- - lib/tcti/tpm2_tools_tcti_abrmd.c | 21 +++++++++++++++++++-- - 1 file changed, 19 insertions(+), 2 deletions(-) - -diff --git a/lib/tcti/tpm2_tools_tcti_abrmd.c b/lib/tcti/tpm2_tools_tcti_abrmd.c -index 5e50288..48e0df6 100644 ---- a/lib/tcti/tpm2_tools_tcti_abrmd.c -+++ b/lib/tcti/tpm2_tools_tcti_abrmd.c -@@ -30,6 +30,7 @@ - //**********************************************************************; - #include - #include -+#include - #include - - #include -@@ -42,8 +43,24 @@ TSS2_TCTI_CONTEXT *tpm2_tools_tcti_abrmd_init(char *opts) { - - UNUSED(opts); - -+ /* -+ * Intend to "forget" the handle in order to make sure libtcti-tabrmd -+ * is unloaded along with the deconstructed functions. -+ */ -+ void *tabrmd_handle; -+ tabrmd_handle = dlopen("libtcti-tabrmd.so.0", RTLD_LAZY); -+ if (!tabrmd_handle) { -+ LOG_ERR ("Unable to find out the tabrmd tcti library"); -+ return NULL; -+ } -+ -+ TSS2_RC (*init)(TSS2_TCTI_CONTEXT *, size_t *); -+ init = dlsym(tabrmd_handle, "tss2_tcti_tabrmd_init"); -+ if (!init) -+ return NULL; -+ - size_t size; -- TSS2_RC rc = tss2_tcti_tabrmd_init(NULL, &size); -+ TSS2_RC rc = init(NULL, &size); - if (rc != TSS2_RC_SUCCESS) { - LOG_ERR("Failed to get size for TABRMD TCTI context: 0x%" PRIx32, rc); - return NULL; -@@ -55,7 +72,7 @@ TSS2_TCTI_CONTEXT *tpm2_tools_tcti_abrmd_init(char *opts) { - return NULL; - } - -- rc = tss2_tcti_tabrmd_init(tcti_ctx, &size); -+ rc = init(tcti_ctx, &size); - if (rc != TSS2_RC_SUCCESS) { - LOG_ERR ("Failed to initialize TABRMD TCTI context: 0x%" PRIx32, rc); - free(tcti_ctx); --- -2.14.1 - diff --git a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_3.0.4.bb b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_3.0.4.bb new file mode 100644 index 0000000..f4850a7 --- /dev/null +++ b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_3.0.4.bb @@ -0,0 +1,7 @@ +include ${BPN}.inc + +SRC_URI = "https://github.com/tpm2-software/${BPN}/releases/download/${PV}/${BPN}-${PV}.tar.gz" +SRC_URI[md5sum] = "f7a962c6e3d2997efe8949ac7aec8283" +SRC_URI[sha256sum] = "ac05028347a9fa1da79b5d53b998193de0c3a76000badb961c3feb8b8a0e8e8e" + +S = "${WORKDIR}/${BPN}-${PV}" diff --git a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_git.bb b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_git.bb index b592882..c566526 100644 --- a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_git.bb +++ b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_git.bb @@ -1,42 +1,22 @@ -SUMMARY = "Tools for TPM2." -DESCRIPTION = "tpm2-tools" -SECTION = "security/tpm" +include ${BPN}.inc -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=91b7c548d73ea16537799e8060cea819" +DEFAULT_PREFERENCE = "-1" -DEPENDS += "tpm2-tss tpm2-abrmd openssl curl autoconf-archive pkgconfig" +DEPENDS += "libtss2 libtss2-mu libtss2-tcti-device libtss2-tcti-mssim" -PV = "3.0.3+git${SRCPV}" +PVBASE := "${PV}" +PV = "${PVBASE}.${SRCPV}" -SRC_URI = "\ - git://github.com/tpm2-software/tpm2-tools.git;branch=3.X \ - file://0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch \ -" -SRCREV = "6b4385f098bd5d39e1cfc6cd2b038b68c960413f" +SRC_URI = "git://github.com/tpm2-software/${BPN}.git;protocol=git;branch=master;name=${BPN};destsuffix=${BPN}" -S = "${WORKDIR}/git" +SRCREV = "${AUTOREV}" -inherit autotools pkgconfig +S = "${WORKDIR}/${BPN}" -EXTRA_OECONF += "\ - --with-tcti-device \ - --without-tcti-socket \ - --with-tcti-tabrmd \ -" - -EXTRA_OEMAKE += "\ - CFLAGS="${CFLAGS} -Wno-implicit-fallthrough" \ - LIBS=-ldl \ -" - -do_configure_prepend() { - # execute the bootstrap script - currentdir="$(pwd)" - cd "${S}" - ACLOCAL="aclocal --system-acdir=${STAGING_DATADIR}/aclocal" \ - ./bootstrap - cd "${currentdir}" +do_configure_prepend () { + # execute the bootstrap script + currentdir=$(pwd) + cd ${S} + AUTORECONF=true ./bootstrap + cd ${currentdir} } - -RDEPENDS_${PN} += "libtss2 libtctidevice" -- cgit v1.2.3-54-g00ecf