CIP-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: <sven.schultschik@siemens.com>, <cip-dev@lists.cip-project.org>
Subject: Re: [isar-cip-core][PATCH 2/7] add recipe for for edk2
Date: Wed, 19 Oct 2022 12:57:37 +0200	[thread overview]
Message-ID: <760608c4-0d6c-43f2-00c8-bc93de8cdeb4@siemens.com> (raw)
In-Reply-To: <20221019092117.5291-2-sven.schultschik@siemens.com>

On 19.10.22 11:21, sven.schultschik@siemens.com wrote:
> From: Sven Schultschik <sven.schultschik@siemens.com>
> 
> provide a recipe to create the BL32_AP_MM.fd binary by edk2 which is needed for the qemu optee generation as dependencie.

dependency

> 
> Signed-off-by: Sven Schultschik <sven.schultschik@siemens.com>
> ---
>  recipes-bsp/edk2/edk2_202205.bb              | 34 ++++++++++++
>  recipes-bsp/edk2/files/debian/changelog.tmpl |  6 +++
>  recipes-bsp/edk2/files/debian/compat         |  1 +
>  recipes-bsp/edk2/files/debian/control.tmpl   | 14 +++++
>  recipes-bsp/edk2/files/debian/edk2.install   |  2 +
>  recipes-bsp/edk2/files/debian/rules.tmpl     | 55 ++++++++++++++++++++
>  6 files changed, 112 insertions(+)
>  create mode 100644 recipes-bsp/edk2/edk2_202205.bb
>  create mode 100644 recipes-bsp/edk2/files/debian/changelog.tmpl
>  create mode 100644 recipes-bsp/edk2/files/debian/compat
>  create mode 100644 recipes-bsp/edk2/files/debian/control.tmpl
>  create mode 100644 recipes-bsp/edk2/files/debian/edk2.install
>  create mode 100755 recipes-bsp/edk2/files/debian/rules.tmpl
> 
> diff --git a/recipes-bsp/edk2/edk2_202205.bb b/recipes-bsp/edk2/edk2_202205.bb
> new file mode 100644
> index 000000000..5a773bf77
> --- /dev/null
> +++ b/recipes-bsp/edk2/edk2_202205.bb
> @@ -0,0 +1,34 @@
> +#
> +# CIP Core, generic profile
> +#
> +# Copyright (c) Siemens AG, 2022
> +#
> +# Authors:
> +#  Sven Schultschik <sven.schultschik@siemens.com>
> +#
> +# SPDX-License-Identifier: MIT
> +#
> +
> +HOMEPAGE = "https://github.com/tianocore/edk2"
> +MAINTAINER = "Sven Schultschik <sven.schultschik@siemens.com>"
> +LICENSE = "BSD-2-Clause-Patent"
> +
> +inherit dpkg
> +
> +SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https;destsuffix=git/edk2;rev=edk2-stable${PV} \
> +            git://github.com/tianocore/edk2-platforms.git;protocol=https;destsuffix=git/edk2-platforms;rev=3b896d1a325686de3942723c42f286090453e37a \

- gitsm (see patch 1/7)
- please factor out revisions into separate variables

Or can we also address the revisions via release tags? The recipe
carries a release version number in the end...

> +            file://debian \
> +            "
> +S = "${WORKDIR}/git"
> +
> +BUILD_DEPENDS   += ""
> +
> +TEMPLATE_FILES = "debian/changelog.tmpl debian/control.tmpl debian/rules.tmpl"
> +TEMPLATE_VARS += "BUILD_DEPENDS S"
> +
> +ISAR_CROSS_COMPILE = "0"

Why?

> +
> +do_prepare_build() {
> +    cp -R ${WORKDIR}/debian ${S}
> +    deb_add_changelog
> +}
> \ No newline at end of file

...

> diff --git a/recipes-bsp/edk2/files/debian/changelog.tmpl b/recipes-bsp/edk2/files/debian/changelog.tmpl
> new file mode 100644
> index 000000000..8d74dfe7a
> --- /dev/null
> +++ b/recipes-bsp/edk2/files/debian/changelog.tmpl
> @@ -0,0 +1,6 @@
> +${PN} (${PV}) unstable; urgency=medium
> +
> +  * EDK2
> +
> + --    
> +

Should not be needed as you have deb_add_changelog anyway.

> diff --git a/recipes-bsp/edk2/files/debian/compat b/recipes-bsp/edk2/files/debian/compat
> new file mode 100644
> index 000000000..f599e28b8
> --- /dev/null
> +++ b/recipes-bsp/edk2/files/debian/compat
> @@ -0,0 +1 @@
> +10
> diff --git a/recipes-bsp/edk2/files/debian/control.tmpl b/recipes-bsp/edk2/files/debian/control.tmpl
> new file mode 100644
> index 000000000..1f1bad7c8
> --- /dev/null
> +++ b/recipes-bsp/edk2/files/debian/control.tmpl
> @@ -0,0 +1,14 @@
> +Source: ${PN}
> +Section: base
> +Priority: optional
> +Standards-Version: 3.9.6
> +Build-Depends: ${BUILD_DEPENDS}, python3, dh-python, uuid-dev
> +Homepage: ${HOMEPAGE}
> +Maintainer: ${MAINTAINER}
> +
> +Package: ${PN}
> +Depends: ${shlibs:Depends}
> +Section: base
> +Architecture: ${DISTRO_ARCH}
> +Priority: required
> +Description: ${DESCRIPTION}
> \ No newline at end of file

I suspect you could also generate both files (deb_debianize).

> diff --git a/recipes-bsp/edk2/files/debian/edk2.install b/recipes-bsp/edk2/files/debian/edk2.install
> new file mode 100644
> index 000000000..e5cadccf3
> --- /dev/null
> +++ b/recipes-bsp/edk2/files/debian/edk2.install
> @@ -0,0 +1,2 @@
> +#! /usr/bin/dh-exec
> +Build/MmStandaloneRpmb/RELEASE_GCC5/FV/BL32_AP_MM.fd /usr/lib/edk2
> \ No newline at end of file
> diff --git a/recipes-bsp/edk2/files/debian/rules.tmpl b/recipes-bsp/edk2/files/debian/rules.tmpl
> new file mode 100755
> index 000000000..11e4ae8cd
> --- /dev/null
> +++ b/recipes-bsp/edk2/files/debian/rules.tmpl
> @@ -0,0 +1,55 @@
> +#!/usr/bin/make -f
> +#
> +# Copyright (c) Siemens AG, 2022
> +#
> +# SPDX-License-Identifier: MIT
> +
> +export WORKSPACE=$(shell pwd)
> +export PACKAGES_PATH=$(WORKSPACE)/edk2:$(WORKSPACE)/edk2-platforms
> +export ACTIVE_PLATFORM="Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc"
> +
> +# https://github.com/tianocore/edk2-platforms/blob/master/Readme.md#if-cross-compiling
> +ifeq (arm64,$(DEB_TARGET_ARCH))
> +export TARGET_ARCH = 'AARCH64'
> +else ifeq ((armhf,$(DEB_TARGET_ARCH))
> +export TARGET_ARCH = 'ARM'
> +else ifeq ((amd64,$(DEB_TARGET_ARCH))
> +export TARGET_ARCH = 'X64'
> +else ifeq ((i386,$(DEB_TARGET_ARCH))
> +export TARGET_ARCH = 'IA32'
> +else
> +$(error DEB_TARGET_ARCH $(DEB_TARGET_ARCH) unsupported)
> +endif
> +# When cross-compiling, or building with a different version of the compiler than
> +# the default `gcc`, we additionally need to inform the
> +# build command which toolchain to use. We do this by setting the environment
> +# variable `{TOOL_CHAIN_TAG}_{TARGET_ARCH}_PREFIX` - in the case above,
> +# **GCC5_AARCH64_PREFIX**.
> +# export GCC5_AARCH64_PREFIX=aarch64-linux-gnu-
> +export GCC5_$(TARGET_ARCH)_PREFIX=$(DEB_HOST_GNU_TYPE)-
> +
> +
> +export SHELL=/bin/bash
> +
> +# ENV Vars which should get set by edksetup.sh
> +export PYTHON_COMMAND=python3
> +export PYTHONHASHSEED=1
> +export CONF_PATH=$(WORKSPACE)/edk2/Conf
> +export EDK_TOOLS_PATH=$(WORKSPACE)/edk2/BaseTools
> +export PATH=$(WORKSPACE)/edk2/BaseTools/Bin/Linux-$(TARGET_ARCH):$(WORKSPACE)/edk2/BaseTools/BinWrappers/PosixLike::/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
> +
> +override_dh_auto_build:
> +	source edk2/edksetup.sh --reconfig
> +
> +	make -C edk2/BaseTools
> +
> +	build -p $(ACTIVE_PLATFORM) -b RELEASE -a $(TARGET_ARCH) -t GCC5 -n $(shell nproc)
> +
> +override_dh_auto_install:
> +
> +override_dh_auto_test:
> +
> +override_dh_strip:

stripping you can likely allow again when doing a true cross-compilation.

> +
> +%:
> +	dh $@ --with python3 --no-parallel

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux



  reply	other threads:[~2022-10-19 10:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19  9:21 [isar-cip-core][PATCH 1/7] add recipe for optee qemu arm64 sven.schultschik
2022-10-19  9:21 ` [isar-cip-core][PATCH 2/7] add recipe for for edk2 sven.schultschik
2022-10-19 10:57   ` Jan Kiszka [this message]
2022-10-19 13:14     ` AW: " Schultschik, Sven
2022-10-19 13:21       ` Jan Kiszka
2022-10-20 17:59         ` AW: " Schultschik, Sven
2022-10-20 16:24     ` Schultschik, Sven
2022-10-21  6:57       ` Jan Kiszka
2022-10-19  9:21 ` [isar-cip-core][PATCH 3/7] add recipe for trusted firmware a qemu arm64 sven.schultschik
2022-10-19  9:21 ` [isar-cip-core][PATCH 4/7] add u-boot patch for qemu to support RPMB sven.schultschik
2022-10-19  9:21 ` [isar-cip-core][PATCH 5/7] add kas files for building qemu secure boot images sven.schultschik
2022-10-19  9:21 ` [isar-cip-core][PATCH 6/7] enhance start-qemu.sh for arm64 secure boot sven.schultschik
2022-10-19  9:21 ` [isar-cip-core][PATCH 7/7] no merge - manually instructions test " sven.schultschik
2022-10-19 10:44 ` [isar-cip-core][PATCH 1/7] add recipe for optee qemu arm64 Jan Kiszka
2022-10-19 10:46   ` Jan Kiszka
2022-10-19 13:05   ` AW: " Schultschik, Sven
2022-10-19 13:14     ` Jan Kiszka
2022-10-19 13:21   ` AW: " Schultschik, Sven
2022-10-19 13:24     ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=760608c4-0d6c-43f2-00c8-bc93de8cdeb4@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=sven.schultschik@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox