[Buildroot] [PATCH 2/3] boot/optee-os: add support to build with python-cryptography

Clément Léger clement.leger at bootlin.com
Thu Mar 10 08:07:44 UTC 2022


Newer version of optee-os (>= 3.16) uses python-cryptography instead of
python-pycryptodomex in python scripts. Add support to build these
newer versions by adding a new
BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY option which will
select host-python-cryptography dependency when building optee-os.

Signed-off-by: Clément Léger <clement.leger at bootlin.com>
---
 boot/optee-os/Config.in   | 8 ++++++++
 boot/optee-os/optee-os.mk | 7 ++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/boot/optee-os/Config.in b/boot/optee-os/Config.in
index 0974578484..f8426f9ab2 100644
--- a/boot/optee-os/Config.in
+++ b/boot/optee-os/Config.in
@@ -48,6 +48,14 @@ config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION
 
 endif
 
+config BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY
+	bool "optee-os needs host-python-cryptography to build"
+	help
+	  OP-TEE version below 3.16 used python-pycryptodomex package
+	  in python scripts. Newer version uses python-cryptography.
+	  Select this option if optee-os needs python-cryptography to
+	  be built.
+
 config BR2_TARGET_OPTEE_OS_VERSION
 	string
 	default "3.15.0"	if BR2_TARGET_OPTEE_OS_LATEST
diff --git a/boot/optee-os/optee-os.mk b/boot/optee-os/optee-os.mk
index 166b5e693c..57f9a17bb6 100644
--- a/boot/optee-os/optee-os.mk
+++ b/boot/optee-os/optee-os.mk
@@ -21,7 +21,12 @@ else
 OPTEE_OS_SITE = $(call github,OP-TEE,optee_os,$(OPTEE_OS_VERSION))
 endif
 
-OPTEE_OS_DEPENDENCIES = host-openssl host-python3 host-python-pycryptodomex host-python-pyelftools
+OPTEE_OS_DEPENDENCIES = host-openssl host-python3 host-python-pyelftools
+ifeq ($(BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY),y)
+OPTEE_OS_DEPENDENCIES += host-python-cryptography
+else
+OPTEE_OS_DEPENDENCIES += host-python-pycryptodomex
+endif
 
 # On 64bit targets, OP-TEE OS can be built in 32bit mode, or
 # can be built in 64bit mode and support 32bit and 64bit
-- 
2.34.1




More information about the buildroot mailing list