From patchwork Fri Nov 23 18:09:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1002497 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="I/Jaie4Y"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 431kpw53wYz9s0t for ; Sat, 24 Nov 2018 05:09:28 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id AF53F220DA; Fri, 23 Nov 2018 18:09:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NjBUsX0diWLs; Fri, 23 Nov 2018 18:09:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 2F52E220DD; Fri, 23 Nov 2018 18:09:22 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 4D8261BF2C1 for ; Fri, 23 Nov 2018 18:09:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4AEFE220FD for ; Fri, 23 Nov 2018 18:09:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oUjteZ9AqBEk for ; Fri, 23 Nov 2018 18:09:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by silver.osuosl.org (Postfix) with ESMTPS id E52FF220DA for ; Fri, 23 Nov 2018 18:09:18 +0000 (UTC) Received: by mail-wr1-f51.google.com with SMTP id t27so5189160wra.6 for ; Fri, 23 Nov 2018 10:09:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eTUWwnEo7G40GIixQOE0mcOLQ1MSmmvM79oxT8y5sSM=; b=I/Jaie4YLFScztWFj8ufYY9HVdjYgY5U+lfoBTdZkMh1S0Q4pu1CXXRxkaMu5YSLe4 CVfPSXesD0GZZw5CSdk8TQVFiSzYrjSFYgDTXckeqKGS59aCtkqK3Rz3xwvfh/21EriZ aKDLgNB0h6mll9KVaJsRYMIy1hKHv9Nv+osis= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eTUWwnEo7G40GIixQOE0mcOLQ1MSmmvM79oxT8y5sSM=; b=LfS0bbjq20E9+sLPdiAeoJvuubFGRsKMs3HiNgOWin4tjKkTMkrdB0Uv8esGE4Bm3H gaWDsfa8wU0/IJQTpsLFm1sxJa2Cm32sV6jWiZlN6BdacRHXJTpres31+hoGs4o90iKx AkgGWGi/4ZTdrGMQ7FrEoAA07MnQppme2m/C5BtUsCB/vfL+L4htlEnSr3c1i4F6CFJs wygt7+PNI8IjiBkOduLBXsQqxnJpORDFxto7jo6YUt7p+SssB/utg0bag+ESVAzSjL1x oq6Dbgbs8KQbUIe1AQMVxB3vFpxsYTsLi70HdTPXRYGjreojtOvA75Td4wgzGWyB2z5T /MwA== X-Gm-Message-State: AA+aEWa/D5gWlTqfmtJbM1o6nCB5Gf0yS8G5VjbTXTqrg0XyaidB7FLh bthAVR3QS5sd/pO/+WyH30Ms/ccTKO0= X-Google-Smtp-Source: AFSGD/USEZ4AtI0BSU4+mryEupO/tMx7oS881WyerbTB3p7NLub37GXd/fNrgs8mIwDMnQjL/JwsHQ== X-Received: by 2002:a5d:5182:: with SMTP id k2mr14803694wrv.121.1542996557007; Fri, 23 Nov 2018 10:09:17 -0800 (PST) Received: from lmenx29q.home (anantes-657-1-2-18.w81-50.abo.wanadoo.fr. [81.50.65.18]) by smtp.gmail.com with ESMTPSA id n9sm27341921wrx.80.2018.11.23.10.09.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Nov 2018 10:09:16 -0800 (PST) From: Etienne Carriere To: buildroot@buildroot.org Date: Fri, 23 Nov 2018 19:09:07 +0100 Message-Id: <1542996547-5003-1-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542900177-17343-1-git-send-email-etienne.carriere@linaro.org> References: <1542900177-17343-1-git-send-email-etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH v2 1/5] boot/optee-os: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Etienne Carriere MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" OP-TEE OS is maintained by the OP-TEE project. It provides an open source solution for development and integration of secure services for Armv7-A and Armv8-A CPU based platforms supporting the TrustZone technology. This technology enables CPUs to concurrently host a secure world as the OP-TEE OS and a non-secure world as a Linux based OS. The OP-TEE project maintains other packages to leverage OP-TEE on Linux kernel based OSes. An OP-TEE interface driver is available in the Linux kernel since 4.12 upon CONFIG_OPTEE. https://www.op-tee.org/ https://github.com/OP-TEE/optee_os Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - Replace dependency on BR2_arm with BR2_ARM_CPU_ARMV7 as BR2_arm is enabled for non Armv7 targets. - Correct build dependencies on OpenSSL and pycrypto. Remove patch on package python scripts since pycrypto dependency is now handled. - Correct location of in-tree services TAs (s/ta_services/ta/). Remvoe OPTEE_OS_BUILD_SERVICES as service TAs are already built built when OP-TEE OS core is built. Correct BR2_TARGET_OPTEE_OS_SERVICES options: it only installs the - Fix bad reference in Config.in package description. - Fix wrong hash for the optee-os v3.3.0 tarball. - Fix bad use of OPTEE_OS_VERSION where it is the value content that is expected: $(OPTEE_OS_VERSION). - Clarify output build directory name: use out/. - Minor replace use if/endif with use of depends on in Config.mk. - Add missing dependency of BR2_TARGET_OPTEE_OS_SERVICES on BR2_TARGET_OPTEE_OS_SDK. - Change commit header comment to "boot/optee-os: new package". --- boot/Config.in | 1 + boot/optee-os/Config.in | 100 +++++++++++++++++++++++++++++++++++++++++++ boot/optee-os/optee-os.hash | 4 ++ boot/optee-os/optee-os.mk | 101 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 206 insertions(+) create mode 100644 boot/optee-os/Config.in create mode 100644 boot/optee-os/optee-os.hash create mode 100644 boot/optee-os/optee-os.mk diff --git a/boot/Config.in b/boot/Config.in index 8e0c8e5..cd14731 100644 --- a/boot/Config.in +++ b/boot/Config.in @@ -13,6 +13,7 @@ source "boot/gummiboot/Config.in" source "boot/lpc32xxcdl/Config.in" source "boot/mv-ddr-marvell/Config.in" source "boot/mxs-bootlets/Config.in" +source "boot/optee-os/Config.in" source "boot/riscv-pk/Config.in" source "boot/s500-bootloader/Config.in" source "boot/syslinux/Config.in" diff --git a/boot/optee-os/Config.in b/boot/optee-os/Config.in new file mode 100644 index 0000000..7a598c6 --- /dev/null +++ b/boot/optee-os/Config.in @@ -0,0 +1,100 @@ +config BR2_TARGET_OPTEE_OS + bool "optee_os" + depends on BR2_aarch64 || BR2_ARM_CPU_ARMV7A + help + OP-TEE OS provides the secure world boot image and the trust + application development kit of the OP-TEE project. OP-TEE OS + also provides generic trusted application one can embedded + into its system. + + http://github.com/OP-TEE/optee_os + +if BR2_TARGET_OPTEE_OS + +choice + prompt "OP-TEE OS version" + default BR2_TARGET_OPTEE_OS_LATEST + help + Select the version of OP-TEE OS you want to use + +config BR2_TARGET_OPTEE_OS_LATEST + bool "sync with latest registered release tag" + help + This fetches the latest registered release tag from + the OP-TEE OS official Git repository. + +config BR2_TARGET_OPTEE_OS_CUSTOM_GIT + bool "sync on custom OP-TEE OS Git repository" + help + Sync with a specific OP-TEE Git repository. + +endchoice + +config BR2_TARGET_OPTEE_OS_VERSION + string + default "3.3.0" if BR2_TARGET_OPTEE_OS_LATEST + default BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION \ + if BR2_TARGET_OPTEE_OS_CUSTOM_GIT + +config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL + string "sourcetree-site" + depends on BR2_TARGET_OPTEE_OS_CUSTOM_GIT + help + Specific location of the reference source tree Git + repository. + +config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION + string "git reference to pull" + depends on BR2_TARGET_OPTEE_OS_CUSTOM_GIT + help + Reference in the target git repository to sync with. + +# Building core, TA libraries/devkit and/or generic TA services + +config BR2_TARGET_OPTEE_OS_CORE + bool "Build core" + default y + help + This option will build and install the OP-TEE core + boot images. + +config BR2_TARGET_OPTEE_OS_SDK + bool "Build TA devkit" + default y + help + This option will build and install the OP-TEE development + kit for building OP-TEE trusted application images. It is + installed in the staging filetree in /lib/optee directory. + +config BR2_TARGET_OPTEE_OS_SERVICES + bool "Build service TAs" + depends on BR2_TARGET_OPTEE_OS_SDK + default y + help + This option install the generic trusted applications built + from OP-TEE OS source tree. These are installed in the target + /lib/optee_armtz directory. At runtime OP-TEE OS can load + trusted applications from a non secure filesystem into the + secure world for execution. + +# Building TA libraries and/or core images require target platform info + +config BR2_TARGET_OPTEE_OS_PLATFORM + string "mandatory target PLATFORM" + help + Value for the mandated PLATFORM build directive provided to + OP-TEE OS. + +config BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR + string "optional target PLATFORM_FLAVOR" + help + Value for the optional PLATFORM_FLAVOR build directive + provided to OP-TEE OS. + +config BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES + string "Additional OP-TEE OS build variables" + help + Additional parameters for the OP-TEE OS build + E.g. 'CFG_TEE_CORE_LOG_LEVEL=3 CFG_UNWIND=y' + +endif # BR2_TARGET_OPTEE_OS diff --git a/boot/optee-os/optee-os.hash b/boot/optee-os/optee-os.hash new file mode 100644 index 0000000..02828a3 --- /dev/null +++ b/boot/optee-os/optee-os.hash @@ -0,0 +1,4 @@ +# From https://github.com/OP-TEE/optee_os/archive/3.3.0.tar.gz +sha256 7b62e9fe650e197473eb2f4dc35c09d1e6395eb48dc1c16cc139d401b359ac6f optee-os-3.3.0.tar.gz +# Locally computed +sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f LICENSE diff --git a/boot/optee-os/optee-os.mk b/boot/optee-os/optee-os.mk new file mode 100644 index 0000000..14ad143 --- /dev/null +++ b/boot/optee-os/optee-os.mk @@ -0,0 +1,101 @@ +################################################################################ +# +# optee-os +# +################################################################################ + +OPTEE_OS_VERSION = $(call qstrip,$(BR2_TARGET_OPTEE_OS_VERSION)) +OPTEE_OS_LICENSE = BSD-2-Clause +OPTEE_OS_LICENSE_FILES = LICENSE + +ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_GIT),y) +OPTEE_OS_SITE = $(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL)) +OPTEE_OS_SITE_METHOD = git +BR_NO_CHECK_HASH_FOR += $(OPTEE_OS_SOURCE) +else +OPTEE_OS_SITE = $(call github,OP-TEE,optee_os,$(OPTEE_OS_VERSION)) +endif + +OPTEE_OS_DEPENDENCIES = openssl host-python-pycrypto + +# On 64bit targets, OP-TEE OS can be built in 32bit mode, or +# can be built in 64bit mode and support 32bit and 64bit +# trusted applications. Since buildroot currently references +# a single cross compiler, build exclusively in 32bit +# or 64bit mode. +OPTEE_OS_MAKE_OPTS = CROSS_COMPILE="$(TARGET_CROSS)" +OPTEE_OS_MAKE_OPTS += CROSS_COMPILE_core="$(TARGET_CROSS)" +ifeq ($(BR2_aarch64),y) +OPTEE_OS_MAKE_OPTS += CROSS_COMPILE_ta_arm64="$(TARGET_CROSS)" +endif +ifeq ($(BR2_arm),y) +OPTEE_OS_MAKE_OPTS += CROSS_COMPILE_ta_arm32="$(TARGET_CROSS)" +endif + +# Get mandatory PLAFORM and optional PLATFORM_FLAVOR +OPTEE_OS_MAKE_OPTS += PLATFORM=$(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM)) +ifneq ($(BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR),) +OPTEE_OS_MAKE_OPTS += PLATFORM_FLAVOR=$(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR)) +endif +OPTEE_OS_MAKE_OPTS += $(call qstrip,$(BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES)) + +# Requests OP-TEE OS to build from subdirectory out/ of its synced sourcetree root path +# otherwise the output directory path depends on the target platform name. +OPTEE_OS_BUILDDIR_OUT = out + +ifeq ($(BR2_aarch64),y) +OPTEE_OS_LOCAL_SDK = $(OPTEE_OS_BUILDDIR_OUT)/export-ta_arm64 +endif +ifeq ($(BR2_arm),y) +OPTEE_OS_LOCAL_SDK = $(OPTEE_OS_BUILDDIR_OUT)/export-ta_arm32 +endif + +ifeq ($(BR2_TARGET_OPTEE_OS_CORE),y) +define OPTEE_OS_BUILD_CORE + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) O=$(OPTEE_OS_BUILDDIR_OUT) \ + $(TARGET_CONFIGURE_OPTS) $(OPTEE_OS_MAKE_OPTS) all +endef +define OPTEE_OS_INSTALL_CORE + mkdir -p $(BINARIES_DIR) + cp -dpf $(@D)/$(OPTEE_OS_BUILDDIR_OUT)/core/tee.bin $(BINARIES_DIR) + cp -dpf $(@D)/$(OPTEE_OS_BUILDDIR_OUT)/core/tee-*_v2.bin $(BINARIES_DIR) +endef +endif + +ifeq ($(BR2_TARGET_OPTEE_OS_SDK),y) +define OPTEE_OS_BUILD_SDK + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) O=$(OPTEE_OS_BUILDDIR_OUT) \ + $(TARGET_CONFIGURE_OPTS) $(OPTEE_OS_MAKE_OPTS) ta_dev_kit +endef +define OPTEE_OS_INSTALL_SDK + mkdir -p $(STAGING_DIR)/lib/optee + cp -ardpf $(@D)/$(OPTEE_OS_LOCAL_SDK) $(STAGING_DIR)/lib/optee +endef +endif + +ifeq ($(BR2_TARGET_OPTEE_OS_SERVICES),y) +# Core build already generates the TA services binaries. Install them. +define OPTEE_OS_INSTALL_SERVICES + mkdir -p $(TARGET_DIR)/lib/optee_armtz + $(foreach f,$(wildcard $(@D)/ta/*/$(OPTEE_OS_BUILDDIR_OUT)/*.ta), \ + $(INSTALL) -v -p --mode=444 \ + --target-directory=$(TARGET_DIR)/lib/optee_armtz \ + $f &&) true +endef +endif + +define OPTEE_OS_BUILD_CMDS + $(OPTEE_OS_BUILD_CORE) + $(OPTEE_OS_BUILD_SDK) +endef + +define OPTEE_OS_INSTALL_IMAGES_CMDS + $(OPTEE_OS_INSTALL_CORE) + $(OPTEE_OS_INSTALL_SDK) + $(OPTEE_OS_INSTALL_SERVICES) +endef + +OPTEE_OS_INSTALL_STAGING = YES +OPTEE_OS_INSTALL_IMAGES = YES + +$(eval $(generic-package)) From patchwork Fri Nov 23 18:10:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1002498 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="kIliaMIZ"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 431kqw0pqsz9s3C for ; Sat, 24 Nov 2018 05:10:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6C0CD220DA; Fri, 23 Nov 2018 18:10:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id omijKBK-7vfP; Fri, 23 Nov 2018 18:10:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id EACEA220DD; Fri, 23 Nov 2018 18:10:16 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id C80981BF4D5 for ; Fri, 23 Nov 2018 18:10:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C50CC876DA for ; Fri, 23 Nov 2018 18:10:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Eg9cCBsdZCFs for ; Fri, 23 Nov 2018 18:10:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 968B9876D7 for ; Fri, 23 Nov 2018 18:10:14 +0000 (UTC) Received: by mail-wr1-f52.google.com with SMTP id r10so13124484wrs.10 for ; Fri, 23 Nov 2018 10:10:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/D0D3XaQU4BaT73cTU3Hxays3uWGaHXzMZL5Gn0n3/k=; b=kIliaMIZoS1ipcisWN9Bdubc3EctsJBd73liREOmeZqghN83vjWl9f7gwsmja8LHDN i3FffWYO10SRm8XI31SsC5d00ZjL4g8zacJd6X6Jx4esHUaLr6/JXaTSOynS0VVdTrsw jsQHBy6GlpGe0jwS1zftMQEMENgFPpfYoxyGo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/D0D3XaQU4BaT73cTU3Hxays3uWGaHXzMZL5Gn0n3/k=; b=BqdeFv7Q2EgCXKrKDYD/M8XjRcQOuLlBlJpaI4ICvX2d5K3/w10x0rIpZq4jEQNQa8 pHLuT3tVfnpkH+MjDyaZePKCc/eed/kNQ2boE+bZqRkTbU1FfxTghc56uobaZDciliZt gsBPqPbt6xRR/UCeUX4OCN+8gEP6JVFYIYblE3p5CSSIpwyNqZ+kO6O9Q5a3ish97HXB 6Vuq4kLvbFLkOC2edfDw6BLZXIFN/SQQuwLlfDYTKbptQOk0JfwrCTBqrgMzQ+u1LhXs qfWoZYblbvNbSL9bYdG7zPSbW8pLKUF242l/I00UJ9IH8NuNNT6xxUoRUHndyijfuRMQ mT8Q== X-Gm-Message-State: AA+aEWapBY5i2jK2FV/1BeutHNavpzMiJmoUSOSwsS2/nosJbW//ep4i LtkfnAyKOd5uZZ8vHNv6q8O/nTC+X0k= X-Google-Smtp-Source: AFSGD/XU7jENHV2yEHGSCTyT/wn+OXq4YwTl8mGystTNeVGW7dOKOPXIhRNiIQwsmIdwrlDWSzZFAg== X-Received: by 2002:adf:f38f:: with SMTP id m15mr14915623wro.111.1542996612800; Fri, 23 Nov 2018 10:10:12 -0800 (PST) Received: from lmenx29q.home (anantes-657-1-2-18.w81-50.abo.wanadoo.fr. [81.50.65.18]) by smtp.gmail.com with ESMTPSA id y81-v6sm5721905wmd.11.2018.11.23.10.10.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Nov 2018 10:10:12 -0800 (PST) From: Etienne Carriere To: buildroot@buildroot.org Date: Fri, 23 Nov 2018 19:10:02 +0100 Message-Id: <1542996602-5106-1-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542900177-17343-2-git-send-email-etienne.carriere@linaro.org> References: <1542900177-17343-2-git-send-email-etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH v2 2/5] optee-client: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Etienne Carriere MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" OP-TEE client API library and supplicant daemon from the OP-TEE project. The package is added to the Security menu of BR configuration. Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - Add option BR2_PACKAGE_OPTEE_CLIENT_SYNCED_VERSION to ensure OP-TEE client version is synced with OP-TEE OS version when the later if enabled. - Remove useless OPTEE_CLIENT_INSTALL_IMAGE=YES. --- package/Config.in | 1 + package/optee-client/Config.in | 73 ++++++++++++++++++++++++++++++++++ package/optee-client/S30optee | 26 ++++++++++++ package/optee-client/optee-client.hash | 4 ++ package/optee-client/optee-client.mk | 30 ++++++++++++++ 5 files changed, 134 insertions(+) create mode 100644 package/optee-client/Config.in create mode 100644 package/optee-client/S30optee create mode 100644 package/optee-client/optee-client.hash create mode 100644 package/optee-client/optee-client.mk diff --git a/package/Config.in b/package/Config.in index b60e770..8c3b1bf 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2047,6 +2047,7 @@ endmenu menu "Security" source "package/checkpolicy/Config.in" + source "package/optee-client/Config.in" source "package/paxtest/Config.in" source "package/policycoreutils/Config.in" source "package/refpolicy/Config.in" diff --git a/package/optee-client/Config.in b/package/optee-client/Config.in new file mode 100644 index 0000000..cff452b --- /dev/null +++ b/package/optee-client/Config.in @@ -0,0 +1,73 @@ +config BR2_PACKAGE_OPTEE_CLIENT + bool "Embed OP-TEE client" + help + Enable the OP-TEE client package that brings non-secure + client application resources for OP-TEE support. OP-TEE + client is a component delivered by the OP-TEE project. + + https://github.com/OP-TEE/optee_client + + The client API library allows application to invoke + trusted applications hosted in the OP-TEE OS secure world. + The supplicant provides services hosted by the non-secure + world and invoked by the secure world. + +if BR2_PACKAGE_OPTEE_CLIENT + +choice + prompt "OP-TEE client version" + default BR2_PACKAGE_OPTEE_CLIENT_LATEST + help + Select the version of OP-TEE client you want to use + +config BR2_PACKAGE_OPTEE_CLIENT_LATEST + bool "sync with latest registered release tag" + help + Sync on latest release tag. This currently fetches the + latest registered release tag from the OP-TEE official + Git repository. + +config BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_GIT + bool "sync with a specific Git" + help + Sync with a specific OP-TEE Git repository. + +endchoice + +config BR2_PACKAGE_OPTEE_CLIENT_SYNCED_VERSION + bool "use same version ref for OP-TEE components" + depends on BR2_PACKAGE_OPTEE_CLIENT_LATEST + default true + help + When enabled, OP-TEE client version must match the version + set for the other OP-TEE components. + +config BR2_PACKAGE_OPTEE_CLIENT_VERSION + string + default BR2_TARGET_OPTEE_OS_VERSION \ + if BR2_PACKAGE_OPTEE_CLIENT_SYNCED_VERSION && \ + BR2_TARGET_OPTEE_OS + default "3.3.0" if BR2_PACKAGE_OPTEE_CLIENT_LATEST + default BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_REPO_VERSION \ + if BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_GIT + help + Reference in the target Git repository to sync with. + +if BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_GIT + +config BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_REPO_URL + string "Git repository site" + help + Specific location of the reference source tree Git + repository. + +config BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_REPO_VERSION + string "target reference to pull in the Git repository" + help + Package version reference to sync with. As source file + reference is a Git repository, the version reference can + be any Git reference as a tag or a sha1. + +endif + +endif #BR2_PACKAGE_OPTEE_CLIENT diff --git a/package/optee-client/S30optee b/package/optee-client/S30optee new file mode 100644 index 0000000..c893243 --- /dev/null +++ b/package/optee-client/S30optee @@ -0,0 +1,26 @@ +#!/bin/sh +# +# /etc/init.d/optee +# +# Start/stop tee-supplicant (OP-TEE normal world daemon) +# +case "$1" in + start) + if [ -e /usr/sbin/tee-supplicant -a -e /dev/teepriv0 ]; then + echo "Starting tee-supplicant..." + /usr/sbin/tee-supplicant & + exit 0 + else + echo "tee-supplicant or TEE device not found" + exit 1 + fi + + ;; + stop) + killall tee-supplicant + ;; + status) + cat /dev/teepriv0 2>&1 | grep -q "Device or resource busy" || not="not " + echo "tee-supplicant is ${not}active" + ;; +esac diff --git a/package/optee-client/optee-client.hash b/package/optee-client/optee-client.hash new file mode 100644 index 0000000..ed7bf4e --- /dev/null +++ b/package/optee-client/optee-client.hash @@ -0,0 +1,4 @@ +# From https://github.com/OP-TEE/optee_client/archive/3.3.0.tar.gz +sha256 63af1567fdcdbe28b45be274266a89aa81bef3d0fd8ec5a6eb680046a92e1177 optee-client-3.3.0.tar.gz +# Locally computed +sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f LICENSE diff --git a/package/optee-client/optee-client.mk b/package/optee-client/optee-client.mk new file mode 100644 index 0000000..ccc5d12 --- /dev/null +++ b/package/optee-client/optee-client.mk @@ -0,0 +1,30 @@ +################################################################################ +# +# optee-client +# +################################################################################ + +OPTEE_CLIENT_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_VERSION)) +OPTEE_CLIENT_LICENSE = BSD-3-Clause +OPTEE_CLIENT_LICENSE_FILES = LICENSE + +ifeq ($(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_GIT),y) +OPTEE_CLIENT_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_REPO_URL)) +OPTEE_CLIENT_SITE_METHOD = git +BR_NO_CHECK_HASH_FOR += $(OPTEE_CLIENT_SOURCE) +else +OPTEE_CLIENT_SITE = $(call github,OP-TEE,optee_client,$(OPTEE_CLIENT_VERSION)) +endif + +define OPTEE_CLIENT_INSTALL_SUPPLICANT_SCRIPT + $(INSTALL) -m 0755 -D $(OPTEE_CLIENT_PKGDIR)/S30optee \ + $(TARGET_DIR)/etc/init.d/S30optee +endef + +define OPTEE_CLIENT_INSTALL_INIT_SYSV + $(OPTEE_CLIENT_INSTALL_SUPPLICANT_SCRIPT) +endef + +OPTEE_CLIENT_INSTALL_STAGING = YES + +$(eval $(cmake-package)) From patchwork Fri Nov 23 18:10:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1002499 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ROoRofVh"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 431krg6yWTz9s0t for ; Sat, 24 Nov 2018 05:10:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2B357876D7; Fri, 23 Nov 2018 18:10:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1d3moS-1Sulp; Fri, 23 Nov 2018 18:10:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id AFF2A876DA; Fri, 23 Nov 2018 18:10:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id A37FB1BF4D5 for ; Fri, 23 Nov 2018 18:10:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A013B888D6 for ; Fri, 23 Nov 2018 18:10:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tsb49fb8D5Y5 for ; Fri, 23 Nov 2018 18:10:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by whitealder.osuosl.org (Postfix) with ESMTPS id 26A4788828 for ; Fri, 23 Nov 2018 18:10:52 +0000 (UTC) Received: by mail-wm1-f47.google.com with SMTP id k198so12798411wmd.3 for ; Fri, 23 Nov 2018 10:10:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RnWgXhUIIGnc/OrP1KkZ7jWh34YRoB4/dylvByWnZQ8=; b=ROoRofVhMvBLDj6w4/uV5C77q9RUMXbC5UAaK8x0hIKqzPbe9jHbBAaiJAYYOqPx7o T9ssTZkukjW0svUZMeoqXz3jeb4GvY3t3VwC+rSYIO4Okv3KDgk1nO/ETJLiyGzn2P0j kNIdKs+4mKAF2bA32QihND+RVbO01dlOv6LXA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RnWgXhUIIGnc/OrP1KkZ7jWh34YRoB4/dylvByWnZQ8=; b=ukuF8tOx7a5zOtxZ4vw8bZ49WJqUlVMpm+V77ZZ+HlxDW6Of0yLubbCqBrS+SXib9g lb6XSqYf0aCf5di0m0FJp2aaoTvqWlY1BPwgSBm8i3JD3fKotvFdsC1dH99A/ksVk5NZ W38O2jKsDb/BKRXgXj1ncPQFiIOhtcpBWJ3IbVWohUrdMwrq9Aok/r9D9N/oLSXCSZo5 wSBESJnVxnBoYLtlHf0UquUlQsGyz6K/CBmFpIvxjip9nusa9vFm/zcacKtV/y+30MSY mbkztpMHQ3jWkVL6DyAXyFTzOoInrJSbp4JugoRaQGKokcjpQaLeABUomQmpERNnrQCF dbbw== X-Gm-Message-State: AA+aEWaBjiPwMp36IyEtkZ0zddkW7RMA03mfU3gLGAc5Ei5DA4H23iqN NN0sgYDdASvL+n1I0M/Or13p8AamVDY= X-Google-Smtp-Source: AFSGD/XPckOsHZ3zy/8Rkv2mpsz04GAjHj2f6HPF5oeitFGVaMN329KVCNVndxfkEE/8JW+EipMsjg== X-Received: by 2002:a1c:cf82:: with SMTP id f124mr7578541wmg.95.1542996650448; Fri, 23 Nov 2018 10:10:50 -0800 (PST) Received: from lmenx29q.home (anantes-657-1-2-18.w81-50.abo.wanadoo.fr. [81.50.65.18]) by smtp.gmail.com with ESMTPSA id a1sm31284528wrw.76.2018.11.23.10.10.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Nov 2018 10:10:49 -0800 (PST) From: Etienne Carriere To: buildroot@buildroot.org Date: Fri, 23 Nov 2018 19:10:44 +0100 Message-Id: <1542996644-5221-1-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542900177-17343-3-git-send-email-etienne.carriere@linaro.org> References: <1542900177-17343-3-git-send-email-etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH v2 3/5] optee-benchmark: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Etienne Carriere MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" OP-TEE performance benchmark tools for the OP-TEE project. This packages generates embedded Linux based OS materials used to retrieve execution timing information on invocation of the OP-TEE secure services. It is added next to the OP-TEE client package in BR configuration. Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - Add dependency on OP-TEE client. - Add option BR2_PACKAGE_OPTEE_BENCHMARK_SYNCED_VERSION to ensure OP-TEE benchmark version is synced with OP-TEE client version. - Remove useless OPTEE_BENCHMARK_INSTALL_STAGING and OPTEE_BENCHMARK_INSTALL_IMAGES. - Remove unused BR2_PACKAGE_OPTEE_BENCHMARK_GIT_REFERENCE. - Remove useless _INSTALL_STAGING/_INSTALL_IMAGES=YES. --- package/Config.in | 1 + package/optee-benchmark/Config.in | 69 ++++++++++++++++++++++++++++ package/optee-benchmark/optee-benchmark.hash | 2 + package/optee-benchmark/optee-benchmark.mk | 22 +++++++++ 4 files changed, 94 insertions(+) create mode 100644 package/optee-benchmark/Config.in create mode 100644 package/optee-benchmark/optee-benchmark.hash create mode 100644 package/optee-benchmark/optee-benchmark.mk diff --git a/package/Config.in b/package/Config.in index 8c3b1bf..38200af 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2047,6 +2047,7 @@ endmenu menu "Security" source "package/checkpolicy/Config.in" + source "package/optee-benchmark/Config.in" source "package/optee-client/Config.in" source "package/paxtest/Config.in" source "package/policycoreutils/Config.in" diff --git a/package/optee-benchmark/Config.in b/package/optee-benchmark/Config.in new file mode 100644 index 0000000..2d56a7e --- /dev/null +++ b/package/optee-benchmark/Config.in @@ -0,0 +1,69 @@ +config BR2_PACKAGE_OPTEE_BENCHMARK + bool "Embed OP-TEE benchmark support" + select BR2_PACKAGE_OPTEE_CLIENT + select BR2_PACKAGE_LIBYAML + help + Enable the OP-TEE benchmark package that brings facilities + for profiling traversal and execution timings when + invoking OP-TEE. OP-TEE benchmark is a component delivered + by the OP-TEE project. + + http://github.com/linaro-swg/optee_benchmark + +if BR2_PACKAGE_OPTEE_BENCHMARK + +choice + prompt "OP-TEE Benchmark version" + default BR2_PACKAGE_OPTEE_BENCHMARK_LATEST + help + Select the version of OP-TEE benchmark you want to use + +config BR2_PACKAGE_OPTEE_BENCHMARK_LATEST + bool "sync with latest release tag" + help + Sync on latest release tag. This currently fetches the + latest registered release tag from the OP-TEE official + Git repository. + +config BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_GIT + bool "sync with a specific Git" + help + Sync with a specific OP-TEE Git repository. + +endchoice + +config BR2_PACKAGE_OPTEE_BENCHMARK_SYNCED_VERSION + bool "use same version ref for OP-TEE components" + depends on BR2_PACKAGE_OPTEE_BENCHMARK_LATEST + default true + help + When enabled package version must match the version set for + OP-TEE client. + +config BR2_PACKAGE_OPTEE_BENCHMARK_VERSION + string + default BR2_PACKAGE_OPTEE_CLIENT_VERSION \ + if BR2_PACKAGE_OPTEE_BENCHMARK_SYNCED_VERSION + default "3.3.0" if BR2_PACKAGE_OPTEE_BENCHMARK_LATEST + default BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_REPO_VERSION \ + if BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_GIT + help + Reference in the target Git repository to sync with. + +if BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_GIT + +config BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_REPO_URL + string "Git repository site" + help + Specific location of the reference source tree Git repository. + +config BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_REPO_VERSION + string "target reference to pull in the Git repository" + help + Package version reference to sync with. As source file + reference is a Git repository, the version reference can be + any Git reference as a tag or a sha1. + +endif + +endif #BR2_PACKAGE_OPTEE_BENCHMARK diff --git a/package/optee-benchmark/optee-benchmark.hash b/package/optee-benchmark/optee-benchmark.hash new file mode 100644 index 0000000..d93c26c --- /dev/null +++ b/package/optee-benchmark/optee-benchmark.hash @@ -0,0 +1,2 @@ +# From https://github.com/linaro-swg/optee_benchmark/archive/3.3.0.tar.gz +sha256 bfba3749ac8b37628550696f0625452ae8aef060eff5b3b1c4283a5dad8a3383 optee-benchmark-3.3.0.tar.gz diff --git a/package/optee-benchmark/optee-benchmark.mk b/package/optee-benchmark/optee-benchmark.mk new file mode 100644 index 0000000..8eef0f6 --- /dev/null +++ b/package/optee-benchmark/optee-benchmark.mk @@ -0,0 +1,22 @@ +################################################################################ +# +# optee-benchmarch +# +################################################################################ + +OPTEE_BENCHMARK_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_BENCHMARK_VERSION)) +OPTEE_BENCHMARK_LICENSE = BSD-2-Clause + +OPTEE_BENCHMARK_DEPENDENCIES = optee-client libyaml + +ifeq ($(BR2_PACKAGE_OPTEE_BENCHMARK_LATEST),y) +OPTEE_BENCHMARK_SITE = $(call github,linaro-swg,optee_benchmark,$(OPTEE_BENCHMARK_VERSION)) +endif + +ifeq ($(BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_GIT),y) +OPTEE_BENCHMARK_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_REPO_URL)) +OPTEE_BENCHMARK_SITE_METHOD = git +BR_NO_CHECK_HASH_FOR += $(OPTEE_BENCHMARK_SOURCE) +endif + +$(eval $(cmake-package)) From patchwork Fri Nov 23 18:11:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1002500 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bY8qp8eU"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 431ksD08K3z9s0t for ; Sat, 24 Nov 2018 05:11:27 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 69BD288828; Fri, 23 Nov 2018 18:11:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TZkG9GvAdk+q; Fri, 23 Nov 2018 18:11:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 342BA888D6; Fri, 23 Nov 2018 18:11:24 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id A2BD91BF4D5 for ; Fri, 23 Nov 2018 18:11:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9EA6F888D6 for ; Fri, 23 Nov 2018 18:11:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pwz-9XL58eEp for ; Fri, 23 Nov 2018 18:11:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by whitealder.osuosl.org (Postfix) with ESMTPS id 61BCF88828 for ; Fri, 23 Nov 2018 18:11:21 +0000 (UTC) Received: by mail-wm1-f51.google.com with SMTP id 125so12716939wmh.0 for ; Fri, 23 Nov 2018 10:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cHLwfoo4SBFCZXRGEPrgMTriGUK9z4W1oT83Cmn2ri4=; b=bY8qp8eUxtpCqSrmA3y6GDWG/PnlfMK0Y2By+gIJght6qAHqCbpJQ7cnlFqYc0C6kH eU+yUS1OyCC7jJJ2rgBsGq/GEFiuTnVIG5GqqgKKdy6/KPcqghBx0tODYgcdMGn4Bh7r /OH1H/nMQX3Kc4dK4lYTGtec6lV23oUnWblu8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cHLwfoo4SBFCZXRGEPrgMTriGUK9z4W1oT83Cmn2ri4=; b=rU2LZE8IKYqYR6NfQUZuK466zfLc0oE0JIn6k69GskXxhzBKKI3xijcNHH5e7ysAhy vz8TvhFtqd6csCqYvtvUIYcjbYsIcKsJYcztJpHNfCy2k7lJ9OfeasDa8YlboSQGu/Sg yPZ7c0P23+S8mgHDpsNnBwfvNFjEVGyvKL6BGzmhiZLC0uPiTUqzqNTw15j7fXz9CStP KUZwr0cIJUBJNJvxDnV9u0etxs07LvGdzqyJl9avF+jttt7Esv6fZhlpttX7f1vW/2IJ iycfMkFGM9Bntl3FCYdDZlgMK9k4dxf6xjcnuXKWp8xUU65zUN+NTI/16lN8Ayz0wg3Z n65A== X-Gm-Message-State: AGRZ1gL7sZbZLC6YHCkPOWjgO3ACHHCBlqqdNpQQ0eIGPbdFB54NdeM2 W/xg0WZ7BriVFBJBI3vntE2UUn85o+g= X-Google-Smtp-Source: AJdET5cSFWlqGkDMKLU0iC5d93/i/tPUSJw/yJrY+5Mp4Fpqhz5qOWe5YAwdGnxFVCLeSwRTpmHb0A== X-Received: by 2002:a1c:be11:: with SMTP id o17mr14464811wmf.111.1542996679657; Fri, 23 Nov 2018 10:11:19 -0800 (PST) Received: from lmenx29q.home (anantes-657-1-2-18.w81-50.abo.wanadoo.fr. [81.50.65.18]) by smtp.gmail.com with ESMTPSA id 6-v6sm8730692wmg.19.2018.11.23.10.11.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Nov 2018 10:11:19 -0800 (PST) From: Etienne Carriere To: buildroot@buildroot.org Date: Fri, 23 Nov 2018 19:11:14 +0100 Message-Id: <1542996674-5306-1-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542900177-17343-4-git-send-email-etienne.carriere@linaro.org> References: <1542900177-17343-4-git-send-email-etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH v2 4/5] optee-examples: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Etienne Carriere MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This package generates embedded Linux based OS userland client applications and OP-TEE OS trusted applications all embedded in the file system. These applications shows how to use the APIs OP-TEE OS is based on, both in the non secure and secure worlds. Package is added next to the OP-TEE client package in the BR package configuration. Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - Replace BR2_arm with BR2_ARM_CPU_ARMV7 as OP-TEE supports only BR2_ARM_CPU_ARMV7 architectures among the 32bit Arm machines. - Select OP-TEE client and add dependency on OP-TEE OS. - Add option BR2_PACKAGE_OPTEE_EXAMPLES_SYNCED_VERSION to ensure OP-TEE examples version is synced with OP-TEE OS version. - Do not force output build directory, rely on native path: out/. - Replace if/endif with depends on in Config.in. - Remove useless OPTEE_EXAMPLES_INSTALL_STAGING=YES. - Add package official URL in Config.in package description. --- package/Config.in | 1 + package/optee-examples/Config.in | 68 ++++++++++++++++++++++++++++++ package/optee-examples/optee-examples.hash | 4 ++ package/optee-examples/optee-examples.mk | 47 +++++++++++++++++++++ 4 files changed, 120 insertions(+) create mode 100644 package/optee-examples/Config.in create mode 100644 package/optee-examples/optee-examples.hash create mode 100644 package/optee-examples/optee-examples.mk diff --git a/package/Config.in b/package/Config.in index 38200af..35870d0 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2049,6 +2049,7 @@ menu "Security" source "package/checkpolicy/Config.in" source "package/optee-benchmark/Config.in" source "package/optee-client/Config.in" + source "package/optee-examples/Config.in" source "package/paxtest/Config.in" source "package/policycoreutils/Config.in" source "package/refpolicy/Config.in" diff --git a/package/optee-examples/Config.in b/package/optee-examples/Config.in new file mode 100644 index 0000000..de16246 --- /dev/null +++ b/package/optee-examples/Config.in @@ -0,0 +1,68 @@ +config BR2_PACKAGE_OPTEE_EXAMPLES + bool "Embed OP-TEE examples" + depends on BR2_aarch64 || BR2_ARM_CPU_ARMV7A + depends on BR2_TARGET_OPTEE_OS + select BR2_PACKAGE_OPTEE_CLIENT + help + Enable the OP-TEE examples package that brings examples of + implementation of OP-TEE non-secure client applications and + secure trusted applications. OP-TEE examples is a + component delivered by the OP-TEE project. + + https://github.com/linaro-swg/optee_examples + +if BR2_PACKAGE_OPTEE_EXAMPLES + +choice + prompt "OP-TEE exmaples version" + default BR2_PACKAGE_OPTEE_EXAMPLES_LATEST + help + Select the version of OP-TEE exmaples you want to use + +config BR2_PACKAGE_OPTEE_EXAMPLES_LATEST + bool "sync with latest release tag" + help + Sync on latest release tag. This currently fetches the + latest registered release tag from the OP-TEE official + Git repository. + +config BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_GIT + bool "sync with a specific Git" + help + Sync with a specific OP-TEE Git repository. + +endchoice + +config BR2_PACKAGE_OPTEE_EXAMPLES_SYNCED_VERSION + bool "use same version ref for OP-TEE components" + depends on BR2_PACKAGE_OPTEE_EXAMPLES_LATEST + help + When enabled package version must match the version set for + OP-TEE OS and client components. + +config BR2_PACKAGE_OPTEE_EXAMPLES_VERSION + string + default BR2_TARGET_OPTEE_OS_VERSION \ + if BR2_PACKAGE_OPTEE_EXAMPLES_SYNCED_VERSION + default "3.3.0" if BR2_PACKAGE_OPTEE_EXAMPLES_LATEST + default BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_REPO_VERSION \ + if BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_GIT + help + Reference in the target Git repository to sync with. + +config BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_REPO_URL + string "Git repository site" + depends on BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_GIT + help + Specific location of the reference source tree Git + repository. + +config BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_REPO_VERSION + string "target reference to pull in the Git repository" + depends on BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_GIT + help + Package version reference to sync with. As source file + reference is a Git repository, the version reference can + be any Git reference as a tag or a sha1. + +endif #BR2_PACKAGE_OPTEE_EXAMPLES diff --git a/package/optee-examples/optee-examples.hash b/package/optee-examples/optee-examples.hash new file mode 100644 index 0000000..77b7466 --- /dev/null +++ b/package/optee-examples/optee-examples.hash @@ -0,0 +1,4 @@ +# From https://github.com/linaro-swg/optee_examples/archive/3.3.0.tar.gz +sha256 504642edd1510562dcc213637d8869190dd581986daf938ed3e85088830e0ef9 optee-examples-3.3.0.tar.gz +# Locally computed +sha256 6f1ef8449cb82ae79d2155605f7985bdf0f08e7ab5007de9b4362e8bf28733b9 LICENSE diff --git a/package/optee-examples/optee-examples.mk b/package/optee-examples/optee-examples.mk new file mode 100644 index 0000000..08b25b2 --- /dev/null +++ b/package/optee-examples/optee-examples.mk @@ -0,0 +1,47 @@ +################################################################################ +# +# optee-examples +# +################################################################################ + +OPTEE_EXAMPLES_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_EXAMPLES_VERSION)) +OPTEE_EXAMPLES_LICENSE = BSD-2-Clause +OPTEE_EXAMPLES_LICENSE_FILES = LICENSE + +ifeq ($(BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_GIT),y) +OPTEE_EXAMPLES_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_REPO_URL)) +OPTEE_EXAMPLES_SITE_METHOD = git +BR_NO_CHECK_HASH_FOR += $(OPTEE_EXAMPLES_SOURCE) +else +OPTEE_EXAMPLES_SITE = $(call github,linaro-swg,optee_examples,$(OPTEE_EXAMPLES_VERSION)) +endif + +OPTEE_EXAMPLES_DEPENDENCIES = optee-client optee-os + +ifeq ($(BR2_aarch64),y) +OPTEE_EXAMPLES_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm64 +endif +ifeq ($(BR2_arm),y) +OPTEE_EXAMPLES_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm32 +endif + +define OPTEE_EXAMPLES_BUILD_TAS + @$(foreach f,$(wildcard $(@D)/*/ta/Makefile), \ + $(TARGET_CONFIGURE_OPTS) \ + $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \ + TA_DEV_KIT_DIR=$(OPTEE_EXAMPLES_SDK) \ + -C $(dir $f) all &&) true +endef + +define OPTEE_EXAMPLES_INSTALL_TAS + @$(foreach f,$(wildcard $(@D)/*/ta/out/*.ta), \ + mkdir -p $(TARGET_DIR)/lib/optee_armtz && \ + $(INSTALL) -v -p --mode=444 \ + --target-directory=$(TARGET_DIR)/lib/optee_armtz $f \ + &&) true +endef + +OPTEE_EXAMPLES_POST_BUILD_HOOKS += OPTEE_EXAMPLES_BUILD_TAS +OPTEE_EXAMPLES_POST_INSTALL_TARGET_HOOKS += OPTEE_EXAMPLES_INSTALL_TAS + +$(eval $(cmake-package)) From patchwork Fri Nov 23 18:11:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1002501 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="TCA6ia6P"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 431ksX4z1Pz9s3C for ; Sat, 24 Nov 2018 05:11:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2E9C687B6C; Fri, 23 Nov 2018 18:11:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lGgy1_Ouwc5v; Fri, 23 Nov 2018 18:11:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 306B2876E2; Fri, 23 Nov 2018 18:11:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id BA6261BF4D5 for ; Fri, 23 Nov 2018 18:11:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B7A85847CD for ; Fri, 23 Nov 2018 18:11:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 70s8mP44Ah0I for ; Fri, 23 Nov 2018 18:11:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by hemlock.osuosl.org (Postfix) with ESMTPS id 7B0DC83CBF for ; Fri, 23 Nov 2018 18:11:36 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id r10so13127686wrs.10 for ; Fri, 23 Nov 2018 10:11:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6zZdqd2sFH+yFjXPWekffZQyl39XYUdKKRtS62hl40I=; b=TCA6ia6PCV5MYXAbCFWTuPozvcQiS5YDV1zM1W6kXPUmxu086KtxX54mP7wRj3lFhc 6ToaoHtWet9Gct3VLEsly4B2oIVKPlnHLuzEb3OZw4NZ2F/KGTnpjDmbToBZLdn1QKJP yqZSSlC/XFYefTs1nT2ycnPS+mhBCRnh792n8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6zZdqd2sFH+yFjXPWekffZQyl39XYUdKKRtS62hl40I=; b=q7HquXz6tsSWboWRyHdo73eqzrOXbnQmUTMxiXJw1kJbGozZB32bvkWQFPT8pVvkPX kpY2dcDZ2pVIOVMUqew4gOoefuDM9TAkMtEg2xXcdtPlrtPqM4fLrOw2BWEJentb8MzE aqGHNGRiw28eKTyCpTyUt9T+gte3XbnrjLt3yymfmOPHcN4I+0/9WLjLnDhGKQZzFpb0 vxpdcZSNTKXEQXHSrZqiFPLtrmthGkB0VDcmhgRW9JfnHDVhoGXEucsNUgDkZxWYamTU 7se+LRLBeN0X6toqekv3V661gUJI5xHvRpB6YWbVrJCo0KBPvqDK9UHZYuZz5mrx9uQY WeFw== X-Gm-Message-State: AA+aEWZphJF5O5nkVF8KLT9QXos8IHx4P7t0uO+xTrfZ4FbVmHS9XsN8 geYnMNNczotkaC663XfRdl1GvhLJBF0= X-Google-Smtp-Source: AFSGD/WmITZeUP/ftdvUaVvVjos7vTkLP1DfirxGx8j9ctcVCQlDLl+Vg18AIwSl9eLidK5b4YxOVA== X-Received: by 2002:adf:84a4:: with SMTP id 33-v6mr15041466wrg.191.1542996694706; Fri, 23 Nov 2018 10:11:34 -0800 (PST) Received: from lmenx29q.home (anantes-657-1-2-18.w81-50.abo.wanadoo.fr. [81.50.65.18]) by smtp.gmail.com with ESMTPSA id g188sm8027503wmf.32.2018.11.23.10.11.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Nov 2018 10:11:34 -0800 (PST) From: Etienne Carriere To: buildroot@buildroot.org Date: Fri, 23 Nov 2018 19:11:30 +0100 Message-Id: <1542996690-5392-1-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542900177-17343-5-git-send-email-etienne.carriere@linaro.org> References: <1542900177-17343-5-git-send-email-etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH v2 5/5] optee-test: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Etienne Carriere MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" OP-TEE test package provide test materials as part of the OP-TEE project helping platforms to verify their OP-TEE components against a set of regression and performance tests. Package is added in the BR package configuration next to the OP-TEE client package. Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - Replace BR2_arm with BR2_ARM_CPU_ARMV7 as OP-TEE supports only BR2_ARM_CPU_ARMV7 architectures among the 32bit Arm machines. - Add missing dependency on BR2_TARGET_OPTEE_OS and select BR2_PACKAGE_OPTEE_CLIENT when enabled. - Add option BR2_PACKAGE_OPTEE_TEST_SYNCED_VERSION to ensure OP-TEE test version is synced with OP-TEE OS version. - Fix official repo URL in Config.in package description. - Remove useless OPTEE_TEST_INSTALL_STAGING=YES. - Do not force output build directory and rely on native one: out/. --- package/Config.in | 1 + .../optee-test/3.3.0/0001-cmake-rely-on-C.patch | 32 +++++++++ package/optee-test/Config.in | 75 ++++++++++++++++++++++ package/optee-test/optee-test.hash | 4 ++ package/optee-test/optee-test.mk | 48 ++++++++++++++ 5 files changed, 160 insertions(+) create mode 100644 package/optee-test/3.3.0/0001-cmake-rely-on-C.patch create mode 100644 package/optee-test/Config.in create mode 100644 package/optee-test/optee-test.hash create mode 100644 package/optee-test/optee-test.mk diff --git a/package/Config.in b/package/Config.in index 35870d0..ff53a75 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2050,6 +2050,7 @@ menu "Security" source "package/optee-benchmark/Config.in" source "package/optee-client/Config.in" source "package/optee-examples/Config.in" + source "package/optee-test/Config.in" source "package/paxtest/Config.in" source "package/policycoreutils/Config.in" source "package/refpolicy/Config.in" diff --git a/package/optee-test/3.3.0/0001-cmake-rely-on-C.patch b/package/optee-test/3.3.0/0001-cmake-rely-on-C.patch new file mode 100644 index 0000000..ea7b966 --- /dev/null +++ b/package/optee-test/3.3.0/0001-cmake-rely-on-C.patch @@ -0,0 +1,32 @@ +cmake: component rely on C support + +Without specifing optee_client source expects only C source file +support cmake may attempt to look for resources as g++. When +building with environments that do not provide such tools as when +building from native buildroot ofr a qemu target, optee_client +fails to build. This change ensure a minimal C support allows to +build optee_client with cmake. + +Signed-off-by: Etienne Carriere +Acked-by: Jerome Forissier + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0290205..a3fd269 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,5 @@ + cmake_minimum_required (VERSION 3.2) ++project (optee_test C) + + # Default cross compile settings + set (CMAKE_TOOLCHAIN_FILE CMakeToolchain.txt) +diff --git a/ta/CMakeLists.txt b/ta/CMakeLists.txt +index 22d7727..795237e 100644 +--- a/ta/CMakeLists.txt ++++ b/ta/CMakeLists.txt +@@ -1,4 +1,4 @@ +-project (xtest-ta-headers) ++project (xtest-ta-headers C) + + add_library(${PROJECT_NAME} INTERFACE) + diff --git a/package/optee-test/Config.in b/package/optee-test/Config.in new file mode 100644 index 0000000..545db03 --- /dev/null +++ b/package/optee-test/Config.in @@ -0,0 +1,75 @@ +config BR2_PACKAGE_OPTEE_TEST + bool "optee_test" + depends on BR2_aarch64 || BR2_ARM_CPU_ARMV7A + depends on BR2_TARGET_OPTEE_OS + select BR2_PACKAGE_OPTEE_CLIENT + help + This build option enables OP-TEE test package from the + OP-TEE project. It helps platforms to verify the OP-TEE + installation against a set of regression and performance + tests. + + The package generates userspace test applications and + data files for the Linux userland. It also generates + OP-TEE trusted applications embedded in the target + directory /lib/optee-armtz. These are loaded into the + secure world at runtime. + + http://github.com/OP-TEE/optee_test + +if BR2_PACKAGE_OPTEE_TEST + +choice + prompt "OP-TEE test version" + default BR2_PACKAGE_OPTEE_TEST_LATEST + help + Select the version of OP-TEE test you want to use + +config BR2_PACKAGE_OPTEE_TEST_LATEST + bool "sync with latest release tag" + help + This fetches the latest registered release tag from + the OP-TEE test official Git repository. + +config BR2_PACKAGE_OPTEE_TEST_CUSTOM_GIT + bool "sync with a specific Git" + help + Sync with a specific OP-TEE Git repository. + +endchoice + +config BR2_PACKAGE_OPTEE_TEST_SYNCED_VERSION + bool "use same version ref for OP-TEE components" + depends on BR2_PACKAGE_OPTEE_TEST_LATEST + help + When enabled, OP-TEE examples version must match the version + set for the other OP-TEE components. + +config BR2_PACKAGE_OPTEE_TEST_VERSION + string + default BR2_TARGET_OPTEE_OS_VERSION \ + if BR2_PACKAGE_OPTEE_TEST_SYNCED_VERSION + default "3.3.0" if BR2_PACKAGE_OPTEE_TEST_LATEST + default BR2_PACKAGE_OPTEE_TEST_CUSTOM_REPO_VERSION \ + if BR2_PACKAGE_OPTEE_TEST_CUSTOM_GIT + help + Reference in the target Git repository to sync with. + +if BR2_PACKAGE_OPTEE_TEST_CUSTOM_GIT + +config BR2_PACKAGE_OPTEE_TEST_CUSTOM_REPO_URL + string "Git repository site" + help + Specific location of the reference source tree Git + repository. + +config BR2_PACKAGE_OPTEE_TEST_CUSTOM_REPO_VERSION + string "target reference to pull in the Git repository" + help + Package version reference to sync with. As source file + reference is a Git repository, the version reference can + be any Git reference as a tag or a sha1. + +endif + +endif #BR2_PACKAGE_OPTEE_TEST diff --git a/package/optee-test/optee-test.hash b/package/optee-test/optee-test.hash new file mode 100644 index 0000000..0da2212 --- /dev/null +++ b/package/optee-test/optee-test.hash @@ -0,0 +1,4 @@ +# From https://github.com/OP-TEE/optee_test/archive/3.3.0.tar.gz +sha256 9651d5db0d28856e45d6bc25ce603bfcf641435bd3264d95b449f093665c8521 optee-test-3.3.0.tar.gz +# Locally computed +sha256 6e6810981f0ddab9e0d44399d0700a15d9f760a3c2843cc866659c2074139ae7 LICENSE.md diff --git a/package/optee-test/optee-test.mk b/package/optee-test/optee-test.mk new file mode 100644 index 0000000..8040ee5 --- /dev/null +++ b/package/optee-test/optee-test.mk @@ -0,0 +1,48 @@ +################################################################################ +# +# optee-test +# +################################################################################ + +OPTEE_TEST_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_TEST_VERSION)) +OPTEE_TEST_LICENSE = GPL-2.0, BSD-2-Clause, +OPTEE_TEST_LICENSE_FILES = LICENSE.md + +ifeq ($(BR2_PACKAGE_OPTEE_TEST_CUSTOM_GIT),y) +OPTEE_TEST_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_TEST_CUSTOM_REPO_URL)) +OPTEE_TEST_SITE_METHOD = git +BR_NO_CHECK_HASH_FOR += $(OPTEE_TEST_SOURCE) +else +OPTEE_TEST_SITE = $(call github,OP-TEE,optee_test,$(OPTEE_TEST_VERSION)) +endif + +OPTEE_TEST_DEPENDENCIES = optee-client optee-os + +ifeq ($(BR2_aarch64),y) +OPTEE_TEST_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm64 +endif +ifeq ($(BR2_arm),y) +OPTEE_TEST_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm32 +endif +OPTEE_TEST_CONF_OPTS = -DOPTEE_TEST_SDK=$(OPTEE_TEST_SDK) + +define OPTEE_TEST_BUILD_TAS + @$(foreach f,$(wildcard $(@D)/ta/*/Makefile), \ + $(TARGET_CONFIGURE_OPTS) \ + $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \ + TA_DEV_KIT_DIR=$(OPTEE_TEST_SDK) \ + -C $(dir $f) all &&) true +endef + +define OPTEE_TEST_INSTALL_TAS + @$(foreach f,$(wildcard $(@D)/ta/*/out/*.ta), \ + mkdir -p $(TARGET_DIR)/lib/optee_armtz && \ + $(INSTALL) -v -p --mode=444 \ + --target-directory=$(TARGET_DIR)/lib/optee_armtz $f \ + &&) true +endef + +OPTEE_TEST_POST_BUILD_HOOKS += OPTEE_TEST_BUILD_TAS +OPTEE_TEST_POST_INSTALL_TARGET_HOOKS += OPTEE_TEST_INSTALL_TAS + +$(eval $(cmake-package))