Re: [yocto] Path to current bb-file or layer

2017-09-22 Thread Svein Seldal
On 22. sep. 2017 13:42, Richard Purdie wrote: A better way to get what you're after may be to look at the contents of BBINCLUDED. Ah, yes. Perfect. You got me onto a lead: Setting SP_BASEDIR := "${LAYERDIR}" in layer.conf and then access this variable from the bbclass file. Although I

Re: [yocto] Path to current bb-file or layer

2017-09-22 Thread Richard Purdie
On Fri, 2017-09-22 at 13:04 +0200, Svein Seldal wrote: > On 22. sep. 2017 10:30, Richard Purdie wrote: > > Its all about when your code is executed. Try putting: > >  > > SP_BASEVERSION := "${@read_spbaseversion(d)}" > >  > > in the bbclass file. I suspect that will give you the bbclass file > >

Re: [yocto] Path to current bb-file or layer

2017-09-22 Thread Svein Seldal
On 22. sep. 2017 10:30, Richard Purdie wrote: > Its all about when your code is executed. Try putting: > > SP_BASEVERSION := "${@read_spbaseversion(d)}" > > in the bbclass file. I suspect that will give you the bbclass file > name. > > By default everything is deferred expansion so your code

Re: [yocto] Path to current bb-file or layer

2017-09-22 Thread Richard Purdie
On Fri, 2017-09-22 at 10:17 +0200, Svein Seldal wrote: > On 21. sep. 2017 23:36, Richard Purdie wrote: >  > You mean like ${FILE} ? >  > >  > $ bitbake bash -e | grep ^FILE= >  > FILE="/media/build1/poky/meta/recipes-extended/bash/bash_4.4.bb" > > To me ${FILE} seems to be pointing towards the

Re: [yocto] Path to current bb-file or layer

2017-09-22 Thread Svein Seldal
On 21. sep. 2017 23:36, Richard Purdie wrote: > You mean like ${FILE} ? > > $ bitbake bash -e | grep ^FILE= > FILE="/media/build1/poky/meta/recipes-extended/bash/bash_4.4.bb" To me ${FILE} seems to be pointing towards the receipe, and not the current .bbclass file as you'd expect. If I put

Re: [yocto] Path to current bb-file or layer

2017-09-21 Thread Richard Purdie
On Thu, 2017-09-21 at 22:00 +0200, Svein Seldal wrote: > To determine a image version, I'd like to read a VERSION file which > is  > located in the root of the layer. (Per our development procedure.) > I'd  > like to read it from a bbclass file. However I seem to be unable to > find  > any methods

Re: [yocto] Path to current bb-file or layer

2017-09-21 Thread Andre McCurdy
On Thu, Sep 21, 2017 at 1:00 PM, Svein Seldal wrote: > > To determine a image version, I'd like to read a VERSION file which is > located in the root of the layer. (Per our development procedure.) I'd like > to read it from a bbclass file. However I seem to be unable to find

[yocto] Path to current bb-file or layer

2017-09-21 Thread Svein Seldal
To determine a image version, I'd like to read a VERSION file which is located in the root of the layer. (Per our development procedure.) I'd like to read it from a bbclass file. However I seem to be unable to find any methods or variables to find a useful path to either the current bb-file