summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLans Zhang <jia.zhang@windriver.com>2017-07-20 15:21:04 +0800
committerLans Zhang <jia.zhang@windriver.com>2017-07-20 15:21:04 +0800
commite8aee2ab910672ac4ef3dcc8d31ca87511762b0b (patch)
tree24fd811322c74c50184188bed64b771e480d2702
parente8744053191efd5d10a2471cbf8beedd482886e8 (diff)
downloadmeta-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>
-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.bb23
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 @@
1From 53f9b2f63c5370f4d269bf08d940cc8576fcbbf4 Mon Sep 17 00:00:00 2001 1From 1f8d526bad6a0317bde32a0278fbabe2492e7c62 Mon Sep 17 00:00:00 2001
2From: Lans Zhang <jia.zhang@windriver.com> 2From: Lans Zhang <jia.zhang@windriver.com>
3Date: Mon, 19 Jun 2017 13:54:34 +0800 3Date: Thu, 20 Jul 2017 14:51:34 +0800
4Subject: [PATCH 2/2] Fix build failure with glib-2.0 4Subject: [PATCH] Fix build failure with glib-2.0
5 5
6Signed-off-by: Lans Zhang <jia.zhang@windriver.com> 6Signed-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
12diff --git a/Makefile.am b/Makefile.am 12diff --git a/Makefile.am b/Makefile.am
13index 68ba044..e792049 100644 13index 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)
25diff --git a/configure.ac b/configure.ac 25diff --git a/configure.ac b/configure.ac
26index ce781ea..08fa81c 100644 26index 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 @@
1From 9aee7b2bc400a336f0a938ce80eba51707662612 Mon Sep 17 00:00:00 2001 1From b328bb108cc926274ca20cc722d8d8ad91f19d60 Mon Sep 17 00:00:00 2001
2From: Lans Zhang <jia.zhang@windriver.com> 2From: Lans Zhang <jia.zhang@windriver.com>
3Date: Mon, 19 Jun 2017 13:52:53 +0800 3Date: Thu, 20 Jul 2017 15:19:51 +0800
4Subject: [PATCH 1/2] tpm2-tools: use dynamic linkage with tpm2-abrmd 4Subject: [PATCH] tpm2-tools: use dynamic linkage with tpm2-abrmd
5 5
6tpm2-abrmd has huge dependencies and they are not necessary to be involved 6tpm2-abrmd has huge dependencies and they are not necessary to be involved
7in initramfs. 7in initramfs.
8 8
9Signed-off-by: Lans Zhang <jia.zhang@windriver.com> 9Signed-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
15diff --git a/Makefile.am b/Makefile.am
16index 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 \
28diff --git a/lib/context-util.c b/lib/context-util.c 14diff --git a/lib/context-util.c b/lib/context-util.c
29index 7de22ac..2ef181d 100644 15index 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 @@
1SUMMARY = "Tools for TPM2." 1SUMMARY = "Tools for TPM2."
2DESCRIPTION = "tpm2.0-tools" 2DESCRIPTION = "tpm2.0-tools"
3SECTION = "tpm" 3SECTION = "security/tpm"
4 4
5LICENSE = "BSD" 5LICENSE = "BSD"
6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=91b7c548d73ea16537799e8060cea819" 6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=91b7c548d73ea16537799e8060cea819"
7 7
8DEPENDS += "tpm2.0-tss tpm2-abrmd openssl curl autoconf-archive pkgconfig" 8DEPENDS += "tpm2.0-tss tpm2-abrmd openssl curl autoconf-archive pkgconfig"
9RDEPENDS_${PN} += "libtss2 libtctidevice"
10 9
11SRC_URI = " \ 10PV = "2.1.0+git${SRCPV}"
11
12SRC_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"
20SRCREV = "97306d6dc1fc5f3142c50efe3189bd46ff35b5a0"
19 21
20S = "${WORKDIR}/${BPN}" 22S = "${WORKDIR}/${BPN}"
21SRCREV = "ada4c20d23d99b4b489c6c793e4132c1d5234b66"
22PV = "2.0.0+git${SRCPV}"
23 23
24inherit autotools pkgconfig 24inherit autotools pkgconfig
25 25
26EXTRA_OECONF += " \ 26EXTRA_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
32EXTRA_OEMAKE += " \ 32EXTRA_OEMAKE += "\
33 CFLAGS="${CFLAGS} -Wno-implicit-fallthrough" \ 33 CFLAGS="${CFLAGS} -Wno-implicit-fallthrough" \
34 LIBS=-ldl \
34" 35"
35 36
36do_configure_prepend() { 37do_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
51RDEPENDS_${PN} += "libtss2 libtctidevice"