@@ -9,9 +9,7 @@ LIC_FILES_CHKSUM = "file://OvmfPkg/License.txt;md5=06357ddc23f46577c2aeaeaf7b776
# Enabling Secure Boot adds a dependency on OpenSSL and implies
# compiling OVMF twice, so it is disabled by default. Distros
# may change that default.
-PACKAGECONFIG ??= ""
-PACKAGECONFIG += "${@bb.utils.filter('MACHINE_FEATURES', 'tpm', d)}"
-PACKAGECONFIG += "${@bb.utils.contains('MACHINE_FEATURES', 'tpm2', 'tpm', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.contains_any('MACHINE_FEATURES', 'tpm tpm2', 'tpm', '', d)}"
PACKAGECONFIG[debug] = ",,,"
PACKAGECONFIG[secureboot] = ",,,"
PACKAGECONFIG[tpm] = "-D TPM_ENABLE=TRUE,-D TPM_ENABLE=FALSE,,"
The two append operations call bb.utils.contains, while a single contains_any() does the trick in a cleaner way. Regarding the default value, if tpm is not enabled, PACKAGECONFIG ends up with a couple empty spaces, and this can be avoided by redefining the default value to the result of contains_any(). Even though this replacement comes with a change in behaviour (at least in edge cases), we prefer a consistent PACKAGECONFIG (weak) default assignment across recipes. Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com> --- meta/recipes-core/ovmf/ovmf_git.bb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)