public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Luca Ceresoli <luca.ceresoli@bootlin.com>
To: "Petr Kubizňák" <kubiznak@2n.com>
Cc: <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core][PATCH] devicetree.bbclass: Allow selection of dts files to build
Date: Fri, 21 Apr 2023 09:40:53 +0200	[thread overview]
Message-ID: <20230421094053.317c2d9c@booty> (raw)
In-Reply-To: <20230420114046.873360-1-kubiznak@2n.com>

Hello Petr,

On Thu, 20 Apr 2023 13:40:46 +0200
Petr Kubizňák <kubiznak@2n.com> wrote:

> Add DT_FILES variable to allow the user of the class to select specific
> dts files to build. This is useful for packages featuring dts files
> for multiple machines.
> 
> Since many machine configs contain a list of dtb files
> (e.g. KERNEL_DEVICETREE), DT_FILES works with both dts and dtb files.
> 
> Signed-off-by: Petr Kubizňák <kubiznak@2n.com>
> ---
>  meta/classes-recipe/devicetree.bbclass | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes-recipe/devicetree.bbclass b/meta/classes-recipe/devicetree.bbclass
> index ed2a92e447..fb73c44e22 100644
> --- a/meta/classes-recipe/devicetree.bbclass
> +++ b/meta/classes-recipe/devicetree.bbclass
> @@ -53,8 +53,10 @@ KERNEL_INCLUDE ??= " \
>  
>  DT_INCLUDE[doc] = "Search paths to be made available to both the device tree compiler and preprocessor for inclusion."
>  DT_INCLUDE ?= "${DT_FILES_PATH} ${KERNEL_INCLUDE}"
> -DT_FILES_PATH[doc] = "Defaults to source directory, can be used to select dts files that are not in source (e.g. generated)."
> +DT_FILES_PATH[doc] = "Path to the directory containing dts files to build. Defaults to source directory."
>  DT_FILES_PATH ?= "${S}"
> +DT_FILES[doc] = "Space-separated list of dts or dtb files to build. If empty, all dts files are built."
> +DT_FILES ?= ""
>  
>  DT_PADDING_SIZE[doc] = "Size of padding on the device tree blob, used as extra space typically for additional properties during boot."
>  DT_PADDING_SIZE ??= "0x3000"
> @@ -125,7 +127,10 @@ def devicetree_compile(dtspath, includes, d):
>      subprocess.run(dtcargs, check = True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
>  
>  python devicetree_do_compile() {
> +    import re
>      includes = expand_includes("DT_INCLUDE", d)
> +    dtfiles = d.getVar("DT_FILES")
> +    filter = [ re.sub('dtb[o]?', 'dts', dtfile) for dtfile in dtfiles.split() ]

I think the regexp be simplified as 'dtbo?', right?

Otherwise looks good.

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


      reply	other threads:[~2023-04-21  7:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 11:40 [OE-core][PATCH] devicetree.bbclass: Allow selection of dts files to build Petr Kubizňák
2023-04-21  7:40 ` Luca Ceresoli [this message]

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=20230421094053.317c2d9c@booty \
    --to=luca.ceresoli@bootlin.com \
    --cc=kubiznak@2n.com \
    --cc=openembedded-core@lists.openembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox