On Wed, Jun 23, 2021 at 05:22:21PM +0200, Andrea Adami wrote:
> On Wed, Jun 23, 2021 at 3:51 PM Andrey Zhizhikin <andre...@gmail.com> wrote:
> >
> > Hello Andrea,
> >
> > On Wed, Jun 23, 2021 at 3:16 PM Andrea Adami <andrea.ad...@gmail.com> wrote:
> > >
> > > On Wed, Jun 23, 2021 at 11:32 AM Peter Kjellerstedt
> > > <peter.kjellerst...@axis.com> wrote:
> > > >
> > > > > -----Original Message-----
> > > > > From: openembedded-core@lists.openembedded.org <openembedded-
> > > > > c...@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.ad...@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: signature.asc
Description: PGP signature

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#153244): 
https://lists.openembedded.org/g/openembedded-core/message/153244
Mute This Topic: https://lists.openembedded.org/mt/83725509/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to