From 617f0af2dc7867979f75dc537e3ebeb2f937efc8 Mon Sep 17 00:00:00 2001 From: Armin Kuster Date: Wed, 26 Apr 2023 09:56:38 -0400 Subject: recipes-tpm: use this for common tpm recipes a bit of re-org Signed-off-by: Armin Kuster --- .../Convert-another-vdprintf-to-dprintf.patch | 26 +++++++++ .../files/Use-format-s-for-call-to-dprintf.patch | 33 +++++++++++ .../libtpm/files/fix_signed_issue.patch | 48 ++++++++++++++++ meta-tpm/recipes-tpm/libtpm/libtpm_0.9.5.bb | 16 ++++++ meta-tpm/recipes-tpm/swtpm/files/fix_fcntl_h.patch | 31 ++++++++++ .../swtpm/files/fix_lib_search_path.patch | 66 ++++++++++++++++++++++ .../recipes-tpm/swtpm/swtpm-wrappers-native.bb | 49 ++++++++++++++++ meta-tpm/recipes-tpm/swtpm/swtpm_0.7.3.bb | 50 ++++++++++++++++ .../Convert-another-vdprintf-to-dprintf.patch | 26 --------- .../files/Use-format-s-for-call-to-dprintf.patch | 33 ----------- .../libtpm/files/fix_signed_issue.patch | 48 ---------------- meta-tpm/recipes-tpm1/libtpm/libtpm_0.9.5.bb | 16 ------ .../recipes-tpm1/swtpm/files/fix_fcntl_h.patch | 31 ---------- .../swtpm/files/fix_lib_search_path.patch | 66 ---------------------- .../recipes-tpm1/swtpm/swtpm-wrappers-native.bb | 49 ---------------- meta-tpm/recipes-tpm1/swtpm/swtpm_0.7.3.bb | 50 ---------------- 16 files changed, 319 insertions(+), 319 deletions(-) create mode 100644 meta-tpm/recipes-tpm/libtpm/files/Convert-another-vdprintf-to-dprintf.patch create mode 100644 meta-tpm/recipes-tpm/libtpm/files/Use-format-s-for-call-to-dprintf.patch create mode 100644 meta-tpm/recipes-tpm/libtpm/files/fix_signed_issue.patch create mode 100644 meta-tpm/recipes-tpm/libtpm/libtpm_0.9.5.bb create mode 100644 meta-tpm/recipes-tpm/swtpm/files/fix_fcntl_h.patch create mode 100644 meta-tpm/recipes-tpm/swtpm/files/fix_lib_search_path.patch create mode 100644 meta-tpm/recipes-tpm/swtpm/swtpm-wrappers-native.bb create mode 100644 meta-tpm/recipes-tpm/swtpm/swtpm_0.7.3.bb delete mode 100644 meta-tpm/recipes-tpm1/libtpm/files/Convert-another-vdprintf-to-dprintf.patch delete mode 100644 meta-tpm/recipes-tpm1/libtpm/files/Use-format-s-for-call-to-dprintf.patch delete mode 100644 meta-tpm/recipes-tpm1/libtpm/files/fix_signed_issue.patch delete mode 100644 meta-tpm/recipes-tpm1/libtpm/libtpm_0.9.5.bb delete mode 100644 meta-tpm/recipes-tpm1/swtpm/files/fix_fcntl_h.patch delete mode 100644 meta-tpm/recipes-tpm1/swtpm/files/fix_lib_search_path.patch delete mode 100644 meta-tpm/recipes-tpm1/swtpm/swtpm-wrappers-native.bb delete mode 100644 meta-tpm/recipes-tpm1/swtpm/swtpm_0.7.3.bb diff --git a/meta-tpm/recipes-tpm/libtpm/files/Convert-another-vdprintf-to-dprintf.patch b/meta-tpm/recipes-tpm/libtpm/files/Convert-another-vdprintf-to-dprintf.patch new file mode 100644 index 0000000..9e1021a --- /dev/null +++ b/meta-tpm/recipes-tpm/libtpm/files/Convert-another-vdprintf-to-dprintf.patch @@ -0,0 +1,26 @@ +From 09e7dd42e5201d079bad70e9f7cc6033ce1c7cad Mon Sep 17 00:00:00 2001 +From: Stefan Berger +Date: Fri, 3 Feb 2017 10:58:22 -0500 +Subject: [PATCH] Convert another vdprintf to dprintf + +Signed-off-by: Stefan Berger +Upstream-Status: Backport +Signed-off-by: Armin Kuster + +--- + src/tpm_library.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: git/src/tpm_library.c +=================================================================== +--- git.orig/src/tpm_library.c ++++ git/src/tpm_library.c +@@ -427,7 +427,7 @@ void TPMLIB_LogPrintfA(unsigned int inde + indent = sizeof(spaces) - 1; + memset(spaces, ' ', indent); + spaces[indent] = 0; +- vdprintf(debug_fd, spaces, NULL); ++ dprintf(debug_fd, "%s", spaces); + } + + va_start(args, format); diff --git a/meta-tpm/recipes-tpm/libtpm/files/Use-format-s-for-call-to-dprintf.patch b/meta-tpm/recipes-tpm/libtpm/files/Use-format-s-for-call-to-dprintf.patch new file mode 100644 index 0000000..a71b5c1 --- /dev/null +++ b/meta-tpm/recipes-tpm/libtpm/files/Use-format-s-for-call-to-dprintf.patch @@ -0,0 +1,33 @@ +From 6a9b4e5d70f770aa9ca31e3e6d3b1ae72c192070 Mon Sep 17 00:00:00 2001 +From: Stefan Berger +Date: Tue, 31 Jan 2017 20:10:51 -0500 +Subject: [PATCH] Use format '%s' for call to dprintf + +Fix the dprintf call to use a format parameter that otherwise causes +errors with gcc on certain platforms. + +Signed-off-by: Stefan Berger + +Upstream-Status: Backport +replaces local patch +Signed-off-by: Armin Kuster + +--- + src/tpm_library.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Index: git/src/tpm_library.c +=================================================================== +--- git.orig/src/tpm_library.c ++++ git/src/tpm_library.c +@@ -405,8 +405,8 @@ int TPMLIB_LogPrintf(const char *format, + } + + if (debug_prefix) +- dprintf(debug_fd, debug_prefix); +- dprintf(debug_fd, buffer); ++ dprintf(debug_fd, "%s", debug_prefix); ++ dprintf(debug_fd, "%s", buffer); + + return i; + } diff --git a/meta-tpm/recipes-tpm/libtpm/files/fix_signed_issue.patch b/meta-tpm/recipes-tpm/libtpm/files/fix_signed_issue.patch new file mode 100644 index 0000000..fc13aa5 --- /dev/null +++ b/meta-tpm/recipes-tpm/libtpm/files/fix_signed_issue.patch @@ -0,0 +1,48 @@ +Upstream-Status: Pending +Signed-off-by: Armin kuster + +Index: git/src/swtpm/ctrlchannel.c +=================================================================== +--- git.orig/src/swtpm/ctrlchannel.c ++++ git/src/swtpm/ctrlchannel.c +@@ -152,7 +152,8 @@ static int ctrlchannel_receive_state(ptm + uint32_t tpm_number = 0; + unsigned char *blob = NULL; + uint32_t blob_length = be32toh(pss->u.req.length); +- uint32_t remain = blob_length, offset = 0; ++ ssize_t remain = (ssize_t) blob_length; ++ uint32_t offset = 0; + TPM_RESULT res; + uint32_t flags = be32toh(pss->u.req.state_flags); + TPM_BOOL is_encrypted = (flags & PTM_STATE_FLAG_ENCRYPTED) != 0; +Index: git/src/swtpm_ioctl/tpm_ioctl.c +=================================================================== +--- git.orig/src/swtpm_ioctl/tpm_ioctl.c ++++ git/src/swtpm_ioctl/tpm_ioctl.c +@@ -303,7 +303,7 @@ static int do_save_state_blob(int fd, bo + numbytes = write(file_fd, pgs.u.resp.data, + devtoh32(is_chardev, pgs.u.resp.length)); + +- if (numbytes != devtoh32(is_chardev, pgs.u.resp.length)) { ++ if (numbytes != (ssize_t) devtoh32(is_chardev, pgs.u.resp.length)) { + fprintf(stderr, + "Could not write to file '%s': %s\n", + filename, strerror(errno)); +@@ -420,7 +420,7 @@ static int do_load_state_blob(int fd, bo + had_error = true; + break; + } +- pss.u.req.length = htodev32(is_chardev, numbytes); ++ pss.u.req.length = htodev32(is_chardev, (uint32_t) numbytes); + + /* the returnsize is zero on all intermediate packets */ + returnsize = ((size_t)numbytes < sizeof(pss.u.req.data)) +@@ -863,7 +863,7 @@ int main(int argc, char *argv[]) + return EXIT_FAILURE; + } + /* no tpm_result here */ +- printf("ptm capability is 0x%lx\n", (uint64_t)devtoh64(is_chardev, cap)); ++ printf("ptm capability is 0x%llx\n", (uint64_t)devtoh64(is_chardev, cap)); + + } else if (!strcmp(command, "-i")) { + init.u.req.init_flags = htodev32(is_chardev, PTM_INIT_FLAG_DELETE_VOLATILE); diff --git a/meta-tpm/recipes-tpm/libtpm/libtpm_0.9.5.bb b/meta-tpm/recipes-tpm/libtpm/libtpm_0.9.5.bb new file mode 100644 index 0000000..cf80064 --- /dev/null +++ b/meta-tpm/recipes-tpm/libtpm/libtpm_0.9.5.bb @@ -0,0 +1,16 @@ +SUMMARY = "LIBPM - Software TPM Library" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e73f0786a936da3814896df06ad225a9" + +SRCREV = "df1c3e98d697f3c1f09262d2ba161a7db784d6cc" +SRC_URI = "git://github.com/stefanberger/libtpms.git;branch=stable-0.9;protocol=https" + +PE = "1" + +S = "${WORKDIR}/git" +inherit autotools-brokensep pkgconfig perlnative + +PACKAGECONFIG ?= "openssl" +PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl" + +BBCLASSEXTEND = "native" diff --git a/meta-tpm/recipes-tpm/swtpm/files/fix_fcntl_h.patch b/meta-tpm/recipes-tpm/swtpm/files/fix_fcntl_h.patch new file mode 100644 index 0000000..3d16431 --- /dev/null +++ b/meta-tpm/recipes-tpm/swtpm/files/fix_fcntl_h.patch @@ -0,0 +1,31 @@ +From 8750a6c3f0b4d9e7e45b4079150d29eb44774e9c Mon Sep 17 00:00:00 2001 +From: Armin Kuster +Date: Tue, 14 Mar 2017 22:59:36 -0700 +Subject: [PATCH 2/4] logging: Fix musl build issue with fcntl + + error: #warning redirecting incorrect #include to [-Werror=cpp] + #warning redirecting incorrect #include to + +--- + src/swtpm/logging.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/swtpm/logging.c b/src/swtpm/logging.c +index f16cab6..7da8606 100644 +--- a/src/swtpm/logging.c ++++ b/src/swtpm/logging.c +@@ -45,7 +45,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +-- +2.11.0 + diff --git a/meta-tpm/recipes-tpm/swtpm/files/fix_lib_search_path.patch b/meta-tpm/recipes-tpm/swtpm/files/fix_lib_search_path.patch new file mode 100644 index 0000000..60958f7 --- /dev/null +++ b/meta-tpm/recipes-tpm/swtpm/files/fix_lib_search_path.patch @@ -0,0 +1,66 @@ +From 672bb4ee625da3141ba6cecb0601c7563de4c483 Mon Sep 17 00:00:00 2001 +From: Armin Kuster +Date: Thu, 13 Oct 2016 02:03:56 -0700 +Subject: [PATCH 1/4] swtpm: add new package + +Upstream-Status: Inappropriate [OE config] + +Signed-off-by: Armin Kuster + +Rebased to current tip. + +Signed-off-by: Patrick Ohly + +--- + configure.ac | 34 ++++++++++------------------------ + 1 file changed, 10 insertions(+), 24 deletions(-) + +diff --git a/configure.ac b/configure.ac +index abf5be1..85ed6ac 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -395,31 +395,17 @@ CFLAGS="$CFLAGS -Wformat -Wformat-security" + dnl We have to make sure libtpms is using the same crypto library + dnl to avoid problems + AC_MSG_CHECKING([the crypto library libtpms is using]) +-dirs=$($CC $CFLAGS -Xlinker --verbose 2>/dev/null | \ +- sed -n '/SEARCH_DIR/p' | \ +- sed 's/SEARCH_DIR("\(@<:@^"@:>@*\)"); */\1 /g' | \ +- sed 's|=/|/|g') +-for dir in $dirs $LIBRARY_PATH; do +- if test -r $dir/libtpms.so; then +- if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then +- libtpms_cryptolib="openssl" +- break +- fi +- if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then +- libtpms_cryptolib="freebl" +- break +- fi ++dir="$SEARCH_DIR" ++if test -r $dir/libtpms.so; then ++ if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then ++ libtpms_cryptolib="openssl" ++ break + fi +- case $host_os in +- cygwin|openbsd*) +- if test -r $dir/libtpms.a; then +- if test -n "$(nm $dir/libtpms.a | grep "U AES_encrypt")"; then +- libtpms_cryptolib="openssl" +- fi +- fi +- ;; +- esac +-done ++ if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then ++ libtpms_cryptolib="freebl" ++ break ++ fi ++fi + + if test -z "$libtpms_cryptolib"; then + AC_MSG_ERROR([Could not determine libtpms crypto library.]) +-- +2.11.0 + diff --git a/meta-tpm/recipes-tpm/swtpm/swtpm-wrappers-native.bb b/meta-tpm/recipes-tpm/swtpm/swtpm-wrappers-native.bb new file mode 100644 index 0000000..bb93374 --- /dev/null +++ b/meta-tpm/recipes-tpm/swtpm/swtpm-wrappers-native.bb @@ -0,0 +1,49 @@ +SUMMARY = "SWTPM - OpenEmbedded wrapper scripts for native swtpm tools" +LICENSE = "MIT" +DEPENDS = "swtpm-native" + +inherit native + +# The whole point of the recipe is to make files available +# for use after the build is done, so don't clean up... +RM_WORK_EXCLUDE += "${PN}" + +do_create_wrapper () { + # Wrap (almost) all swtpm binaries. Some get special wrappers and some + # are not needed. + for i in `find ${bindir} ${base_bindir} ${sbindir} ${base_sbindir} -name 'swtpm*' -perm /+x -type f`; do + exe=`basename $i` + case $exe in + swtpm_setup) + cat >${WORKDIR}/swtpm_setup_oe.sh <${WORKDIR}/${exe}_oe.sh < -Date: Fri, 3 Feb 2017 10:58:22 -0500 -Subject: [PATCH] Convert another vdprintf to dprintf - -Signed-off-by: Stefan Berger -Upstream-Status: Backport -Signed-off-by: Armin Kuster - ---- - src/tpm_library.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: git/src/tpm_library.c -=================================================================== ---- git.orig/src/tpm_library.c -+++ git/src/tpm_library.c -@@ -427,7 +427,7 @@ void TPMLIB_LogPrintfA(unsigned int inde - indent = sizeof(spaces) - 1; - memset(spaces, ' ', indent); - spaces[indent] = 0; -- vdprintf(debug_fd, spaces, NULL); -+ dprintf(debug_fd, "%s", spaces); - } - - va_start(args, format); diff --git a/meta-tpm/recipes-tpm1/libtpm/files/Use-format-s-for-call-to-dprintf.patch b/meta-tpm/recipes-tpm1/libtpm/files/Use-format-s-for-call-to-dprintf.patch deleted file mode 100644 index a71b5c1..0000000 --- a/meta-tpm/recipes-tpm1/libtpm/files/Use-format-s-for-call-to-dprintf.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 6a9b4e5d70f770aa9ca31e3e6d3b1ae72c192070 Mon Sep 17 00:00:00 2001 -From: Stefan Berger -Date: Tue, 31 Jan 2017 20:10:51 -0500 -Subject: [PATCH] Use format '%s' for call to dprintf - -Fix the dprintf call to use a format parameter that otherwise causes -errors with gcc on certain platforms. - -Signed-off-by: Stefan Berger - -Upstream-Status: Backport -replaces local patch -Signed-off-by: Armin Kuster - ---- - src/tpm_library.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -Index: git/src/tpm_library.c -=================================================================== ---- git.orig/src/tpm_library.c -+++ git/src/tpm_library.c -@@ -405,8 +405,8 @@ int TPMLIB_LogPrintf(const char *format, - } - - if (debug_prefix) -- dprintf(debug_fd, debug_prefix); -- dprintf(debug_fd, buffer); -+ dprintf(debug_fd, "%s", debug_prefix); -+ dprintf(debug_fd, "%s", buffer); - - return i; - } diff --git a/meta-tpm/recipes-tpm1/libtpm/files/fix_signed_issue.patch b/meta-tpm/recipes-tpm1/libtpm/files/fix_signed_issue.patch deleted file mode 100644 index fc13aa5..0000000 --- a/meta-tpm/recipes-tpm1/libtpm/files/fix_signed_issue.patch +++ /dev/null @@ -1,48 +0,0 @@ -Upstream-Status: Pending -Signed-off-by: Armin kuster - -Index: git/src/swtpm/ctrlchannel.c -=================================================================== ---- git.orig/src/swtpm/ctrlchannel.c -+++ git/src/swtpm/ctrlchannel.c -@@ -152,7 +152,8 @@ static int ctrlchannel_receive_state(ptm - uint32_t tpm_number = 0; - unsigned char *blob = NULL; - uint32_t blob_length = be32toh(pss->u.req.length); -- uint32_t remain = blob_length, offset = 0; -+ ssize_t remain = (ssize_t) blob_length; -+ uint32_t offset = 0; - TPM_RESULT res; - uint32_t flags = be32toh(pss->u.req.state_flags); - TPM_BOOL is_encrypted = (flags & PTM_STATE_FLAG_ENCRYPTED) != 0; -Index: git/src/swtpm_ioctl/tpm_ioctl.c -=================================================================== ---- git.orig/src/swtpm_ioctl/tpm_ioctl.c -+++ git/src/swtpm_ioctl/tpm_ioctl.c -@@ -303,7 +303,7 @@ static int do_save_state_blob(int fd, bo - numbytes = write(file_fd, pgs.u.resp.data, - devtoh32(is_chardev, pgs.u.resp.length)); - -- if (numbytes != devtoh32(is_chardev, pgs.u.resp.length)) { -+ if (numbytes != (ssize_t) devtoh32(is_chardev, pgs.u.resp.length)) { - fprintf(stderr, - "Could not write to file '%s': %s\n", - filename, strerror(errno)); -@@ -420,7 +420,7 @@ static int do_load_state_blob(int fd, bo - had_error = true; - break; - } -- pss.u.req.length = htodev32(is_chardev, numbytes); -+ pss.u.req.length = htodev32(is_chardev, (uint32_t) numbytes); - - /* the returnsize is zero on all intermediate packets */ - returnsize = ((size_t)numbytes < sizeof(pss.u.req.data)) -@@ -863,7 +863,7 @@ int main(int argc, char *argv[]) - return EXIT_FAILURE; - } - /* no tpm_result here */ -- printf("ptm capability is 0x%lx\n", (uint64_t)devtoh64(is_chardev, cap)); -+ printf("ptm capability is 0x%llx\n", (uint64_t)devtoh64(is_chardev, cap)); - - } else if (!strcmp(command, "-i")) { - init.u.req.init_flags = htodev32(is_chardev, PTM_INIT_FLAG_DELETE_VOLATILE); diff --git a/meta-tpm/recipes-tpm1/libtpm/libtpm_0.9.5.bb b/meta-tpm/recipes-tpm1/libtpm/libtpm_0.9.5.bb deleted file mode 100644 index cf80064..0000000 --- a/meta-tpm/recipes-tpm1/libtpm/libtpm_0.9.5.bb +++ /dev/null @@ -1,16 +0,0 @@ -SUMMARY = "LIBPM - Software TPM Library" -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=e73f0786a936da3814896df06ad225a9" - -SRCREV = "df1c3e98d697f3c1f09262d2ba161a7db784d6cc" -SRC_URI = "git://github.com/stefanberger/libtpms.git;branch=stable-0.9;protocol=https" - -PE = "1" - -S = "${WORKDIR}/git" -inherit autotools-brokensep pkgconfig perlnative - -PACKAGECONFIG ?= "openssl" -PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl" - -BBCLASSEXTEND = "native" diff --git a/meta-tpm/recipes-tpm1/swtpm/files/fix_fcntl_h.patch b/meta-tpm/recipes-tpm1/swtpm/files/fix_fcntl_h.patch deleted file mode 100644 index 3d16431..0000000 --- a/meta-tpm/recipes-tpm1/swtpm/files/fix_fcntl_h.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8750a6c3f0b4d9e7e45b4079150d29eb44774e9c Mon Sep 17 00:00:00 2001 -From: Armin Kuster -Date: Tue, 14 Mar 2017 22:59:36 -0700 -Subject: [PATCH 2/4] logging: Fix musl build issue with fcntl - - error: #warning redirecting incorrect #include to [-Werror=cpp] - #warning redirecting incorrect #include to - ---- - src/swtpm/logging.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/swtpm/logging.c b/src/swtpm/logging.c -index f16cab6..7da8606 100644 ---- a/src/swtpm/logging.c -+++ b/src/swtpm/logging.c -@@ -45,7 +45,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include --- -2.11.0 - diff --git a/meta-tpm/recipes-tpm1/swtpm/files/fix_lib_search_path.patch b/meta-tpm/recipes-tpm1/swtpm/files/fix_lib_search_path.patch deleted file mode 100644 index 60958f7..0000000 --- a/meta-tpm/recipes-tpm1/swtpm/files/fix_lib_search_path.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 672bb4ee625da3141ba6cecb0601c7563de4c483 Mon Sep 17 00:00:00 2001 -From: Armin Kuster -Date: Thu, 13 Oct 2016 02:03:56 -0700 -Subject: [PATCH 1/4] swtpm: add new package - -Upstream-Status: Inappropriate [OE config] - -Signed-off-by: Armin Kuster - -Rebased to current tip. - -Signed-off-by: Patrick Ohly - ---- - configure.ac | 34 ++++++++++------------------------ - 1 file changed, 10 insertions(+), 24 deletions(-) - -diff --git a/configure.ac b/configure.ac -index abf5be1..85ed6ac 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -395,31 +395,17 @@ CFLAGS="$CFLAGS -Wformat -Wformat-security" - dnl We have to make sure libtpms is using the same crypto library - dnl to avoid problems - AC_MSG_CHECKING([the crypto library libtpms is using]) --dirs=$($CC $CFLAGS -Xlinker --verbose 2>/dev/null | \ -- sed -n '/SEARCH_DIR/p' | \ -- sed 's/SEARCH_DIR("\(@<:@^"@:>@*\)"); */\1 /g' | \ -- sed 's|=/|/|g') --for dir in $dirs $LIBRARY_PATH; do -- if test -r $dir/libtpms.so; then -- if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then -- libtpms_cryptolib="openssl" -- break -- fi -- if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then -- libtpms_cryptolib="freebl" -- break -- fi -+dir="$SEARCH_DIR" -+if test -r $dir/libtpms.so; then -+ if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then -+ libtpms_cryptolib="openssl" -+ break - fi -- case $host_os in -- cygwin|openbsd*) -- if test -r $dir/libtpms.a; then -- if test -n "$(nm $dir/libtpms.a | grep "U AES_encrypt")"; then -- libtpms_cryptolib="openssl" -- fi -- fi -- ;; -- esac --done -+ if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then -+ libtpms_cryptolib="freebl" -+ break -+ fi -+fi - - if test -z "$libtpms_cryptolib"; then - AC_MSG_ERROR([Could not determine libtpms crypto library.]) --- -2.11.0 - diff --git a/meta-tpm/recipes-tpm1/swtpm/swtpm-wrappers-native.bb b/meta-tpm/recipes-tpm1/swtpm/swtpm-wrappers-native.bb deleted file mode 100644 index bb93374..0000000 --- a/meta-tpm/recipes-tpm1/swtpm/swtpm-wrappers-native.bb +++ /dev/null @@ -1,49 +0,0 @@ -SUMMARY = "SWTPM - OpenEmbedded wrapper scripts for native swtpm tools" -LICENSE = "MIT" -DEPENDS = "swtpm-native" - -inherit native - -# The whole point of the recipe is to make files available -# for use after the build is done, so don't clean up... -RM_WORK_EXCLUDE += "${PN}" - -do_create_wrapper () { - # Wrap (almost) all swtpm binaries. Some get special wrappers and some - # are not needed. - for i in `find ${bindir} ${base_bindir} ${sbindir} ${base_sbindir} -name 'swtpm*' -perm /+x -type f`; do - exe=`basename $i` - case $exe in - swtpm_setup) - cat >${WORKDIR}/swtpm_setup_oe.sh <${WORKDIR}/${exe}_oe.sh <