mirror of
https://github.com/jiazhang0/meta-secure-core.git
synced 2026-05-06 17:58:24 +00:00
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 <twoerner@gmail.com>
This commit is contained in:
committed by
Jia Zhang
parent
a504af5587
commit
ec19d0a8ec
11
meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools.inc
Normal file
11
meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools.inc
Normal file
@@ -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
|
||||
@@ -1,63 +0,0 @@
|
||||
From 1c29c5206be61edb9ebb165f5e4ae2f5eceb5608 Mon Sep 17 00:00:00 2001
|
||||
From: Jia Zhang <zhang.jia@linux.alibaba.com>
|
||||
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 <zhang.jia@linux.alibaba.com>
|
||||
---
|
||||
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 <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
+#include <dlfcn.h>
|
||||
#include <tcti/tcti-tabrmd.h>
|
||||
|
||||
#include <sapi/tpm20.h>
|
||||
@@ -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
|
||||
|
||||
7
meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_3.0.4.bb
Normal file
7
meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_3.0.4.bb
Normal file
@@ -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}"
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user