From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6883009067021762560 X-Received: by 2002:adf:e74d:: with SMTP id c13mr30918072wrn.277.1606118043561; Sun, 22 Nov 2020 23:54:03 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:e5c2:: with SMTP id a2ls6310104wrn.3.gmail; Sun, 22 Nov 2020 23:54:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzBbFe7LtXuzgoNmPwlpn7rzTHpvjAxZlalYimUI3LW+001tptdd8HRT258258BiXFhUx6 X-Received: by 2002:a5d:67c5:: with SMTP id n5mr31287212wrw.179.1606118042751; Sun, 22 Nov 2020 23:54:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606118042; cv=none; d=google.com; s=arc-20160816; b=xy0c62sgTWZomsZKOgmb8YRU9rlAtey0ayuLHawH4RV1NbmxSd94beialBqGLuks+E JfM5+7jL0dnuzBZkLiyOsUPZifxl4zRBTxuyNVrzEh7Z9+G867uL8r1kNisrSnsS/vI1 HzCnAGXCu9EtVp7/Dpn4lXbEWiDN8GIrTTICAd0XcG4fMUkmGsr7H3TUvmOAPpg/zqFm JkAm3Ou9/H+4f2/ufg13HAbtNHSgj+9kjf4tY17vEnxc+qotPv7SVjhtT35wuDMgeU9w Z4s7FhzyKibnquNJxPw+HBTtl2PnPo5mlTfhrTlYhXra9bCMXYldBfJ7LygHd2EPvIcx l3vQ== 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=tfBvkAqO8WmuKTqj0TFHKElcpMAo6vF76d5jHwuvD1g=; b=CN9Ed+sTD0nLGSWk5VAVXIDpX1OryOZzcR0ecSB8cEPk8CNq2ZGjYNsqQti7NSVBdB S88Wna7yIQZH6HTMbw+E+BrjFnu6UQf/epbTQAIWBk6cBJvNofwJrx40QXC0L9+A2zUR 2VVhP4WxannkS3nNT1RHmADDjpD91WR3TY1awXmdeQyFKAd/Df1xGao/3k2bF4WpS5lF fYSrE09ctOTYr7oP0VqVqMybFbfZBhlAVjV5kHznvUWzWuUaAMsFCXY+VyhxBEvt7Hvo HfcpxFO287ndMdgU3zTQm+AbNv1X0UKOD7lX0f/+tEeSOlgVI6ujneM/0x41wLCuS4zE UxAA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 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 gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id i1si372503wml.2.2020.11.22.23.54.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Nov 2020 23:54:02 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 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 gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 0AN7s2XF007456 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 23 Nov 2020 08:54:02 +0100 Received: from md1f2u6c.ad001.siemens.net ([167.87.38.29]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 0AN7rxTx017265 for ; Mon, 23 Nov 2020 08:54:02 +0100 From: Jan Kiszka To: isar-users Subject: [PATCH v4 09/11] Add recipe include for building custom OP-TEE Date: Mon, 23 Nov 2020 08:53:57 +0100 Message-Id: <11855ee285cd07ce17f526b44fd8347493033bde.1606118039.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: DHdhsjoGBbiJ 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 | 46 +++++++++++++++++++ 4 files changed, 76 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..1bd51969 --- /dev/null +++ b/meta/recipes-bsp/optee-os/optee-os-custom.inc @@ -0,0 +1,46 @@ +# 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" + +# split strip platform flavor, if any, from the specified platform string +OPTEE_PLATFORM_BASE = "${@d.getVar('OPTEE_PLATFORM').split('-')[0]}" + +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_BASE}/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