summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2016-10-13 02:03:56 -0700
committerArmin Kuster <akuster808@gmail.com>2016-11-01 09:03:15 -0700
commit9e5c7358ad13ec6a957c868ffa786cbf07b9baea (patch)
tree507c5ad97c0ebfbe26cc584f08c83914e7bca3d2
parent49951084334e9a2c50a3bf8f56d2f051d6516e41 (diff)
downloadmeta-security-9e5c7358ad13ec6a957c868ffa786cbf07b9baea.tar.gz
swtpm: add new package
V2: remove CACHED_CONFIGUREVARS, not needed after all fix typo in selinux option Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--recipes-tpm/swtpm/files/fix_lib_search_path.patch41
-rw-r--r--recipes-tpm/swtpm/swtpm_1.0.bb35
2 files changed, 76 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..015f418
--- /dev/null
+++ b/recipes-tpm/swtpm/files/fix_lib_search_path.patch
@@ -0,0 +1,41 @@
1
2Upstream-Status: Inappropriate [OE config]
3
4Signed-off-by: Armin Kuster <akuster808@gmail.com>
5
6Index: configure.ac
7===================================================================
8--- a/configure.ac
9+++ b/configure.ac
10@@ -349,21 +349,17 @@ CFLAGS="$CFLAGS -Wformat -Wformat-securi
11 dnl We have to make sure libtpms is using the same crypto library
12 dnl to avoid problems
13 AC_MSG_CHECKING([the crypto library libtpms is using])
14-dirs=$($CC $CFLAGS -Xlinker --verbose 2>/dev/null | \
15- sed -n '/SEARCH_DIR/p' | \
16- sed 's/SEARCH_DIR("=\?\(@<:@^"@:>@\+\)"); */\1\n/g')
17-for dir in $dirs; do
18- if test -r $dir/libtpms.so; then
19- if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
20- libtpms_cryptolib="openssl"
21- break
22- fi
23- if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
24- libtpms_cryptolib="freebl"
25- break
26- fi
27+dir="$SEARCH_DIR"
28+if test -r $dir/libtpms.so; then
29+ if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
30+ libtpms_cryptolib="openssl"
31+ break
32 fi
33-done
34+ if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
35+ libtpms_cryptolib="freebl"
36+ break
37+ fi
38+fi
39
40 if test -z "$libtpms_cryptolib"; then
41 AC_MSG_ERROR([Could not determine libtpms crypto library.])
diff --git a/recipes-tpm/swtpm/swtpm_1.0.bb b/recipes-tpm/swtpm/swtpm_1.0.bb
new file mode 100644
index 0000000..04777e1
--- /dev/null
+++ b/recipes-tpm/swtpm/swtpm_1.0.bb
@@ -0,0 +1,35 @@
1SUMMARY = "SWTPM - Software TPM Emulator"
2LICENSE = "BSD-3-Clause"
3LIC_FILES_CHKSUM = "file://LICENSE;md5=fe8092c832b71ef20dfe4c6d3decb3a8"
4SECTION = "apps"
5
6DEPENDS = "libtasn1 fuse expect socat glib-2.0 libtpm libtpm-native"
7
8SRCREV = "2cd10cee2f74c84bda22081514b6b2cb566fa42d"
9SRC_URI = "git://github.com/stefanberger/swtpm.git \
10 file://fix_lib_search_path.patch"
11
12S = "${WORKDIR}/git"
13
14inherit autotools-brokensep pkgconfig
15PARALLEL_MAKE = ""
16
17TSS_USER="tss"
18TSS_GROUP="tss"
19
20PACKAGECONFIG ?= "openssl"
21PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
22PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
23PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls"
24PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, libselinux"
25
26EXTRA_OECONF += "--with-tss-user=${TSS_USER} --with-tss-group=${TSS_GROUP}"
27
28export SEARCH_DIR = "${STAGING_LIBDIR_NATIVE}"
29
30USERADD_PACKAGES = "${PN}"
31GROUPADD_PARAM_${PN} = "--system ${TSS_USER}"
32USERADD_PARAM_${PN} = "--system -g ${TSS_GROUP} --home-dir \
33 --no-create-home --shell /bin/false ${BPN}"
34
35RDEPENDS_${PN} = "libtpm expect socat bash"