rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | inherit workonsrc |
| 2 | inherit deploy |
| 3 | inherit optee-build |
| 4 | DEPENDS = "python-pycrypto-native" |
| 5 | |
| 6 | inherit pythonnative |
| 7 | |
| 8 | DESCRIPTION = "OPTEE TESTSUITE" |
| 9 | LICENSE = "BSD-2-Clause & GPL-2.0" |
| 10 | PLATFORM_TYPE = "${@d.getVar('TARGET_PLATFORM', True)[0:3]+'xxx'}" |
| 11 | OVERRIDES_append = ":${PLATFORM_TYPE}" |
| 12 | TZ_SRC = "${TOPDIR}/../src/bsp/trustzone" |
| 13 | WORKONSRC = "${TZ_SRC}/optee/3.2.0/source/optee_test" |
| 14 | WORKONSRC_mt2xxx = "${TZ_SRC}/optee/optee_test/mt2xxx" |
| 15 | WORKONSRC_BUILD = "${TZ_SRC}/optee/3.2.0/source/optee_test" |
| 16 | WORKONSRC_BUILD_mt2xxx = "${TZ_SRC}/optee/optee_test/mt2xxx" |
| 17 | LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa" |
| 18 | DEPENDS += "optee-client openssl" |
| 19 | DEPENDS_append_mt2xxx = " optee-os " |
| 20 | DEPENDS_append_mt8xxx = " lib64-optee-os " |
| 21 | OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}" |
| 22 | OPTEE_OPENSSL_EXPORT = "${STAGING_INCDIR}" |
| 23 | TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}" |
| 24 | TA_DEV_KIT_DIR_mt2xxx = "${STAGING_INCDIR}/optee/export-user_ta" |
| 25 | |
| 26 | OPTEE_ARCH = "${TEE_ARCH}" |
| 27 | TEE_TOOLCHAIN_mt2xxx = "${TARGET_PREFIX}" |
| 28 | DEPENDS += "virtual/${TARGET_PREFIX}gcc" |
| 29 | |
| 30 | EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ |
| 31 | OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \ |
| 32 | OPTEE_OPENSSL_EXPORT=${OPTEE_OPENSSL_EXPORT} \ |
| 33 | TEEC_EXPORT=${TEEC_EXPORT} \ |
| 34 | CROSS_COMPILE_HOST=${TARGET_PREFIX} \ |
| 35 | CROSS_COMPILE_TA=${TEE_TOOLCHAIN} \ |
| 36 | V=1 \ |
| 37 | O=${WORKDIR}/out \ |
| 38 | COMPILE_NS_USER=32 \ |
| 39 | " |
| 40 | |
| 41 | do_compile() { |
| 42 | # Top level makefile doesn't seem to handle parallel make gracefully |
| 43 | if ${@bb.utils.contains('PLATFORM_TYPE','mt2xxx','false','true',d)}; then |
| 44 | export LD_LIBRARY_PATH=${OPTEE_LIB64}:${LD_LIBRARY_PATH} |
| 45 | export PATH=${OPTEE_BULID_SA}:${PATH} |
| 46 | fi |
| 47 | oe_runmake xtest |
| 48 | oe_runmake ta |
| 49 | } |
| 50 | |
| 51 | do_install () { |
| 52 | install -D -p -m0755 ${WORKDIR}/out/xtest/xtest ${D}${bindir}/xtest |
| 53 | |
| 54 | # install path should match the value set in optee-client/tee-supplicant |
| 55 | # default TEEC_LOAD_PATH is /lib |
| 56 | mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/ |
| 57 | install -D -p -m0444 ${WORKDIR}/out/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/ |
| 58 | } |
| 59 | |
| 60 | FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/" |
| 61 | |
| 62 | # Imports machine specific configs from staging to build |
| 63 | PACKAGE_ARCH = "${MACHINE_ARCH}" |