From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6883009067021762560 X-Received: by 2002:a2e:9f4d:: with SMTP id v13mr979122ljk.379.1602755025182; Thu, 15 Oct 2020 02:43:45 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:c111:: with SMTP id r17ls1341727lff.0.gmail; Thu, 15 Oct 2020 02:43:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxORxC5jdqGDpADNYiVZyOHho+z0V5J+Dv2/R8L3LwtMpjjlJNimIUcI65f2dSeL2B2p7n X-Received: by 2002:ac2:4355:: with SMTP id o21mr834542lfl.210.1602755023932; Thu, 15 Oct 2020 02:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602755023; cv=none; d=google.com; s=arc-20160816; b=yxEe0ImTb7/YzRTAcVIL4Bds8AzXsCdN+EdD/hJ6NHc++P/AOi7vbrb3NgL/s/Fb3K pXzQAZXOc1BAGEq4TtaEfOr0unlzVIq9kqbJiig6cBa7imjAbxb9FiEX5CU7KG8OwU34 HJ/nwpKI4vlshuZDee9wrMUupoTCKK/qkGvzCSUXZSG+Z3PWwA4C9S0Xt0TUdjV2XsTU L4IkGXsdrkpAHXX+p1x0I6+kMSEggqFy0lbMMwf5HuJrYMU63u6d6w74oLxuozYlYtjc AZS3hDzxBdGqcLZ1XnQddet4JP9bjzskxRpcuhlReB3fIeJCQFbLgtFbhobqihri0MtE mSLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=we4NWcnB91lWOQM+4HuSbmyw6ML7xY8jkNe/dx8Dmgk=; b=h58dSrlAl13pWckxA/4S1XwUmgLHU1LXd/roBFsM7gA5XYtkwcuOL/sdzdKmGJz5zX MZo2810zq9PZT8GuJSiSDpN2bFGZ3ClliTHvP9o/kZDYJgQgrkXbam1sU9eRK4zNh1ez 2XRA/4lb8nsAUFoMjEKxE7p+D2tSetsgV42Iela51EiFpoMZCJym/9usvTTBf44XiVKU pvdv4iNiXhBQY1R4FpOUQYdu895EXHkk1P4n1lLcJDSKANrhR1kqb1KAmMXTC0gpidyw 7SyW1y/lX0HXVIaqGd9keoY6JAW7z9dBnEwwY84UgdTUHfQOG9ba29sbn1pdClvyw0L+ WAXA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id e1si85097ljg.6.2020.10.15.02.43.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 02:43:43 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 09F9hhS0025589 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 15 Oct 2020 11:43:43 +0200 Received: from md1f2u6c.ad001.siemens.net ([167.87.42.243]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 09F9heai028282 for ; Thu, 15 Oct 2020 11:43:42 +0200 From: Jan Kiszka To: isar-users Subject: [PATCH v2 09/11] Add recipe include for building custom OP-TEE Date: Thu, 15 Oct 2020 11:43:38 +0200 Message-Id: <41a04af6ae13705c9cfebfb809f769e84acb7d15.1602755020.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: g363K7fG+mlD From: Jan Kiszka Analogously to TF-A, this adds an include file to be used in custom Open Portable Trusted Execution Environment. The typical customization points are OPTEE_PLATFORM and possibly a couple of OPTEE_EXTRA_BUILDARGS. The to-be-packaged binaries can be defined via OPTEE_BINARIES. Signed-off-by: Jan Kiszka --- meta/recipes-bsp/optee-os/files/debian/compat | 1 + .../optee-os/files/debian/control.tmpl | 10 +++++ meta/recipes-bsp/optee-os/files/debian/rules | 19 ++++++++ meta/recipes-bsp/optee-os/optee-os-custom.inc | 43 +++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 meta/recipes-bsp/optee-os/files/debian/compat create mode 100644 meta/recipes-bsp/optee-os/files/debian/control.tmpl create mode 100755 meta/recipes-bsp/optee-os/files/debian/rules create mode 100644 meta/recipes-bsp/optee-os/optee-os-custom.inc diff --git a/meta/recipes-bsp/optee-os/files/debian/compat b/meta/recipes-bsp/optee-os/files/debian/compat new file mode 100644 index 00000000..f599e28b --- /dev/null +++ b/meta/recipes-bsp/optee-os/files/debian/compat @@ -0,0 +1 @@ +10 diff --git a/meta/recipes-bsp/optee-os/files/debian/control.tmpl b/meta/recipes-bsp/optee-os/files/debian/control.tmpl new file mode 100644 index 00000000..60b39279 --- /dev/null +++ b/meta/recipes-bsp/optee-os/files/debian/control.tmpl @@ -0,0 +1,10 @@ +Source: ${PN} +Section: admin +Priority: optional +Standards-Version: 3.9.6 +Build-Depends: ${DEBIAN_BUILD_DEPENDS} +Maintainer: ISAR project + +Package: optee-os-${OPTEE_NAME} +Architecture: ${DISTRO_ARCH} +Description: ${DESCRIPTION}, firmware binaries diff --git a/meta/recipes-bsp/optee-os/files/debian/rules b/meta/recipes-bsp/optee-os/files/debian/rules new file mode 100755 index 00000000..d2e9900f --- /dev/null +++ b/meta/recipes-bsp/optee-os/files/debian/rules @@ -0,0 +1,19 @@ +#!/usr/bin/make -f + +# Debian rules for custom OP-TEE OS build +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2020 +# +# SPDX-License-Identifier: MIT + +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) +export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)- +endif + +override_dh_auto_build: + CFLAGS= LDFLAGS= $(MAKE) $(PARALLEL_MAKE) PLATFORM=$(OPTEE_PLATFORM) \ + $(OPTEE_EXTRA_BUILDARGS) + +%: + dh $@ diff --git a/meta/recipes-bsp/optee-os/optee-os-custom.inc b/meta/recipes-bsp/optee-os/optee-os-custom.inc new file mode 100644 index 00000000..54c47fef --- /dev/null +++ b/meta/recipes-bsp/optee-os/optee-os-custom.inc @@ -0,0 +1,43 @@ +# Custom OP-TEE OS build +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2020 +# +# SPDX-License-Identifier: MIT + +inherit dpkg + +FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/files:" + +SRC_URI += "file://debian/" + +DESCRIPTION ?= "Custom OP-TEE OS" + +OPTEE_NAME ?= "${MACHINE}" +OPTEE_PLATFORM ?= "unknown" +OPTEE_EXTRA_BUILDARGS ?= "" +OPTEE_BINARIES ?= "tee-pager_v2.bin" + +DEBIAN_BUILD_DEPENDS ?= "python3-pycryptodome:native, python3-pyelftools" + +PROVIDES += "optee-os-${OPTEE_NAME}" + +TEMPLATE_FILES = "debian/control.tmpl" +TEMPLATE_VARS += "OPTEE_NAME DEBIAN_BUILD_DEPENDS" + +do_prepare_build() { + cp -r ${WORKDIR}/debian ${S}/ + + deb_add_changelog + + rm -f ${S}/debian/optee-os-${OPTEE_NAME}.install + for binary in ${OPTEE_BINARIES}; do + echo "out/arm-plat-${OPTEE_PLATFORM}/core/$binary /usr/lib/optee-os/${OPTEE_NAME}/" >> \ + ${S}/debian/optee-os-${OPTEE_NAME}.install + done +} + +dpkg_runbuild_prepend() { + export OPTEE_PLATFORM="${OPTEE_PLATFORM}" + export OPTEE_EXTRA_BUILDARGS="${OPTEE_EXTRA_BUILDARGS}" +} -- 2.26.2