[meta-security,2/2] parsec-service: Only enable TPM is layer and DISTRO_FEATURE is defined.

Message ID 20220228161231.2096596-2-akuster808@gmail.com
State New
Headers show
Series [meta-security,1/2] layer.conf: enable apparmor for qemu machine | expand

Commit Message

akuster808 Feb. 28, 2022, 4:12 p.m. UTC
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
 .../recipes-parsec/parsec-service/parsec-service_0.8.1.bb  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/meta-parsec/recipes-parsec/parsec-service/parsec-service_0.8.1.bb b/meta-parsec/recipes-parsec/parsec-service/parsec-service_0.8.1.bb
index 1cbf2bd..3f12139 100644
--- a/meta-parsec/recipes-parsec/parsec-service/parsec-service_0.8.1.bb
+++ b/meta-parsec/recipes-parsec/parsec-service/parsec-service_0.8.1.bb
@@ -12,7 +12,12 @@  SRC_URI += "crate://crates.io/parsec-service/${PV} \
 
 DEPENDS = "clang-native"
 
-PACKAGECONFIG ??= "TPM PKCS11 MBED-CRYPTO CRYPTOAUTHLIB"
+PACKAGECONFIG ??= "PKCS11 MBED-CRYPTO CRYPTOAUTHLIB"
+
+have_TPM = "${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', 'TPM', '', d)}"
+PACKAGECONFIG:append = " ${@bb.utils.contains('BBFILE_COLLECTIONS', 'tpm-layer', '${have_TPM}', '', d)}"
+
+
 PACKAGECONFIG[ALL] = "all-providers cryptoki/generate-bindings tss-esapi/generate-bindings,,tpm2-tss libts,libts"
 PACKAGECONFIG[TPM] = "tpm-provider tss-esapi/generate-bindings,,tpm2-tss"
 PACKAGECONFIG[PKCS11] = "pkcs11-provider cryptoki/generate-bindings,"