public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Anton Mikanovich <amikan@ilbers.de>, isar-users@googlegroups.com
Subject: Re: [RFC 10/15] sbuild: Introduce environment variables export API
Date: Mon, 26 Jul 2021 16:47:07 +0200	[thread overview]
Message-ID: <a48e6c9f-f123-64b4-5922-3dc633b4cc1c@siemens.com> (raw)
In-Reply-To: <20210726134636.30800-11-amikan@ilbers.de>

On 26.07.21 15:46, Anton Mikanovich wrote:
> In case there is no ability to pass variables through template
> mechanism we need to keep fallback API to migrate from bare export.
> Using it with optee-os-stm32mp15x recipe as example.
> 

Ah, here is what I was looking for.

> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> ---
>  .../optee-os/optee-os-stm32mp15x_3.11.0.bb          |  2 +-
>  meta/classes/sbuild.bbclass                         | 13 +++++++++++++
>  2 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb b/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb
> index 0fa2005..19aa763 100644
> --- a/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb
> +++ b/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb
> @@ -21,5 +21,5 @@ OPTEE_BINARIES = "tee-header_v2.stm32 tee-pageable_v2.stm32 tee-pager_v2.stm32"
>  # Set version manually to PV, the tarball does not contain any hint.
>  # Alternative: pull from git and add git as build dependency.
>  dpkg_runbuild_prepend() {
> -    export TEE_IMPL_VERSION=${PV}
> +    sbuild_export TEE_IMPL_VERSION=${PV}

Maybe not call this mechanism "sbuild" - what if we switch the builder
in the future?

And it should be documented.

>  }
> diff --git a/meta/classes/sbuild.bbclass b/meta/classes/sbuild.bbclass
> index ed2d0cf..cc7db66 100644
> --- a/meta/classes/sbuild.bbclass
> +++ b/meta/classes/sbuild.bbclass
> @@ -15,3 +15,16 @@ python __anonymous() {
>  
>  SBUILD_CHROOT ?= "${DEBDISTRONAME}-${@os.getlogin()}-${DISTRO}-${SBUILD_HOST_ARCH}"
>  SBUILD_CHROOT_RW ?= "${DEBDISTRONAME}-${@os.getlogin()}-${DISTRO}-${SBUILD_HOST_ARCH}-rw"
> +
> +sbuild_export() {
> +    SBUILD_CONFIG="${WORKDIR}/sbuild.conf"
> +    VAR_LINE="'${1%%=*}' => '${1#*=}',"
> +    if [ -s "${SBUILD_CONFIG}" ]; then
> +        sed -i -e "\$i\\" -e "${VAR_LINE}" ${SBUILD_CONFIG}
> +    else
> +        echo "\$build_environment = {" > ${SBUILD_CONFIG}
> +        echo "${VAR_LINE}" >> ${SBUILD_CONFIG}
> +        echo "};" >> ${SBUILD_CONFIG}
> +    fi
> +    export SBUILD_CONFIG="${SBUILD_CONFIG}"
> +}
> 

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

  reply	other threads:[~2021-07-26 14:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 13:46 [RFC 00/15] Sbuild/Schroot migration Anton Mikanovich
2021-07-26 13:46 ` [RFC 01/15] dpkg: Install raw package files to source root Anton Mikanovich
2021-07-26 13:46 ` [RFC 02/15] dpkg-gbp: Use separate export-orig command Anton Mikanovich
2021-07-26 13:46 ` [RFC 03/15] isar-bootstrap: Export bootstrap to schroot config Anton Mikanovich
2021-07-26 13:46 ` [RFC 04/15] linux-module: Do not use shell environment Anton Mikanovich
2021-07-26 14:40   ` Jan Kiszka
2021-07-26 13:46 ` [RFC 05/15] u-boot: " Anton Mikanovich
2021-07-26 14:50   ` Jan Kiszka
2021-07-26 13:46 ` [RFC 06/15] trusted-firmware: " Anton Mikanovich
2021-07-26 13:46 ` [RFC 07/15] optee-os: " Anton Mikanovich
2021-07-26 13:46 ` [RFC 08/15] kselftest: " Anton Mikanovich
2021-07-26 13:46 ` [RFC 09/15] dpkg: Build packages with sbuild Anton Mikanovich
2021-07-26 13:46 ` [RFC 10/15] sbuild: Introduce environment variables export API Anton Mikanovich
2021-07-26 14:47   ` Jan Kiszka [this message]
2021-07-26 13:46 ` [RFC 11/15] dpkg: Remove builddeps install task Anton Mikanovich
2021-07-26 13:46 ` [RFC 12/15] dpkg-gbp: Migrate to schroot Anton Mikanovich
2021-07-26 13:46 ` [RFC 13/15] img: Use schroot for image prepare Anton Mikanovich
2021-07-26 13:46 ` [RFC 14/15] linux-mainline: Move cfg fragment test to debian/rules Anton Mikanovich
2021-07-26 14:48   ` Jan Kiszka
2021-07-26 13:46 ` [RFC 15/15] linux-custom: Prepare kernel config inside sbuild Anton Mikanovich

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=a48e6c9f-f123-64b4-5922-3dc633b4cc1c@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=amikan@ilbers.de \
    --cc=isar-users@googlegroups.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