diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2017-02-03 09:46:09 +0100 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2017-02-18 11:43:20 -0800 |
commit | cdeabd9d78db4731bcc1080b5ceda4f69fae57df (patch) | |
tree | 47cd264477951f93bb1c9d0b8010a255448c79df | |
parent | f3ce860a35c248878dd8bf98688674575d5c3599 (diff) | |
download | meta-security-cdeabd9d78db4731bcc1080b5ceda4f69fae57df.tar.gz |
swtpm: enable native and nativesdk flavors
For use with qemu-tpm as described in the swtpm main README, swtpm
must be compiled natively. nativesdk is added just in case that
someone wants to add this to an SDK.
The fix_lib_search_path.patch was recently removed during the version
update, but it is still needed when building natively. Here's a
version that applies cleanly again.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | recipes-tpm/swtpm/files/fix_lib_search_path.patch | 64 | ||||
-rw-r--r-- | recipes-tpm/swtpm/swtpm_1.0.bb | 3 |
2 files changed, 67 insertions, 0 deletions
diff --git a/recipes-tpm/swtpm/files/fix_lib_search_path.patch b/recipes-tpm/swtpm/files/fix_lib_search_path.patch new file mode 100644 index 0000000..28aca4a --- /dev/null +++ b/recipes-tpm/swtpm/files/fix_lib_search_path.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From 85706ceb6877ade3b589d3c390abf5b3492bb718 Mon Sep 17 00:00:00 2001 | ||
2 | From: Armin Kuster <akuster808@gmail.com> | ||
3 | Date: Thu, 13 Oct 2016 02:03:56 -0700 | ||
4 | Subject: [PATCH] swtpm: add new package | ||
5 | |||
6 | Upstream-Status: Inappropriate [OE config] | ||
7 | |||
8 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | ||
9 | |||
10 | Rebased to current tip. | ||
11 | |||
12 | Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> | ||
13 | |||
14 | --- | ||
15 | configure.ac | 32 ++++++++++---------------------- | ||
16 | 1 file changed, 10 insertions(+), 22 deletions(-) | ||
17 | |||
18 | diff --git a/configure.ac b/configure.ac | ||
19 | index c4a9c6d..6267f64 100644 | ||
20 | --- a/configure.ac | ||
21 | +++ b/configure.ac | ||
22 | @@ -395,29 +395,17 @@ CFLAGS="$CFLAGS -Wformat -Wformat-security" | ||
23 | dnl We have to make sure libtpms is using the same crypto library | ||
24 | dnl to avoid problems | ||
25 | AC_MSG_CHECKING([the crypto library libtpms is using]) | ||
26 | -dirs=$($CC $CFLAGS -Xlinker --verbose 2>/dev/null | \ | ||
27 | - sed -n '/SEARCH_DIR/p' | \ | ||
28 | - sed 's/SEARCH_DIR("=\?\(@<:@^"@:>@\+\)"); */\1\n/g') | ||
29 | -for dir in $dirs $LIBRARY_PATH; do | ||
30 | - if test -r $dir/libtpms.so; then | ||
31 | - if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then | ||
32 | - libtpms_cryptolib="openssl" | ||
33 | - break | ||
34 | - fi | ||
35 | - if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then | ||
36 | - libtpms_cryptolib="freebl" | ||
37 | - break | ||
38 | - fi | ||
39 | +dir="$SEARCH_DIR" | ||
40 | +if test -r $dir/libtpms.so; then | ||
41 | + if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then | ||
42 | + libtpms_cryptolib="openssl" | ||
43 | + break | ||
44 | fi | ||
45 | - case $host_os in | ||
46 | - cygwin) | ||
47 | - if test -r $dir/libtpms.a; then | ||
48 | - if test -n "$(nm $dir/libtpms.a | grep "U AES_encrypt")"; then | ||
49 | - libtpms_cryptolib="openssl" | ||
50 | - fi | ||
51 | - fi | ||
52 | - esac | ||
53 | -done | ||
54 | + if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then | ||
55 | + libtpms_cryptolib="freebl" | ||
56 | + break | ||
57 | + fi | ||
58 | +fi | ||
59 | |||
60 | if test -z "$libtpms_cryptolib"; then | ||
61 | AC_MSG_ERROR([Could not determine libtpms crypto library.]) | ||
62 | -- | ||
63 | 2.1.4 | ||
64 | |||
diff --git a/recipes-tpm/swtpm/swtpm_1.0.bb b/recipes-tpm/swtpm/swtpm_1.0.bb index 27b4b8c..d5a2a58 100644 --- a/recipes-tpm/swtpm/swtpm_1.0.bb +++ b/recipes-tpm/swtpm/swtpm_1.0.bb | |||
@@ -9,6 +9,7 @@ SRCREV = "ca906a02124d0ed8b6194e845d272d23ee394a34" | |||
9 | SRC_URI = " \ | 9 | SRC_URI = " \ |
10 | git://github.com/stefanberger/swtpm.git \ | 10 | git://github.com/stefanberger/swtpm.git \ |
11 | file://fix_signed_issue.patch \ | 11 | file://fix_signed_issue.patch \ |
12 | file://fix_lib_search_path.patch \ | ||
12 | " | 13 | " |
13 | 14 | ||
14 | S = "${WORKDIR}/git" | 15 | S = "${WORKDIR}/git" |
@@ -45,3 +46,5 @@ USERADD_PARAM_${PN} = "--system -g ${TSS_GROUP} --home-dir \ | |||
45 | --no-create-home --shell /bin/false ${BPN}" | 46 | --no-create-home --shell /bin/false ${BPN}" |
46 | 47 | ||
47 | RDEPENDS_${PN} = "libtpm expect socat bash" | 48 | RDEPENDS_${PN} = "libtpm expect socat bash" |
49 | |||
50 | BBCLASSEXTEND = "native nativesdk" | ||