From patchwork Thu Oct 15 00:43:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 160 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:e04f:0:0:0:0:0 with SMTP id v15csp258687oos; Thu, 15 Oct 2020 02:43:45 -0700 (PDT) X-Received: by 2002:ac2:5506:: with SMTP id j6mr719082lfk.290.1602755025451; Thu, 15 Oct 2020 02:43:45 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1602755025; cv=pass; d=google.com; s=arc-20160816; b=xe6qhwSJmUCWxFGorz9xIRYTwicCdl64pekMVbd6ueQuwRwDO+yC3lqy2SKrcwGbfc Aw8jySNkXr3UH6PZrBB18CHBCMp6R1TQDX5nyw6edSkBz43sAE2XCbxYMFzIO0n/EAH/ KwW5zQ/JRoUt3S9vQqZsuXaF3NaHrNu2H4i3SDwbHZXW0kM8jn1vhF53RfmvPTy8bRUO kdfituIOLgPSBr/9mCPVwnHBTROB27tpgXVF0H9F1Ikl2JsYDjZYPuh3Yhi7nC21gMxL y5ujaGH+oEXpwtxNi/gwZ1eVDOkgYGICB23V9lOv8ZJA6awIMOMql8RvqbgQ6F9FfMtq k61Q== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:dkim-signature; bh=268933c73qN0LVX4HjqK9uM8UTCyUO64psk6OnoY7jg=; b=CV9CGOwzAAT7afJaQE+pnZ4NSqOSTgG+u0+51NceE+GpnxLrvDgRWJRJHb/LHmyrPz chmxFczUHSSMScXMAN8/udCGdOWAFcDnOEdzkY5O6FEgQMOFg8vDbcfxhD5Ts+hNQZxQ PHKp5bBODnS6lws/QEPniuQnSN5T0EWxUpJrE8PjuitxRL+LEZelrVO3E6xhfP+jaeu9 cDF97jsKRFMh5t/Gdi9ynWtIH7toJQLUsCDZ1FXBDcv+ctKV2sbLgKT1q4PfZHWVHj8W eAdcEKBw+qANLHNi2CpoHsiNBc8J3SU1eAEsIZqDS3wYvDkQBgpSrN4/dumNCuXSxNdD mZaw== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=fVL0oQDl; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbcji7smnv4nbbuftud6akgqe26lztwq@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCJI7SMNV4NBBUFTUD6AKGQE26LZTWQ@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com Received: from mail-sor-f55.google.com (mail-sor-f55.google.com. [209.85.220.55]) by mx.google.com with SMTPS id c5sor438397lfr.184.2020.10.15.02.43.45 (Google Transport Security); Thu, 15 Oct 2020 02:43:45 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbcji7smnv4nbbuftud6akgqe26lztwq@googlegroups.com designates 209.85.220.55 as permitted sender) client-ip=209.85.220.55; Authentication-Results: mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=fVL0oQDl; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbcji7smnv4nbbuftud6akgqe26lztwq@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCJI7SMNV4NBBUFTUD6AKGQE26LZTWQ@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com ARC-Seal: i=2; a=rsa-sha256; t=1602755025; cv=pass; d=google.com; s=arc-20160816; b=n9RSgYvmew0Dsv5te9rOt9O783MEd5ECpyg9hrC8syfjTX0vqMtwBzUSxa0LJ9/LcB huO5BYeMVlT6Br7XCrqoHBHo5hFERwtDi4rEZo3aLTb55rg6JtCJalah11JW09evbuAA 6s385mtjrDaSYGS/aKKzocTeu5g8Y71rTRY4d0zJjDKlgY8ni/lWZ53Cg0LNHn5F8bfW w8ybXpr06KyZmC2w89AwYbLap7n1RFAuouQtmwQFioNh97MDvLVGQUWJhu8Toeew9HQx FpUpTTl4QDhxAclbaexQeURPTBOVhIsKXljNZyBhT3n+2iGOPZqAhTeo4LNPaMrhtbcz HizA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:dkim-signature; bh=268933c73qN0LVX4HjqK9uM8UTCyUO64psk6OnoY7jg=; b=Wop4hYLt+fnFdBCLkuzRQgvBJzCIKjAE3gIWCot9Zx1tE4HCZ870BFlrDsI2JxwZAH Y+K1lmjCe1jDFk4LbTrG01XpgEPU9bfpwA4Ttnq22jcd4Z4no/PCGh+HaGg1CRq4pJwk 3gEHC7rjN6qCmNdgzUuCV3lkEkClWjkPWX6ag6z+MnET1WumGbz6prQC6v0njh42tlg3 vVVTJCwyhhefLTk6qjJJGhwW9D77BhL8kG44mbtx0onitYrSRZlbGDrTHfI78XbCEGWF s8s8HZOrYpiPsey1bnf4JVKFSsWjfSYB0FE853neBLCX4K1FoDEPF6b3S5ZtJ3PuaxV3 LSqg== ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=268933c73qN0LVX4HjqK9uM8UTCyUO64psk6OnoY7jg=; b=fVL0oQDlvZfuPjEb9fGKK4zW1uBJarsRi0kFglkkSMpwF1NYSu2ILGur+05DV2lIch Sf7Hwn6Vu3p80z+BQJQK5Ja3AExzQvjDV6NXux0HNn1Z3LWNvLKY4QLVbwi8clN+0pA1 aVFycBakVGvESUP/+LIjQGxCTqD9FihJcUkfX30e3hSxUW66HYQBSf4yZfdCv0wQmLHg kOWQbJspMgtVdJA754vxbG00Yxu7j1FdKX30d3beUfX0uh4a1CHD6K7d7gQjbh6hMr8i nE2nTcFe0y4X5q4yxgKHP3Nh0da9z8nY8s6ovM/6djXj6iZb46nZArux6/8HZVvO3erG H/RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=268933c73qN0LVX4HjqK9uM8UTCyUO64psk6OnoY7jg=; b=BLKHsMH8lvD8Wuv3/oUOiMmTMIDyafnbE10ZmneyySfLFKr3jF632kOmMm+fbq6KUH sBy647/L3BDc+2BfT4mhkzPskPiVwSYzM2dC0SLk6pKLY1O+7ramJZQvpSd/LgiyadJr GlgYeVU8mHcLZVySJODG1dztU5GNQqYX6gkwXpAzWDuyD5y0qvv8JfmRKhkIvavAWm/H L0GxxEhHvKjZv7pZuvJhqJ2J80G4tqot5OIikk3FKvRkFe6uU9rFgC3OCuiQAAM46XR9 0EdKPlgSPwK2yYHTACP9/kjz9XRDV3Lum0oOjZJzMC+d/Yu11K97Jwkhns4c5YDlWjUi +ptQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM531E3vEvztq85TfTaJwuqsLJSNdR8Ul8u6AZ63Ps10iAGHYbEKpv ELah28saoD5L9GNKKkE3Mzo= X-Google-Smtp-Source: ABdhPJyXSrsH4VgMktSeSt74t1Y/qlCuzwEPD3em5H4J0Lb4DPoUenodo1imuDxUr3FUDkV3JJd/Lg== X-Received: by 2002:ac2:5325:: with SMTP id f5mr862437lfh.86.1602755025112; 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-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 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; 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 X-Original-Sender: jan.kiszka@siemens.com X-Original-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 Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1680610454040995443?= X-GMAIL-MSGID: =?utf-8?q?1680610454040995443?= 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}" +}