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(). Signed-off-by: João Marcos Costa <[email protected]> --- meta/recipes-core/ovmf/ovmf_git.bb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb index 958f42fc10..779e9f8196 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,," -- 2.47.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#236791): https://lists.openembedded.org/g/openembedded-core/message/236791 Mute This Topic: https://lists.openembedded.org/mt/119253357/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
