From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6883009067021762560 X-Received: by 2002:a19:8906:: with SMTP id l6mr10256821lfd.136.1602575433382; Tue, 13 Oct 2020 00:50:33 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:554:: with SMTP id 81ls604915lff.1.gmail; Tue, 13 Oct 2020 00:50:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO2mz1QCvBpsdL/m7/hkI+AYDjLLqyaFt2dpfV3re9e35yfG2TXrN27XWjiyXQMO7fa2OT X-Received: by 2002:ac2:5294:: with SMTP id q20mr9587748lfm.538.1602575432131; Tue, 13 Oct 2020 00:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602575432; cv=none; d=google.com; s=arc-20160816; b=KFwVwaO5D3mR2NUsUKhL4X/F+EqnF+Fbq6V1QF0n9yeg2XTlc0GuHNpDsczpTmMbw3 sAv2tj9C9TuouyD+xYA3ydzNC6u1ALymlY4/lz/4Qw1NFwMbzqhDW2/nHxsArYQc4PZz nXwzzyfVme0I7R1rpx7UtjeybjeLoRRcr98M8wum8igI1Pc/GJ8t1SMBI/ZS0JfYyeJY UP5zEqMLjtTW5afkzw+WI854JfS0z6phzPVq9poFpmqz09W20mdrGr47WkgVmsaLYdL0 RQUcY8/TuLGFnO+IQ0HxOqL9IC8QyhCf1/jGM8tRCkmZ1W0vcVQ/b02upeH/x9g8GMH2 pVRA== 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=VrBz+NSdbDH3S51zkVvgB8qFxylciN0VQConBgFot9kT2bDfqeMsG3dFDUtvRyTbKk Z1pZOxhh/4vl/GPLpFdF27S9TwxyKDkrovit/t3cT7YUC+4o7DlGYMn1FNEaKY/iAYw0 RPQt/kTxIzEi6M8lHnL06Vhwdh8tFy0kcPnBSCDkVYU6fb3VWqtLme0hMJGGHtUyZHG6 eepKiWufT7PBqbqY9AbZilg3RtDA8P6Nkrx3bDwQqrZJtnIoVGb2CNF0qtN4+ZhDd8f6 Pk/ukupAUirYWJosGOJJEomMvMDjU9SoRVOxePcOw05EHmPZq+cxM2cIg0tRQm32GTm1 ubaw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 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 lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id k10si600475ljj.0.2020.10.13.00.50.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2020 00:50:32 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 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 lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id 09D7oV3i013712 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 13 Oct 2020 09:50:31 +0200 Received: from md1f2u6c.ad001.siemens.net ([167.87.21.249]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 09D7oTb1020807 for ; Tue, 13 Oct 2020 09:50:31 +0200 From: Jan Kiszka To: isar-users Subject: [PATCH 09/11] Add recipe include for building custom OP-TEE Date: Tue, 13 Oct 2020 09:50:26 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: sJsIxfcLinUC 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