Skip to contentSkip to conversation

ovmf: fix tpm PACKAGECONFIG to use TPM2_ENABLE

PATCH In review Eilís 'pidge' Ní Fhlannagáin 2 participants 4 messages Jul 8 – Jul 10

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ovmf: fix tpm PACKAGECONFIG to use TPM2_ENABLE

The tpm PACKAGECONFIG passed "-D TPM_ENABLE=TRUE/FALSE", but ovmf renamed that macro to TPM2_ENABLE in edk2 commit 4de8d61bcec0 ("OvmfPkg: rework TPM configuration", first released in edk2-stable202202). Since then TPM_ENABLE has been an unknown macro that edk2 ignores, so TPM2 support was never compiled in, even for MACHINEs with 'tpm'/'tpm2' in MACHINE_FEATURES.

Use TPM2_ENABLE (as defined in OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc and consumed by OvmfPkgX64.dsc) so the tpm PACKAGECONFIG actually enables TPM2 support.

The same commit also added a separate TPM1_ENABLE macro (TPM 1.2 support, default TRUE), but its dsc.inc snippets are only included inside OvmfPkgX64.dsc's "!if $(TPM2_ENABLE) == TRUE" block, so it has no effect unless TPM2_ENABLE is TRUE. No separate PACKAGECONFIG knob is needed.

I'm sending a backport to wrynose of this in another email.

---
 meta/recipes-core/ovmf/ovmf_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/ovmf/ovmf_git.bb +1 -1
index bda33e2631..ab276bad1f 100644
@@ -12,7 +12,7 @@ LIC_FILES_CHKSUM = "file://OvmfPkg/License.txt;md5=06357ddc23f46577c2aeaeaf7b776
 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,,"
+PACKAGECONFIG[tpm] = "-D TPM2_ENABLE=TRUE,-D TPM2_ENABLE=FALSE,,"
 
 SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https;tag=${PV} \
            file://0001-ovmf-update-path-to-native-BaseTools.patch \
Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · Eilís 'pidge' Ní Fhlannagáin via lists.openembedded.org

The tpm PACKAGECONFIG passed "-D TPM_ENABLE=TRUE/FALSE", but ovmf renamed that macro to TPM2_ENABLE in edk2 commit 4de8d61bcec0 ("OvmfPkg: rework TPM configuration", first released in edk2-stable202202). Since then TPM_ENABLE has been an unknown macro that edk2 ignores, so TPM2 support was never compiled in, even for MACHINEs with 'tpm'/'tpm2' in MACHINE_FEATURES.

Hello,

By looking at the version only, should'nt this be backported to scarthgap as well? It has ovmf edk2-stable202402.

Thanks!

Quoted 31 lines

Use TPM2_ENABLE (as defined in OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc and consumed by OvmfPkgX64.dsc) so the tpm PACKAGECONFIG actually enables TPM2 support.

The same commit also added a separate TPM1_ENABLE macro (TPM 1.2 support, default TRUE), but its dsc.inc snippets are only included inside OvmfPkgX64.dsc's "!if $(TPM2_ENABLE) == TRUE" block, so it has no effect unless TPM2_ENABLE is TRUE. No separate PACKAGECONFIG knob is needed.

I'm sending a backport to wrynose of this in another email.

---
 meta/recipes-core/ovmf/ovmf_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/ovmf/ovmf_git.bb +1 -1
index bda33e2631..ab276bad1f 100644
@@ -12,7 +12,7 @@ LIC_FILES_CHKSUM = "file://OvmfPkg/License.txt;md5=06357ddc23f46577c2aeaeaf7b776
 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,,"
+PACKAGECONFIG[tpm] = "-D TPM2_ENABLE=TRUE,-D TPM2_ENABLE=FALSE,,"
 
 SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https;tag=${PV} \
            file://0001-ovmf-update-path-to-native-BaseTools.patch \
Signature · 2 lines
Yoann Congal
Smile ECS
#2 lore raw
Quoted 9 lines · Yoann Congal
Quoted 6 lines · Eilís 'pidge' Ní Fhlannagáin via lists.openembedded.org

The tpm PACKAGECONFIG passed "-D TPM_ENABLE=TRUE/FALSE", but ovmf renamed that macro to TPM2_ENABLE in edk2 commit 4de8d61bcec0 ("OvmfPkg: rework TPM configuration", first released in edk2-stable202202). Since then TPM_ENABLE has been an unknown macro that edk2 ignores, so TPM2 support was never compiled in, even for MACHINEs with 'tpm'/'tpm2' in MACHINE_FEATURES.

Quoted 5 lines

Hello,

By looking at the version only, should'nt this be backported to scarthgap as well? It has ovmf edk2-stable202402.

Yes, I wasn't looking at scarthgap, but yes, if it has edk2-stable202402, then it should be applied there as well.

-e

Quoted 39 lines

Thanks!

Quoted 23 lines

Use TPM2_ENABLE (as defined in OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc and consumed by OvmfPkgX64.dsc) so the tpm PACKAGECONFIG actually enables TPM2 support.

The same commit also added a separate TPM1_ENABLE macro (TPM 1.2 support, default TRUE), but its dsc.inc snippets are only included inside OvmfPkgX64.dsc's "!if $(TPM2_ENABLE) == TRUE" block, so it has no effect unless TPM2_ENABLE is TRUE. No separate PACKAGECONFIG knob is needed.

I'm sending a backport to wrynose of this in another email.

---
 meta/recipes-core/ovmf/ovmf_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/ovmf/ovmf_git.bb +0 -0
index bda33e2631..ab276bad1f 100644

meta/recipes-core/ovmf/ovmf_git.bb LIC_FILES_CHKSUM = "file://OvmfPkg/License.txt;md5=06357ddc23f46577c2aeaeaf7b776 · line 18

Quoted 8 lines
meta/recipes-core/ovmf/ovmf_git.bb +1 -1
@@ -12,7 +12,7 @@ LIC_FILES_CHKSUM = "file://OvmfPkg/License.txt;md5=06357ddc23f46577c2aeaeaf7b776
 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,,"
+PACKAGECONFIG[tpm] = "-D TPM2_ENABLE=TRUE,-D TPM2_ENABLE=FALSE,,"
 
 SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https;tag=${PV} \
            file://0001-ovmf-update-path-to-native-BaseTools.patch \

--
Yoann Congal
Smile ECS

#3 lore raw

Le ven. 10 juil. 2026 à 14:00, Eilís Ní Fhlannagáin <[email protected]> a écrit :

Quoted 11 lines · Yoann Congal
Quoted 2 lines

On Wed Jul 8, 2026 at 4:22 PM CEST, Eilís 'pidge' Ní Fhlannagáin via

Quoted 7 lines · lists.openembedded.org
Quoted 6 lines

The tpm PACKAGECONFIG passed "-D TPM_ENABLE=TRUE/FALSE", but ovmf renamed that macro to TPM2_ENABLE in edk2 commit 4de8d61bcec0 ("OvmfPkg: rework TPM configuration", first released in edk2-stable202202). Since then TPM_ENABLE has been an unknown macro that edk2 ignores, so TPM2 support was never compiled in, even for MACHINEs with 'tpm'/'tpm2' in MACHINE_FEATURES.

Quoted 9 lines
Quoted 5 lines

Hello,

By looking at the version only, should'nt this be backported to scarthgap as well? It has ovmf edk2-stable202402.

Yes, I wasn't looking at scarthgap, but yes, if it has edk2-stable202402, then it should be applied there as well.

The cherry-pick has no conflict so I'll put that in my review branch.

Thanks!

Signature · 2 lines
Yoann Congal
Smile ECS