1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-06-01 13:10:04 +00:00

optee-test_git.bb: add optee-test recipe & patches

This has moved from meta-linaro to meta-arm as this
is the new place for general recipes for Arm arch
and has a mailing list for external contributors.

python2 is now EOL. This patch updates to python3
but is a backport from v3.8.0 release.

Change-Id: Ib778b8dd9c605e1fbb69627f5e640c1683c3176b
Tested-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
This commit is contained in:
Peter Griffin
2020-01-29 17:38:44 +00:00
committed by Jon Mason
parent 72848d26e2
commit 11233ba158
2 changed files with 98 additions and 0 deletions
@@ -0,0 +1,48 @@
From 6271160639002a2580d80b75b5397a96d56329f2 Mon Sep 17 00:00:00 2001
From: Scott Branden <scott.branden@broadcom.com>
Date: Fri, 27 Dec 2019 12:54:28 -0800
Subject: [PATCH] use python3 instead of python
use python3 instead of python as python2 is EOL January 2020.
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Jerome Forissier <jerome@forissier.org>
Tested-by: Jerome Forissier <jerome@forissier.org> (QEMU, CFG_GCM_NIST_VECTORS=y)
Upstream-Status: Backport from v3.8.0
---
scripts/file_to_c.py | 4 ++--
scripts/rsp_to_gcm_test.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/file_to_c.py b/scripts/file_to_c.py
index ae16f52..b4ce2a2 100755
--- a/scripts/file_to_c.py
+++ b/scripts/file_to_c.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018, Linaro Limited
@@ -29,7 +29,7 @@ def main():
f.write("const uint8_t " + args.name + "[] = {\n")
i = 0
- for x in array.array("B", inf.read()):
+ for x in array.array("B", map(ord, (inf.read()))):
f.write("0x" + '{0:02x}'.format(x) + ",")
i = i + 1
if i % 8 == 0:
diff --git a/scripts/rsp_to_gcm_test.py b/scripts/rsp_to_gcm_test.py
index 0543541..e4418be 100755
--- a/scripts/rsp_to_gcm_test.py
+++ b/scripts/rsp_to_gcm_test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
modes = {'encrypt': 0, 'decrypt': 1}
--
2.7.4
@@ -0,0 +1,50 @@
SUMMARY = "OP-TEE sanity testsuite"
HOMEPAGE = "https://github.com/OP-TEE/optee_test"
LICENSE = "BSD & GPLv2"
LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
inherit python3native
DEPENDS = "optee-client optee-os python3-pycrypto-native"
PV = "3.7.0+git${SRCPV}"
SRC_URI = "git://github.com/OP-TEE/optee_test.git \
file://0001-use-python3-instead-of-python.patch \
"
S = "${WORKDIR}/git"
SRCREV = "227d6f4c40eaa6f84fe049b9e48c7b27ad7fab08"
OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta"
EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
TEEC_EXPORT=${TEEC_EXPORT} \
CROSS_COMPILE_HOST=${TARGET_PREFIX} \
CROSS_COMPILE_TA=${TARGET_PREFIX} \
V=1 \
"
do_compile() {
# Top level makefile doesn't seem to handle parallel make gracefully
oe_runmake xtest
oe_runmake ta
}
do_install () {
install -D -p -m0755 ${S}/out/xtest/xtest ${D}${bindir}/xtest
# install path should match the value set in optee-client/tee-supplicant
# default TEEC_LOAD_PATH is /lib
mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
install -D -p -m0444 ${S}/out/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
}
FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
# Imports machine specific configs from staging to build
PACKAGE_ARCH = "${MACHINE_ARCH}"