diff options
| author | Lans Zhang <jia.zhang@windriver.com> | 2017-07-20 15:21:04 +0800 |
|---|---|---|
| committer | Lans Zhang <jia.zhang@windriver.com> | 2017-07-20 15:21:04 +0800 |
| commit | e8aee2ab910672ac4ef3dcc8d31ca87511762b0b (patch) | |
| tree | 24fd811322c74c50184188bed64b771e480d2702 /meta-tpm2 | |
| parent | e8744053191efd5d10a2471cbf8beedd482886e8 (diff) | |
| download | meta-secure-core-e8aee2ab910672ac4ef3dcc8d31ca87511762b0b.tar.gz | |
tpm2.0-tools: update to the latest and code style fixup
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
Diffstat (limited to 'meta-tpm2')
| -rw-r--r-- | meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-Fix-build-failure-with-glib-2.0.patch (renamed from meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0002-Fix-build-failure-with-glib-2.0.patch) | 16 | ||||
| -rw-r--r-- | meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0002-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch (renamed from meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch) | 35 | ||||
| -rw-r--r-- | meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb | 23 |
3 files changed, 31 insertions, 43 deletions
diff --git a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0002-Fix-build-failure-with-glib-2.0.patch b/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-Fix-build-failure-with-glib-2.0.patch index faeaf2a..80aaa0d 100644 --- a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0002-Fix-build-failure-with-glib-2.0.patch +++ b/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-Fix-build-failure-with-glib-2.0.patch | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | From 53f9b2f63c5370f4d269bf08d940cc8576fcbbf4 Mon Sep 17 00:00:00 2001 | 1 | From 1f8d526bad6a0317bde32a0278fbabe2492e7c62 Mon Sep 17 00:00:00 2001 |
| 2 | From: Lans Zhang <jia.zhang@windriver.com> | 2 | From: Lans Zhang <jia.zhang@windriver.com> |
| 3 | Date: Mon, 19 Jun 2017 13:54:34 +0800 | 3 | Date: Thu, 20 Jul 2017 14:51:34 +0800 |
| 4 | Subject: [PATCH 2/2] Fix build failure with glib-2.0 | 4 | Subject: [PATCH] Fix build failure with glib-2.0 |
| 5 | 5 | ||
| 6 | Signed-off-by: Lans Zhang <jia.zhang@windriver.com> | 6 | Signed-off-by: Lans Zhang <jia.zhang@windriver.com> |
| 7 | --- | 7 | --- |
| @@ -10,20 +10,20 @@ Signed-off-by: Lans Zhang <jia.zhang@windriver.com> | |||
| 10 | 2 files changed, 2 insertions(+), 1 deletion(-) | 10 | 2 files changed, 2 insertions(+), 1 deletion(-) |
| 11 | 11 | ||
| 12 | diff --git a/Makefile.am b/Makefile.am | 12 | diff --git a/Makefile.am b/Makefile.am |
| 13 | index 68ba044..e792049 100644 | 13 | index c40c24b..2f4fa3e 100644 |
| 14 | --- a/Makefile.am | 14 | --- a/Makefile.am |
| 15 | +++ b/Makefile.am | 15 | +++ b/Makefile.am |
| 16 | @@ -35,7 +35,7 @@ ACLOCAL_AMFLAGS = -I m4 | 16 | @@ -35,7 +35,7 @@ ACLOCAL_AMFLAGS = -I m4 |
| 17 | INCLUDE_DIRS = -I$(srcdir)/src -I$(srcdir)/lib | 17 | INCLUDE_DIRS = -I$(srcdir)/src -I$(srcdir)/lib |
| 18 | LIB_COMMON := lib/libcommon.a | 18 | LIB_COMMON := lib/libcommon.a |
| 19 | 19 | ||
| 20 | -AM_CFLAGS := $(INCLUDE_DIRS) $(TPM20_TSS_CFLAGS) $(EXTRA_CFLAGS) $(TCTI_TABRMD_CFLAGS) | 20 | -AM_CFLAGS := $(INCLUDE_DIRS) $(TPM20_TSS_CFLAGS) $(EXTRA_CFLAGS) $(TCTI_TABRMD_CFLAGS) $(CRYPTO_CFLAGS) |
| 21 | +AM_CFLAGS := $(INCLUDE_DIRS) $(GLIB_CFLAGS) $(TPM20_TSS_CFLAGS) $(EXTRA_CFLAGS) $(TCTI_TABRMD_CFLAGS) | 21 | +AM_CFLAGS := $(INCLUDE_DIRS) $(GLIB_CFLAGS) $(TPM20_TSS_CFLAGS) $(EXTRA_CFLAGS) $(TCTI_TABRMD_CFLAGS) $(CRYPTO_CFLAGS) |
| 22 | AM_LDFLAGS := $(EXTRA_LDFLAGS) | 22 | AM_LDFLAGS := $(EXTRA_LDFLAGS) |
| 23 | 23 | ||
| 24 | LDADD = $(LIB_COMMON) $(TPM20_TSS_LIBS) $(TCTI_SOCK_LIBS) $(TCTI_DEV_LIBS) $(TCTI_TABRMD_LIBS) -ldl | 24 | LDADD = $(LIB_COMMON) $(TPM20_TSS_LIBS) $(TCTI_SOCK_LIBS) $(TCTI_DEV_LIBS) $(TCTI_TABRMD_LIBS) $(CRYPTO_LIBS) |
| 25 | diff --git a/configure.ac b/configure.ac | 25 | diff --git a/configure.ac b/configure.ac |
| 26 | index ce781ea..08fa81c 100644 | 26 | index 8ef3b17..8db6922 100644 |
| 27 | --- a/configure.ac | 27 | --- a/configure.ac |
| 28 | +++ b/configure.ac | 28 | +++ b/configure.ac |
| 29 | @@ -6,6 +6,7 @@ LT_INIT | 29 | @@ -6,6 +6,7 @@ LT_INIT |
diff --git a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch b/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0002-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch index 8d91ca0..994a25a 100644 --- a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch +++ b/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools/0002-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch | |||
| @@ -1,32 +1,18 @@ | |||
| 1 | From 9aee7b2bc400a336f0a938ce80eba51707662612 Mon Sep 17 00:00:00 2001 | 1 | From b328bb108cc926274ca20cc722d8d8ad91f19d60 Mon Sep 17 00:00:00 2001 |
| 2 | From: Lans Zhang <jia.zhang@windriver.com> | 2 | From: Lans Zhang <jia.zhang@windriver.com> |
| 3 | Date: Mon, 19 Jun 2017 13:52:53 +0800 | 3 | Date: Thu, 20 Jul 2017 15:19:51 +0800 |
| 4 | Subject: [PATCH 1/2] tpm2-tools: use dynamic linkage with tpm2-abrmd | 4 | Subject: [PATCH] tpm2-tools: use dynamic linkage with tpm2-abrmd |
| 5 | 5 | ||
| 6 | tpm2-abrmd has huge dependencies and they are not necessary to be involved | 6 | tpm2-abrmd has huge dependencies and they are not necessary to be involved |
| 7 | in initramfs. | 7 | in initramfs. |
| 8 | 8 | ||
| 9 | Signed-off-by: Lans Zhang <jia.zhang@windriver.com> | 9 | Signed-off-by: Lans Zhang <jia.zhang@windriver.com> |
| 10 | --- | 10 | --- |
| 11 | Makefile.am | 2 +- | 11 | lib/context-util.c | 21 +++++++++++++++++++-- |
| 12 | lib/context-util.c | 22 ++++++++++++++++++++-- | 12 | 1 file changed, 19 insertions(+), 2 deletions(-) |
| 13 | 2 files changed, 21 insertions(+), 3 deletions(-) | ||
| 14 | 13 | ||
| 15 | diff --git a/Makefile.am b/Makefile.am | ||
| 16 | index a3c43f8..68ba044 100644 | ||
| 17 | --- a/Makefile.am | ||
| 18 | +++ b/Makefile.am | ||
| 19 | @@ -38,7 +38,7 @@ LIB_COMMON := lib/libcommon.a | ||
| 20 | AM_CFLAGS := $(INCLUDE_DIRS) $(TPM20_TSS_CFLAGS) $(EXTRA_CFLAGS) $(TCTI_TABRMD_CFLAGS) | ||
| 21 | AM_LDFLAGS := $(EXTRA_LDFLAGS) | ||
| 22 | |||
| 23 | -LDADD = $(LIB_COMMON) $(TPM20_TSS_LIBS) $(TCTI_SOCK_LIBS) $(TCTI_DEV_LIBS) $(TCTI_TABRMD_LIBS) | ||
| 24 | +LDADD = $(LIB_COMMON) $(TPM20_TSS_LIBS) $(TCTI_SOCK_LIBS) $(TCTI_DEV_LIBS) $(TCTI_TABRMD_LIBS) -ldl | ||
| 25 | |||
| 26 | sbin_PROGRAMS = \ | ||
| 27 | tools/tpm2_create \ | ||
| 28 | diff --git a/lib/context-util.c b/lib/context-util.c | 14 | diff --git a/lib/context-util.c b/lib/context-util.c |
| 29 | index 7de22ac..2ef181d 100644 | 15 | index 7de22ac..9814548 100644 |
| 30 | --- a/lib/context-util.c | 16 | --- a/lib/context-util.c |
| 31 | +++ b/lib/context-util.c | 17 | +++ b/lib/context-util.c |
| 32 | @@ -38,6 +38,7 @@ | 18 | @@ -38,6 +38,7 @@ |
| @@ -37,7 +23,7 @@ index 7de22ac..2ef181d 100644 | |||
| 37 | #include <tcti/tcti-tabrmd.h> | 23 | #include <tcti/tcti-tabrmd.h> |
| 38 | #endif | 24 | #endif |
| 39 | 25 | ||
| 40 | @@ -134,10 +135,27 @@ TSS2_TCTI_CONTEXT* | 26 | @@ -134,10 +135,26 @@ TSS2_TCTI_CONTEXT* |
| 41 | tcti_tabrmd_init (void) | 27 | tcti_tabrmd_init (void) |
| 42 | { | 28 | { |
| 43 | TSS2_TCTI_CONTEXT *tcti_ctx; | 29 | TSS2_TCTI_CONTEXT *tcti_ctx; |
| @@ -53,9 +39,8 @@ index 7de22ac..2ef181d 100644 | |||
| 53 | - rc = tss2_tcti_tabrmd_init(NULL, &size); | 39 | - rc = tss2_tcti_tabrmd_init(NULL, &size); |
| 54 | + tabrmd_handle = dlopen("libtcti-tabrmd.so.0", RTLD_LAZY); | 40 | + tabrmd_handle = dlopen("libtcti-tabrmd.so.0", RTLD_LAZY); |
| 55 | + if (!tabrmd_handle) { | 41 | + if (!tabrmd_handle) { |
| 56 | + fprintf (stderr, | 42 | + LOG_ERR ("Unable to find out the tabrmd tcti library"); |
| 57 | + "Unable to find out the tabrmd tcti library\n"); | 43 | + return NULL; |
| 58 | + return NULL; | ||
| 59 | + } | 44 | + } |
| 60 | + | 45 | + |
| 61 | + init = dlsym(tabrmd_handle, "tss2_tcti_tabrmd_init"); | 46 | + init = dlsym(tabrmd_handle, "tss2_tcti_tabrmd_init"); |
| @@ -66,7 +51,7 @@ index 7de22ac..2ef181d 100644 | |||
| 66 | if (rc != TSS2_RC_SUCCESS) { | 51 | if (rc != TSS2_RC_SUCCESS) { |
| 67 | LOG_ERR ("Failed to get size for TABRMD TCTI context: 0x%" PRIx32, rc); | 52 | LOG_ERR ("Failed to get size for TABRMD TCTI context: 0x%" PRIx32, rc); |
| 68 | return NULL; | 53 | return NULL; |
| 69 | @@ -148,7 +166,7 @@ tcti_tabrmd_init (void) | 54 | @@ -148,7 +165,7 @@ tcti_tabrmd_init (void) |
| 70 | strerror (errno)); | 55 | strerror (errno)); |
| 71 | return NULL; | 56 | return NULL; |
| 72 | } | 57 | } |
diff --git a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb b/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb index a914c3b..7135fd6 100644 --- a/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb +++ b/meta-tpm2/recipes-tpm/tpm2.0-tools/tpm2.0-tools_git.bb | |||
| @@ -1,36 +1,37 @@ | |||
| 1 | SUMMARY = "Tools for TPM2." | 1 | SUMMARY = "Tools for TPM2." |
| 2 | DESCRIPTION = "tpm2.0-tools" | 2 | DESCRIPTION = "tpm2.0-tools" |
| 3 | SECTION = "tpm" | 3 | SECTION = "security/tpm" |
| 4 | 4 | ||
| 5 | LICENSE = "BSD" | 5 | LICENSE = "BSD" |
| 6 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=91b7c548d73ea16537799e8060cea819" | 6 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=91b7c548d73ea16537799e8060cea819" |
| 7 | 7 | ||
| 8 | DEPENDS += "tpm2.0-tss tpm2-abrmd openssl curl autoconf-archive pkgconfig" | 8 | DEPENDS += "tpm2.0-tss tpm2-abrmd openssl curl autoconf-archive pkgconfig" |
| 9 | RDEPENDS_${PN} += "libtss2 libtctidevice" | ||
| 10 | 9 | ||
| 11 | SRC_URI = " \ | 10 | PV = "2.1.0+git${SRCPV}" |
| 11 | |||
| 12 | SRC_URI = "\ | ||
| 12 | git://github.com/01org/tpm2.0-tools.git;branch=master;name=tpm2.0-tools;destsuffix=tpm2.0-tools \ | 13 | git://github.com/01org/tpm2.0-tools.git;branch=master;name=tpm2.0-tools;destsuffix=tpm2.0-tools \ |
| 13 | file://ax_check_compile_flag.m4 \ | 14 | file://ax_check_compile_flag.m4 \ |
| 14 | file://ax_check_preproc_flag.m4 \ | 15 | file://ax_check_preproc_flag.m4 \ |
| 15 | file://ax_check_link_flag.m4 \ | 16 | file://ax_check_link_flag.m4 \ |
| 16 | file://0001-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch \ | 17 | file://0001-Fix-build-failure-with-glib-2.0.patch \ |
| 17 | file://0002-Fix-build-failure-with-glib-2.0.patch \ | 18 | file://0002-tpm2-tools-use-dynamic-linkage-with-tpm2-abrmd.patch \ |
| 18 | " | 19 | " |
| 20 | SRCREV = "97306d6dc1fc5f3142c50efe3189bd46ff35b5a0" | ||
| 19 | 21 | ||
| 20 | S = "${WORKDIR}/${BPN}" | 22 | S = "${WORKDIR}/${BPN}" |
| 21 | SRCREV = "ada4c20d23d99b4b489c6c793e4132c1d5234b66" | ||
| 22 | PV = "2.0.0+git${SRCPV}" | ||
| 23 | 23 | ||
| 24 | inherit autotools pkgconfig | 24 | inherit autotools pkgconfig |
| 25 | 25 | ||
| 26 | EXTRA_OECONF += " \ | 26 | EXTRA_OECONF += "\ |
| 27 | --with-tcti-device \ | 27 | --with-tcti-device \ |
| 28 | --without-tcti-socket \ | 28 | --without-tcti-socket \ |
| 29 | --with-tcti-tabrmd \ | 29 | --with-tcti-tabrmd \ |
| 30 | " | 30 | " |
| 31 | 31 | ||
| 32 | EXTRA_OEMAKE += " \ | 32 | EXTRA_OEMAKE += "\ |
| 33 | CFLAGS="${CFLAGS} -Wno-implicit-fallthrough" \ | 33 | CFLAGS="${CFLAGS} -Wno-implicit-fallthrough" \ |
| 34 | LIBS=-ldl \ | ||
| 34 | " | 35 | " |
| 35 | 36 | ||
| 36 | do_configure_prepend() { | 37 | do_configure_prepend() { |
| @@ -40,9 +41,11 @@ do_configure_prepend() { | |||
| 40 | cp "${WORKDIR}/ax_check_link_flag.m4" "${S}/m4" | 41 | cp "${WORKDIR}/ax_check_link_flag.m4" "${S}/m4" |
| 41 | 42 | ||
| 42 | # execute the bootstrap script | 43 | # execute the bootstrap script |
| 43 | currentdir=$(pwd) | 44 | currentdir="$(pwd)" |
| 44 | cd "${S}" | 45 | cd "${S}" |
| 45 | ACLOCAL="aclocal --system-acdir=${STAGING_DATADIR}/aclocal" \ | 46 | ACLOCAL="aclocal --system-acdir=${STAGING_DATADIR}/aclocal" \ |
| 46 | ./bootstrap --force | 47 | ./bootstrap --force |
| 47 | cd "${currentdir}" | 48 | cd "${currentdir}" |
| 48 | } | 49 | } |
| 50 | |||
| 51 | RDEPENDS_${PN} += "libtss2 libtctidevice" | ||
