All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Diego Sueiro" <diego.sueiro@arm.com>
To: "JPEWhacker@gmail.com" <JPEWhacker@gmail.com>,
	"meta-arm@lists.yoctoproject.org"
	<meta-arm@lists.yoctoproject.org>
Subject: Re: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree
Date: Wed, 13 May 2020 06:22:05 +0000	[thread overview]
Message-ID: <AM0PR08MB39875A36D047820F57F17C6A92BF0@AM0PR08MB3987.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20200512211219.19262-2-JPEWhacker@gmail.com>

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Joshua Watt via lists.yoctoproject.org
> Sent: 12 May 2020 22:12
> To: meta-arm@lists.yoctoproject.org
> Cc: Joshua Watt <JPEWhacker@gmail.com>
> Subject: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree
>
> Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates the
> need to set the TFA_BUILD_DIR.
>
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  .../trusted-firmware-a/trusted-firmware-a.inc | 31 ++++++++++---------
>  1 file changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
> b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
> index e6d48e4..5600568 100644
> --- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
> +++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
> @@ -15,12 +15,7 @@ TFA_PLATFORM ?= "invalid"
>  # Build for debug (set TFA_DEBUG to 1 to activate)  TFA_DEBUG ?= "0"
>
> -# Sub-directory in which to build.
> -# This must be coherent with BUILD_PLAT make parameter so that deploy
> can find -# the produced binaries -TFA_BUILD_DIR ?= "build-
> ${TFA_PLATFORM}"
> -# set BUILD_PLAT depending on configured BUILD_DIR -EXTRA_OEMAKE +=
> "BUILD_PLAT=${TFA_BUILD_DIR}"
> +B = "${WORKDIR}/build"
>
>  # mbed TLS support (set TFA_MBEDTLS to 1 to activate)  TFA_MBEDTLS ?=
> "0"
> @@ -68,7 +63,7 @@ do_configure[noexec] = "1"
>  DEPENDS_append = " dtc-native openssl-native"
>
>  # Add platform parameter
> -EXTRA_OEMAKE += "PLAT=${TFA_PLATFORM}"
> +EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
>
>  # Handle TFA_DEBUG parameter
>  EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', '
> DEBUG=${TFA_DEBUG}', '', d)}"
> @@ -90,10 +85,16 @@ do_compile() {
>      sed -i '/^INCLUDE_PATHS/ s,$, \-
> I${RECIPE_SYSROOT_NATIVE}${includedir},' ${S}/tools/fiptool/Makefile
>      export
> LD_LIBRARY_PATH=${STAGING_DIR_NATIVE}${libdir}:$LD_LIBRARY_PATH
>
> -    oe_runmake ${TFA_BUILD_TARGET}
> +    (cd ${S} && oe_runmake ${TFA_BUILD_TARGET})

I'm just wondering, why you need to run this in a subshell?

>  }
>
>  do_install() {
> +    if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
> +        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
> +    else
> +        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
> +    fi
> +
>      install -d -m 755 ${D}/firmware
>      for atfbin in ${TFA_INSTALL_TARGET}; do
>          if [ "$atfbin" = "all" ]; then
> @@ -102,21 +103,21 @@ do_install() {
>              bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
>              bberror "rewrite or turn off do_install"
>              exit 1
> -        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
> +        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
>              echo "Install $atfbin.bin"
> -            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
> +            install -m 0644 $BUILD_PLAT/$atfbin.bin \
>                  ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
> -        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
> +        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
>              echo "Install $atfbin.elf"
> -            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
> +            install -m 0644 $BUILD_PLAT/$atfbin.elf \
>                  ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
> -        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
> +        elif [ -f $BUILD_PLAT/$atfbin ]; then
>              echo "Install $atfbin"
> -            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
> +            install -m 0644 $BUILD_PLAT/$atfbin \
>                  ${D}/firmware/$atfbin-${TFA_PLATFORM}
>          elif [ "$atfbin" = "dtbs" ]; then
>              echo "dtbs install, skipped"
> -        elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
> +        elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
>              echo "Tools $atfbin install, skipped"
>          else
>              bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
> --
> 2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

  parent reply	other threads:[~2020-05-13  6:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 14:26 [meta-arm][PATCH 0/3] TF-A improvements Joshua Watt
2020-05-11 14:26 ` [meta-arm][PATCH 1/3] trusted-firmware-a: Build out of tree Joshua Watt
2020-05-11 17:53   ` Denys Dmytriyenko
2020-05-11 14:26 ` [meta-arm][PATCH 2/3] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
2020-05-11 17:45   ` Denys Dmytriyenko
2020-05-11 14:26 ` [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3 Joshua Watt
2020-05-11 17:41   ` Denys Dmytriyenko
2020-05-12  0:24   ` Jon Mason
2020-05-12  0:28     ` Denys Dmytriyenko
2020-05-12 21:12 ` [meta-arm][PATCH v2 0/2] TF-A Improvements Joshua Watt
2020-05-12 21:12   ` [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree Joshua Watt
2020-05-12 21:22     ` Ross Burton
2020-05-13  6:36       ` Diego Sueiro
2020-05-13 13:41         ` Ross Burton
2020-05-13  6:22     ` Diego Sueiro [this message]
2020-05-12 21:12   ` [meta-arm][PATCH v2 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
2020-05-13 17:31     ` Denys Dmytriyenko
2020-05-13 15:47 ` [meta-arm][PATCH v3 0/2] TF-A Improvement Joshua Watt
2020-05-13 15:47   ` [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree Joshua Watt
2020-05-13 16:19     ` Diego Sueiro
2020-05-13 17:27     ` Denys Dmytriyenko
2020-05-13 17:57       ` Joshua Watt
     [not found]     ` <160EA693C79E8869.18093@lists.yoctoproject.org>
2020-05-13 17:37       ` Denys Dmytriyenko
2020-05-13 21:49         ` Jon Mason
2020-05-13 15:47   ` [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
2020-05-13 16:19     ` Diego Sueiro
2020-05-13 17:33     ` Denys Dmytriyenko
2020-05-13 17:54       ` Joshua Watt
2020-05-13 21:50         ` Jon Mason

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=AM0PR08MB39875A36D047820F57F17C6A92BF0@AM0PR08MB3987.eurprd08.prod.outlook.com \
    --to=diego.sueiro@arm.com \
    --cc=JPEWhacker@gmail.com \
    --cc=meta-arm@lists.yoctoproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.