All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin Jansa" <Martin.Jansa@gmail.com>
To: Andrea Adami <andrea.adami@gmail.com>
Cc: Andrey Zhizhikin <andrey.z@gmail.com>,
	Peter Kjellerstedt <peter.kjellerstedt@axis.com>,
	"openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core][PATCH 2/2] kernel.bbclass: inherit kernel_devicetree only if KERNEL_DEVICETREE is set
Date: Wed, 23 Jun 2021 18:02:22 +0200	[thread overview]
Message-ID: <20210623160222.ftqara6lcqmn4vgj@jama> (raw)
In-Reply-To: <CAAQYJAv9ear6oUz8c1c5QaFyMfxuVG7xN==dfpC+yXPQJNdgwg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3166 bytes --]

On Wed, Jun 23, 2021 at 05:22:21PM +0200, Andrea Adami wrote:
> On Wed, Jun 23, 2021 at 3:51 PM Andrey Zhizhikin <andrey.z@gmail.com> wrote:
> >
> > Hello Andrea,
> >
> > On Wed, Jun 23, 2021 at 3:16 PM Andrea Adami <andrea.adami@gmail.com> wrote:
> > >
> > > On Wed, Jun 23, 2021 at 11:32 AM Peter Kjellerstedt
> > > <peter.kjellerstedt@axis.com> wrote:
> > > >
> > > > > -----Original Message-----
> > > > > From: openembedded-core@lists.openembedded.org <openembedded-
> > > > > core@lists.openembedded.org> On Behalf Of Andrea Adami
> > > > > Sent: den 23 juni 2021 00:18
> > > > > To: openembedded-core@lists.openembedded.org
> > > > > Subject: [OE-core][PATCH 2/2] kernel.bbclass: inherit kernel_devicetree
> > > > > only if KERNEL_DEVICETREE is set
> > > > >
> > > > > Now it unconditionally tries to create package kernel-devicetre even for
> > > > > legacy devices w/out DT.
> > > > >
> > > > > Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
> > > > > ---
> > > > >  meta/classes/kernel.bbclass | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> > > > > index 06e6446a08..68369e3791 100644
> > > > > --- a/meta/classes/kernel.bbclass
> > > > > +++ b/meta/classes/kernel.bbclass
> > > > > @@ -779,4 +779,4 @@ addtask deploy after do_populate_sysroot
> > > > > do_packagedata
> > > > >  EXPORT_FUNCTIONS do_deploy
> > > > >
> > > > >  # Add using Device Tree support
> > > > > -inherit kernel-devicetree
> > > > > +inherit ${@ "" if d.getVar("KERNEL_DEVICETREE" == "") else "kernel-devicetree" }
> > > >
> > > > That doesn't look correct. Don't you mean something like this:
> > > >
> > > > inherit ${@ "kernel-devicetree" if d.getVar("KERNEL_DEVICETREE") else "" }
> > > >
> > >
> > > As you prefer, I don't think bitbake has likely/unlikely optimization.
> > > I took the style-example from line 6 where it reads
> > >
> > > KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") ==
> > > "kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
> > >
> > > I am for any option providing a guard.
> >
> > I guess you've missed the closing bracket in your statement, please
> > take a look at the comparison operator.
> 
> The code as it is doesn't raise any parse error.
> There is opening bracket and closing bracket, what more?

d.getVar("KERNEL_DEVICETREE" == "")
vs
d.getVar("KERNEL_DEVICETREE") == ""

> We can discuss about the form, someone suggested anonymous python for
> both patches.
> 
> Thanks for reviewing
> A.A.
> 
> >
> > As yet another option, maybe even something like this:
> > inherit ${@oe.utils.ifelse(d.getVar('KERNEL_DEVICETREE') == '', '',
> > 'kernel-devicetree')}
> >
> > However, I'm not sure what would happened if KERNEL_DEVICETREE is
> > undefined, as in this case bitbake should return "None" according to
> > the documentation.
> >
> > >
> > > Cheers
> > > A.A.
> > >
> > >
> > > > > --
> > > > > 2.17.1
> > > >
> > > > //Peter
> > > >
> > >
> > > 
> > >
> >
> >
> > --
> > Regards,
> > Andrey.

> 
> 
> 


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

  reply	other threads:[~2021-06-23 16:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 22:18 [OE-core][PATCH 1/2] kernel.bbclass: run read_package_metadata only if packaging is enabled Andrea Adami
2021-06-22 22:18 ` [OE-core][PATCH 2/2] kernel.bbclass: inherit kernel_devicetree only if KERNEL_DEVICETREE is set Andrea Adami
2021-06-23  9:32   ` Peter Kjellerstedt
2021-06-23 13:12     ` Andrea Adami
2021-06-23 13:51       ` Andrey Zhizhikin
2021-06-23 15:22         ` Andrea Adami
2021-06-23 16:02           ` Martin Jansa [this message]
2021-06-23 19:26             ` Andrea Adami
2021-06-22 22:52 ` [OE-core][PATCH 1/2] kernel.bbclass: run read_package_metadata only if packaging is enabled Richard Purdie
2021-06-22 22:59   ` Andrea Adami

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=20210623160222.ftqara6lcqmn4vgj@jama \
    --to=martin.jansa@gmail.com \
    --cc=andrea.adami@gmail.com \
    --cc=andrey.z@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=peter.kjellerstedt@axis.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 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.