Compare commits

...
Author SHA1 Message Date
Casey Connolly cc0b993dff optee-test: fix build
properly build all TAs and pull them in, yeah we have to build
optee-client too urgh

Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
2025-05-09 07:57:35 +02:00
Caleb Connolly b0a5bdaec8 main: optee-test: new aport
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2025-05-06 18:23:48 +02:00
2 changed files with 131 additions and 0 deletions

No files matched your search

+108
View File
@@ -0,0 +1,108 @@
# Maintainer: Casey Connolly <kcxt@postmarketos.org>
pkgname=optee-test
pkgver=4.4.0
pkgrel=0
pkgdesc="OP-TEE test"
url="https://github.com/OP-TEE/optee_test"
arch="aarch64"
license="GPL-2.0 OR BSD-2-Clause"
depends="python3 openssl optee-client"
# bsd-compat-headers for sys/queue.h
makedepends="
make
bash
coreutils
cmake
openssl-dev
py3-cryptography
py3-elftools
ninja
optee-client-dev
linux-headers
bsd-compat-headers
util-linux-dev
"
options="!check"
_commit_optee_os="8568a733313b9a6199ef6222339780f45390bae9"
_commit_optee_client="6486773583b5983af8250a47cf07eca938e0e422"
source="
optee_os-${_commit_optee_os}.tar.gz::https://github.com/calebccff/optee_os/archive/${_commit_optee_os}.tar.gz
optee_client-${_commit_optee_client}.tar.gz::https://github.com/OP-TEE/optee_client/archive/${_commit_optee_client}.tar.gz
optee_test-${pkgver}.tar.gz::https://github.com/OP-TEE/optee_test/archive/refs/tags/${pkgver}.tar.gz
fix-build.patch
"
builddir="$srcdir/"
clientdir="$srcdir/optee_client-${_commit_optee_client}"
osdir="$srcdir/optee_os-${_commit_optee_os}"
testdir="$srcdir/optee_test-${pkgver}"
# clientdir="$builddir/optee_client"
# osdir="$builddir/optee_os"
# testdir="$builddir/optee_test"
patch_args="-p1 -d $testdir"
# prepare() {
# ln -s
# }
build() {
unset LDFLAGS
# First build optee_os for /some/ platform, it provides some parts which
# are needed by optee_test
echo "=> Building OP-TEE client"
# Set up a symlink so some relative header includes on optee-test will work
# ln -s "$clientdir" $(dirname $clientdir)/optee_client
ls -la
# make -C "$clientdir" CROSS_COMPILE64=
cd "$clientdir"
rm -rf out
# The builddir HAS to be named out because some optee-test TAs hardcode it
cmake -B out -G Ninja \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_BUILD_TYPE=None
cmake --build out
cd ..
echo "=> Building OP-TEE OS"
rm -rf $osdir/out
# OP-TEE can't tell when we're not cross compiling...
make -C "$osdir" PLATFORM=qcom-qcm6490 CROSS_COMPILE64=
# Now we can build the tests lol
echo "=> Building OP-TEE test"
cd "$testdir"
# rm -rf build
cmake -B build -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=None \
-DCFG_TEE_CLIENT_LOG_FILE=/var/log/tee/teec.log \
-DBUILD_SHARED_LIBS=ON \
-DOPTEE_TEST_SDK="$osdir"/out/arm-plat-qcom/export-ta_arm64
cmake --build build
# $(foreach f,$(wildcard $(@D)/ta/*_lib/Makefile) $(wildcard $(@D)/ta/*/Makefile), \
# $(TARGET_CONFIGURE_OPTS) \
# $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \
# TA_DEV_KIT_DIR=$(OPTEE_OS_SDK) \
# -C $(dir $f) all
# )
make TA_DEV_KIT_DIR="$osdir"/out/arm-plat-qcom/export-ta_arm64 ta test_plugin
}
package() {
cd "$testdir"
DESTDIR="$pkgdir" cmake --install build
mkdir $pkgdir/usr/lib/optee_armtz
find out -name "*.ta" -exec cp {} $pkgdir/usr/lib/optee_armtz \;
find build/host/supp_plugin -name "*.plugin" -exec cp {} $pkgdir/usr/lib/tee-supplicant/plugins/ \;
}
sha512sums="
d49e472e362b667cf99c9d911f50ddc0548f662776f4c91bddcbbef092c67e6b0c21c931344ad7c0a420742a6860a3482a586a457e241716f84b2a1e32c97fcc optee_os-8568a733313b9a6199ef6222339780f45390bae9.tar.gz
d85ef64b7c422479c52ba2cfecd64ddaac97b15b8c3b5597bedbe433251a500fa2a43609207db611f8976b6dafb191f59fa0909df9e982ddb868b1d406f2afaf optee_client-6486773583b5983af8250a47cf07eca938e0e422.tar.gz
b8db64afbdb06ecaa78a0a72f8626f5b3d2a6319b403640fe3eb02881bde3e8c262f27a6c8ba15daa9ecc437e9c709d716c10751c9dac06e1ebb115d53814c37 optee_test-4.4.0.tar.gz
d35ca254a3d287e8d1883d25aadc9603517f65100617c821f64b48e50c003f09d58c692b9757ce64b13c8c5e18661a637772a99569db0e9daf339542596b54a4 fix-build.patch
"
+23
View File
@@ -0,0 +1,23 @@
diff --git a/host/xtest/regression_1000.c b/host/xtest/regression_1000.c
index 9981d01a768f..c8da5bcd5493 100644
--- a/host/xtest/regression_1000.c
+++ b/host/xtest/regression_1000.c
@@ -2035,12 +2035,14 @@ static void xtest_tee_test_1025(ADBG_Case_t *c)
TEEC_RegisterSharedMemory(&xtest_teec_ctx, &shm));
Do_ADBG_EndSubCase(c, "Invalid NULL buffer memref registration");
- if (!xtest_teec_ctx.imp.memref_null) {
- Do_ADBG_Log("Skip subcases: MEMREF_NULL capability not supported");
- return;
- }
+ // if (!xtest_teec_ctx.imp.memref_null) {
+ // Do_ADBG_Log("Skip subcases: MEMREF_NULL capability not supported");
+ // return;
+ // }
+
+ return;
if (!ADBG_EXPECT_TEEC_SUCCESS(c,
xtest_teec_open_session(&session,
&os_test_ta_uuid,