From: João Marcos Costa Date: Thu, 14 May 2026 14:15:15 +0000 (+0200) Subject: ovmf: simplify PACKAGECONFIG's default value X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=083a24364bfa735cea72d35a0c3ba971ce181c66;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git ovmf: simplify PACKAGECONFIG's default value 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 Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb index 958f42fc10..cc251bbc00 100644 --- a/meta/recipes-core/ovmf/ovmf_git.bb +++ b/meta/recipes-core/ovmf/ovmf_git.bb @@ -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,,"