Skip to contentSkip to conversation

boot/optee-os: add custom version option

PATCH Applied Vincent Stehlé 3 participants 4 messages Dec 20, 2024 – Jan 13, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 boot/optee-os: add custom version option

Add custom version option, to enable easily specifying an official OP-TEE version to use.
This is similar to what is done in other packages, such as linux, uboot or arm-trusted-firmware.

Cc Étienne Carrière <[email protected]>

---

Hi,

Note that, unlike what is done in arm-trusted-firmware, building with BR2_DOWNLOAD_FORCE_CHECK_HASHES=y and BR2_TARGET_OPTEE_OS_CUSTOM_VERSION=y, and not supplying a hash will fail.
I think this is what we want, but do not hesitate to let me know if you would prefer to make an exception (with BR_NO_CHECK_HASH_FOR) in all the cases where we use a custom version, and I will respin the patch.

This was boot-tested with the following defconfigs (modified locally to use OP-TEE 4.4.0):
- arm_fvp_ebbr
- qemu_aarch64_ebbr
- qemu_arm_ebbr
- qemu_arm_vexpress_tz

Also, this was build-tested with the following defconfigs (modified locally to use OP-TEE 4.4.0):
- beagleboneai64
- beagleplay
- ti_am62ax_sk
- ti_am62px_sk
- ti_am62x_sk
- ti_am64x_sk

Finally, this was tested with tests.boot.test_optee_os.TestOptee (modified locally to use OP-TEE 4.4.0).

(Note that to build OP-TEE 4.4.0 in the defconfigs and test, BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY=y is also necessary.)

Have a nice Christmas break,
Vincent.

 boot/optee-os/Config.in | 11 +++++++++++
 1 file changed, 11 insertions(+)
boot/optee-os/Config.in +11 -0
index cc0044f00a..6c4afccc7a 100644
@@ -25,6 +25,11 @@ config BR2_TARGET_OPTEE_OS_LATEST
 	  Use the latest release tag from the OP-TEE OS official Git
 	  repository.
 
+config BR2_TARGET_OPTEE_OS_CUSTOM_VERSION
+	bool "Custom version"
+	help
+	  This option allows to use a specific official version
+
 config BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL
 	bool "Custom tarball"
 	help
@@ -43,6 +48,10 @@ config BR2_TARGET_OPTEE_OS_CUSTOM_GIT
 
 endchoice
 
+config BR2_TARGET_OPTEE_OS_CUSTOM_VERSION_VALUE
+	string "OP-TEE version"
+	depends on BR2_TARGET_OPTEE_OS_CUSTOM_VERSION
+
 if BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL
 
 config BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION
@@ -71,6 +80,8 @@ endif
 config BR2_TARGET_OPTEE_OS_VERSION
 	string
 	default "4.3.0"		if BR2_TARGET_OPTEE_OS_LATEST
+	default BR2_TARGET_OPTEE_OS_CUSTOM_VERSION_VALUE \
+		if BR2_TARGET_OPTEE_OS_CUSTOM_VERSION
 	default "custom"	if BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL
 	default BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION \
 				if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
Signature · 6 lines
2.45.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hi Vincent, Étienne,

Quoted 7 lines · Vincent Stehlé

Add custom version option, to enable easily specifying an official OP-TEE version to use.
This is similar to what is done in other packages, such as linux, uboot or arm-trusted-firmware.

Cc Étienne Carrière <[email protected]>

I applied this patch to master, thanks.

Do you think the same logic should also be added to the optee-client, optee-examples and optee-test packages?

I currently believe so.

Best regards,

Julien.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Hello Julien, Vincent,

Quoted 13 lines · Julien Olivain

Hi Vincent, Étienne,

Quoted 9 lines · Vincent Stehlé

Add custom version option, to enable easily specifying an official OP-TEE
version to use.
This is similar to what is done in other packages, such as linux, uboot or
arm-trusted-firmware.

Cc Étienne Carrière <[email protected]>
Quoted 7 lines

I applied this patch to master, thanks.

Do you think the same logic should also be added to the optee-client, optee-examples and optee-test packages?

I currently believe so.

I do also since O-TEE test source tree should be synced with OP-TEE OS source tree.

Best regards,
Etienne

Quoted 4 lines

Best regards,

Julien.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to Julien Olivain
Quoted 10 lines · Julien Olivain

Hi Vincent, Étienne,

Quoted 7 lines · Vincent Stehlé

Add custom version option, to enable easily specifying an official OP-TEE
version to use.
This is similar to what is done in other packages, such as linux, uboot or
arm-trusted-firmware.

Quoted 4 lines
Quoted 2 lines
Cc Étienne Carrière <[email protected]>

I applied this patch to master, thanks.

Hi Julien,

Thanks for handling this patch.

Quoted 4 lines

Do you think the same logic should also be added to the optee-client, optee-examples and optee-test packages?

I currently believe so.

Good idea!

I think we could even have an additional option in those packages to specify "same version as optee-os", similarly to BR2_KERNEL_HEADERS_AS_KERNEL.

Best regards,
Vincent.

Quoted 4 lines

Best regards,

Julien.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot