secure boot build code issue by using LSDK 20.04

cancel
Showing results for 
Search instead for 
Did you mean: 

secure boot build code issue by using LSDK 20.04

395 Views
tzongruey
Contributor I

Hi,

I try to build the LS1088 secure boot image by using LSDK 20.04.
It will occur an error when I build the optee_test application.
The following is the error of building the optee_test application.

Building optee_test ... 
make[2]: Entering directory '/home/frank/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test'
make[3]: Entering directory '/home/frank/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test/host/xtest'
GEN /home/frank/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test/out/xtest/regression_8100_mid_crt.h
Traceback (most recent call last):
File "../../scripts/file_to_c.py", line 48, in <module>
main()
File "../../scripts/file_to_c.py", line 32, in main
for x in array.array("B", inf.read()):
TypeError: cannot use a str to initialize an array with typecode 'B'
Makefile:227: recipe for target '/home/frank/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test/out/xtest/regression_8100_mid_crt.h' failed
make[3]: *** [/home/frank/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test/out/xtest/regression_8100_mid_crt.h] Error 1
make[3]: Leaving directory '/home/frank/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test/host/xtest'
Makefile:37: recipe for target 'xtest' failed
make[2]: *** [xtest] Error 2
make[2]: Leaving directory '/home/frank/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test'
/home/frank/flexbuild_lsdk2004_update_290520/packages/apps/security/security.mk:178: recipe for target 'optee_test' failed
make[1]: *** [optee_test] Error 2
make[1]: Leaving directory '/home/frank/flexbuild_lsdk2004_update_290520/packages/apps'
Makefile:28: recipe for target 'apps' failed
make: *** [apps] Error 2
make: Leaving directory '/home/frank/flexbuild_lsdk2004_update_290520'


I try to modify the file_to_c python file but it will occur other error as follows.

Building optee_test ... 
make[2]: Entering directory '/home/frank/Documents/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test'
make[3]: Entering directory '/home/frank/Documents/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test/host/xtest'
CC /home/frank/Documents/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test/host/xtest/regression_8100.c
In file included from /home/frank/Documents/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test/host/xtest/regression_8100.c:24:0:
/home/frank/Documents/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test/out/xtest/regression_8100_mid_crt.h:5:1: error: expected expression before 'const'
const uint8_t regression_8100_mid_crt[] = {
^~~~~
Makefile:172: recipe for target '/home/frank/Documents/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test/out/xtest/regression_8100.o' failed
make[3]: *** [/home/frank/Documents/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test/out/xtest/regression_8100.o] Error 1
make[3]: Leaving directory '/home/frank/Documents/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test/host/xtest'
Makefile:37: recipe for target 'xtest' failed
make[2]: *** [xtest] Error 2
make[2]: Leaving directory '/home/frank/Documents/flexbuild_lsdk2004_update_290520/packages/apps/security/optee_test'
/home/frank/Documents/flexbuild_lsdk2004_update_290520/packages/apps/security/security.mk:178: recipe for target 'optee_test' failed
make[1]: *** [optee_test] Error 2
make[1]: Leaving directory '/home/frank/Documents/flexbuild_lsdk2004_update_290520/packages/apps'
Makefile:28: recipe for target 'apps' failed
make: *** [apps] Error 2
make: Leaving directory '/home/frank/Documents/flexbuild_lsdk2004_update_290520'

I also found that this issue didn't occur in the new version of LSDK.
It can build successfully in LSDK21.08 and LSDK20.12.
This issue occurs in LSDK 20.04.
The attached files is the build log I collected.
How can I fix this issue in LSDK 20.04?

Thanks

 

0 Kudos
2 Replies

369 Views
yipingwang
NXP TechSupport
NXP TechSupport

I have verified building optee_test in flexbuild_lsdk2004_update_290520 on my host PC, I didn't find any problem to run the following commands.

$ flex-builder -c optee_os -a arm64

$ flex-builder -c optee_test -a arm64

Please refer to the following my host PC information.

yiping@flexbuild-790:~/flexbuild_lsdk2004_update_290520$ python --version
Python 2.7.17
yiping@flexbuild-790:~/flexbuild_lsdk2004_update_290520$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

0 Kudos

363 Views
tzongruey
Contributor I

Hi,

I have checked the environment information on my host PC.
I found that the issue is caused by the python version and python crypto module.
I change the python version from 3.6.9 to 2.7.17 and install pycryptodome.
It can build successfully in my environment.
Thanks for your help.

Thanks

0 Kudos