]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
ovmf: simplify PACKAGECONFIG's default value
authorJoão Marcos Costa <joaomarcos.costa@bootlin.com>
Thu, 14 May 2026 14:15:15 +0000 (16:15 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 18 May 2026 22:19:13 +0000 (23:19 +0100)
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>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/ovmf/ovmf_git.bb

index 958f42fc10915f6c56ed523145ba161a5fdfaf01..cc251bbc0089fa76bbcf9b0d21efb0f4d6e80a24 100644 (file)
@@ -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,,"