Skip to contentSkip to conversation

meta-tpm: Update python runtime dependencies

PATCH Superseded Omri Sarig 2 participants 4 messages Mar 11, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Omri Sarig

author
#0 lore raw

cover meta-tpm: Update python runtime dependencies

When adding the package of tpm2-pkcs11-tools to my Yocto build, the file of pkcs11-tool failed to run.
There were several different errors, all originated in missing python packages on my target platform.

I've added the relevant python packages as runtime dependencies to the relevant recipes in the repository, to ensure that the recipes are always self-contained.

Omri Sarig (2):
tpm2-pytss: Add python3-asn1crypto runtime dependency
tpm2-pkcs11: Add tools python runtime dependencies

 meta-tpm/recipes-tpm2/tpm2-pkcs11/tpm2-pkcs11_1.9.1.bb       | 2 +-
 meta-tpm/recipes-tpm2/tpm2-pytss/python3-tpm2-pytss_2.3.0.bb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
author
#1 lore raw

PATCH 1/2 tpm2-pytss: Add python3-asn1crypto runtime dependency

The tpm2-pytss module is importing the module asn1crypto in tsskey.py, however, the current bitbake recipe is not including this python package as runtime dependency. This causes the module invocation to fail at the moment.

The commit adds this dependency to the bitbake recipe, to make the recipe self contained.

---
 meta-tpm/recipes-tpm2/tpm2-pytss/python3-tpm2-pytss_2.3.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-tpm/recipes-tpm2/tpm2-pytss/python3-tpm2-pytss_2.3.0.bb +1 -1
index 57e284b..4ddf287 100644
@@ -18,4 +18,4 @@ DEPENDS = " \
     tpm2-tss \
 "
 
-RDEPENDS:${PN} = "libtss2"
+RDEPENDS:${PN} = "libtss2 python3-asn1crypto"
author
#2 lore raw

PATCH 2/2 tpm2-pkcs11: Add tools python runtime dependencies

In reply to Omri Sarig

The tpm2-pkcs11-tools python module is importing several modules which are not currently included in it's dependencies. This causes the script invocation to fail. The current commit adds the relevant dependencies, to ensure that the python module is always able to run.

The relevant dependencies are:
* python3-fcntl: To add the fcntl module, imported in db.py.
* python3-sqlite3: To add the sqlite3 module, imported in db.py.
* python3-tpm2-pytss: To add the tpm2_pytss module, imported in utils.py.
* python3-compression: To add the zipfile module, imported through "importlib.metadata import distribution" in tpm2_ptool.

---
 meta-tpm/recipes-tpm2/tpm2-pkcs11/tpm2-pkcs11_1.9.1.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-tpm/recipes-tpm2/tpm2-pkcs11/tpm2-pkcs11_1.9.1.bb +1 -1
index a7d8170..331dc4f 100644
@@ -44,6 +44,6 @@ FILES:${PN} += "\
 INSANE_SKIP:${PN}   += "dev-so"
 
 RDEPENDS:${PN} = "p11-kit tpm2-tools "
-RDEPENDS:${PN}-tools = "python3-pyyaml python3-cryptography python3-pyasn1-modules"
+RDEPENDS:${PN}-tools = "python3-pyyaml python3-cryptography python3-pyasn1-modules python3-compression python3-fcntl python3-sqlite3 python3-tpm2-pytss"
 
 BBCLASSEXTEND = "native nativesdk"
#3 lore raw
In reply to Omri Sarig

Hi,

Quoted 8 lines · Omri Sarig via lists.yoctoproject.org

When adding the package of tpm2-pkcs11-tools to my Yocto build, the file of pkcs11-tool failed to run.
There were several different errors, all originated in missing python packages on my target platform.

I've added the relevant python packages as runtime dependencies to the relevant recipes in the repository, to ensure that the recipes are always self-contained.

Could you also extend meta-tpm/lib/oeqa/runtime/cases/tpm2.py with tests to run these tools in some simple ways? These dependencies may change with updates and would be nice to not break them again.

Cheers,

-Mikko