Patchwork [1/1] meta-skeleton: linux-yocto-custom.bb: use machine overrides

login
register
mail settings
Submitter Nitin A Kamble
Date April 11, 2014, 5:05 p.m.
Message ID <f1c400fe717177e267c91a497143bc0267b5fe17.1397235602.git.nitin.a.kamble@intel.com>
Download mbox | patch
Permalink /patch/70527/
State New
Headers show

Comments

Nitin A Kamble - April 11, 2014, 5:05 p.m.
From: Nitin A Kamble <nitin.a.kamble@intel.com>

Use machine overrides for variables for this skeleton recipe so that
people following skeleton do it right at the beginning.

The machine overrides for the variables reduces pollution of name space
and avoid unintentional influences on other layers.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
---
 meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Darren Hart - April 11, 2014, 5:18 p.m.
On 4/11/14, 10:05, "Kamble, Nitin A" <nitin.a.kamble@intel.com> wrote:

>From: Nitin A Kamble <nitin.a.kamble@intel.com>
>
>Use machine overrides for variables for this skeleton recipe so that
>people following skeleton do it right at the beginning.
>
>The machine overrides for the variables reduces pollution of name space
>and avoid unintentional influences on other layers.
>
>Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
>---
> meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
>b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
>index c329106..76457ca 100644
>--- a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
>+++ b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
>@@ -46,10 +46,10 @@ require recipes-kernel/linux/linux-yocto.inc
> 
> # Override SRC_URI in a bbappend file to point at a different source
> # tree if you do not want to build from Linus' tree.
>-SRC_URI = 
>"git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol
>=git;nocheckout=1;name=machine"
>+SRC_URI_machine =
>"git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol
>=git;nocheckout=1;name=machine"
> 
>-LINUX_VERSION ?= "3.4"
>-LINUX_VERSION_EXTENSION ?= "-custom"
>+LINUX_VERSION_machine ?= "3.4"
>+LINUX_VERSION_EXTENSION_machine ?= "-custom"
> 
> # Override SRCREV to point to a different commit in a bbappend file to
> # build a different release of the Linux kernel.
>@@ -61,4 +61,4 @@ PV = "${LINUX_VERSION}+git${SRCPV}"
> 
> # Override COMPATIBLE_MACHINE to include your machine in a bbappend
> # file. Leaving it empty here ensures an early explicit build failure.
>-COMPATIBLE_MACHINE = "(^$)"
>+COMPATIBLE_MACHINE_machine = "(^$)"


Might as well change this to:

COMPATIBLE_MACHINE_machine = "machine"

And then add a comment at the top to remind people to replace "machine"
with their BSP name.
Bruce Ashfield - April 11, 2014, 5:48 p.m.
On 14-04-11 01:05 PM, nitin.a.kamble@intel.com wrote:
> From: Nitin A Kamble <nitin.a.kamble@intel.com>
>
> Use machine overrides for variables for this skeleton recipe so that
> people following skeleton do it right at the beginning.
>
> The machine overrides for the variables reduces pollution of name space
> and avoid unintentional influences on other layers.
>
> Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
> ---
>   meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
> index c329106..76457ca 100644
> --- a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
> +++ b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
> @@ -46,10 +46,10 @@ require recipes-kernel/linux/linux-yocto.inc
>
>   # Override SRC_URI in a bbappend file to point at a different source
>   # tree if you do not want to build from Linus' tree.
> -SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol=git;nocheckout=1;name=machine"
> +SRC_URI_machine = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol=git;nocheckout=1;name=machine"
>
> -LINUX_VERSION ?= "3.4"
> -LINUX_VERSION_EXTENSION ?= "-custom"
> +LINUX_VERSION_machine ?= "3.4"
> +LINUX_VERSION_EXTENSION_machine ?= "-custom"

For some reason, I thought you meant ${MACHINE} instead of _machine .. which
is what I use for machine specific overrides.

But assuming this works, i have no objections.

Bruce

>
>   # Override SRCREV to point to a different commit in a bbappend file to
>   # build a different release of the Linux kernel.
> @@ -61,4 +61,4 @@ PV = "${LINUX_VERSION}+git${SRCPV}"
>
>   # Override COMPATIBLE_MACHINE to include your machine in a bbappend
>   # file. Leaving it empty here ensures an early explicit build failure.
> -COMPATIBLE_MACHINE = "(^$)"
> +COMPATIBLE_MACHINE_machine = "(^$)"
>
z
Nitin A Kamble - April 11, 2014, 5:53 p.m.
On 4/11/2014 10:48 AM, Bruce Ashfield wrote:
> On 14-04-11 01:05 PM, nitin.a.kamble@intel.com wrote:
>> From: Nitin A Kamble <nitin.a.kamble@intel.com>
>>
>> Use machine overrides for variables for this skeleton recipe so that
>> people following skeleton do it right at the beginning.
>>
>> The machine overrides for the variables reduces pollution of name space
>> and avoid unintentional influences on other layers.
>>
>> Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
>> ---
>>   meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb 
>> b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
>> index c329106..76457ca 100644
>> --- a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
>> +++ b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
>> @@ -46,10 +46,10 @@ require recipes-kernel/linux/linux-yocto.inc
>>
>>   # Override SRC_URI in a bbappend file to point at a different source
>>   # tree if you do not want to build from Linus' tree.
>> -SRC_URI = 
>> "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol=git;nocheckout=1;name=machine"
>> +SRC_URI_machine = 
>> "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol=git;nocheckout=1;name=machine"
>>
>> -LINUX_VERSION ?= "3.4"
>> -LINUX_VERSION_EXTENSION ?= "-custom"
>> +LINUX_VERSION_machine ?= "3.4"
>> +LINUX_VERSION_EXTENSION_machine ?= "-custom"
>
> For some reason, I thought you meant ${MACHINE} instead of _machine .. 
> which
> is what I use for machine specific overrides.
I think macros can not used as overrides.
Nitin


>
> But assuming this works, i have no objections.
>
> Bruce
>
>>
>>   # Override SRCREV to point to a different commit in a bbappend file to
>>   # build a different release of the Linux kernel.
>> @@ -61,4 +61,4 @@ PV = "${LINUX_VERSION}+git${SRCPV}"
>>
>>   # Override COMPATIBLE_MACHINE to include your machine in a bbappend
>>   # file. Leaving it empty here ensures an early explicit build failure.
>> -COMPATIBLE_MACHINE = "(^$)"
>> +COMPATIBLE_MACHINE_machine = "(^$)"
>>
> z
Paul Eggleton - April 15, 2014, 4:54 p.m.
On Friday 11 April 2014 10:53:17 Kamble, Nitin A wrote:
> On 4/11/2014 10:48 AM, Bruce Ashfield wrote:
> > On 14-04-11 01:05 PM, nitin.a.kamble@intel.com wrote:
> >> From: Nitin A Kamble <nitin.a.kamble@intel.com>
> >> 
> >> Use machine overrides for variables for this skeleton recipe so that
> >> people following skeleton do it right at the beginning.
> >> 
> >> The machine overrides for the variables reduces pollution of name space
> >> and avoid unintentional influences on other layers.
> >> 
> >> Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
> >> ---
> >> 
> >>   meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb | 8 ++++----
> >>   1 file changed, 4 insertions(+), 4 deletions(-)
> >> 
> >> diff --git a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
> >> b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
> >> index c329106..76457ca 100644
> >> --- a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
> >> +++ b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
> >> @@ -46,10 +46,10 @@ require recipes-kernel/linux/linux-yocto.inc
> >> 
> >>   # Override SRC_URI in a bbappend file to point at a different source
> >>   # tree if you do not want to build from Linus' tree.
> >> 
> >> -SRC_URI =
> >> "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protoco
> >> l=git;nocheckout=1;name=machine" +SRC_URI_machine =
> >> "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protoco
> >> l=git;nocheckout=1;name=machine"
> >> 
> >> -LINUX_VERSION ?= "3.4"
> >> -LINUX_VERSION_EXTENSION ?= "-custom"
> >> +LINUX_VERSION_machine ?= "3.4"
> >> +LINUX_VERSION_EXTENSION_machine ?= "-custom"
> > 
> > For some reason, I thought you meant ${MACHINE} instead of _machine ..
> > which is what I use for machine specific overrides.
> 
> I think macros can not used as overrides.

Variable references can be used in overrides, provided the expansion happens 
at the right time. However, it would not be appropriate to use ${MACHINE} here 
because if it were used verbatim in the recipe, it would not have the desired 
effect - the value of ${MACHINE} would change with whatever MACHINE was set to, 
and since ${MACHINE} is always in OVERRIDES it would always be applied.

Cheers,
Paul
Darren Hart - April 15, 2014, 6:03 p.m.
On 4/15/14, 9:54, "Paul Eggleton" <paul.eggleton@linux.intel.com> wrote:

>On Friday 11 April 2014 10:53:17 Kamble, Nitin A wrote:
>> On 4/11/2014 10:48 AM, Bruce Ashfield wrote:
>> > On 14-04-11 01:05 PM, nitin.a.kamble@intel.com wrote:
>> >> From: Nitin A Kamble <nitin.a.kamble@intel.com>
>> >> 
>> >> Use machine overrides for variables for this skeleton recipe so that
>> >> people following skeleton do it right at the beginning.
>> >> 
>> >> The machine overrides for the variables reduces pollution of name
>>space
>> >> and avoid unintentional influences on other layers.
>> >> 
>> >> Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
>> >> ---
>> >> 
>> >>   meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb | 8
>>++++----
>> >>   1 file changed, 4 insertions(+), 4 deletions(-)
>> >> 
>> >> diff --git a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
>> >> b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
>> >> index c329106..76457ca 100644
>> >> --- a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
>> >> +++ b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
>> >> @@ -46,10 +46,10 @@ require recipes-kernel/linux/linux-yocto.inc
>> >> 
>> >>   # Override SRC_URI in a bbappend file to point at a different
>>source
>> >>   # tree if you do not want to build from Linus' tree.
>> >> 
>> >> -SRC_URI =
>> >> 
>>"git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protoco
>> >> l=git;nocheckout=1;name=machine" +SRC_URI_machine =
>> >> 
>>"git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protoco
>> >> l=git;nocheckout=1;name=machine"
>> >> 
>> >> -LINUX_VERSION ?= "3.4"
>> >> -LINUX_VERSION_EXTENSION ?= "-custom"
>> >> +LINUX_VERSION_machine ?= "3.4"
>> >> +LINUX_VERSION_EXTENSION_machine ?= "-custom"
>> > 
>> > For some reason, I thought you meant ${MACHINE} instead of _machine ..
>> > which is what I use for machine specific overrides.
>> 
>> I think macros can not used as overrides.
>
>Variable references can be used in overrides, provided the expansion
>happens 
>at the right time. However, it would not be appropriate to use ${MACHINE}
>here 
>because if it were used verbatim in the recipe, it would not have the
>desired 
>effect - the value of ${MACHINE} would change with whatever MACHINE was
>set to, 
>and since ${MACHINE} is always in OVERRIDES it would always be applied.
>
>Cheers,
>Paul
>
>-- 
>
>Paul Eggleton
>Intel Open Source Technology Centre
>

I think we should just drop the overrides. The overrides are needed with
linux-yocto bbappends so we don't pollute the namespace, but here there is
nothing to polute. This is the only recipe, you don't use bbappends with
it. It needs some documentation, but we should just drop all the overrides
in this recipe.
Paul Eggleton - April 15, 2014, 11:41 p.m.
On Tuesday 15 April 2014 18:03:45 Hart, Darren wrote:
> On 4/15/14, 9:54, "Paul Eggleton" <paul.eggleton@linux.intel.com> wrote:
> >On Friday 11 April 2014 10:53:17 Kamble, Nitin A wrote:
> >> On 4/11/2014 10:48 AM, Bruce Ashfield wrote:
> >> > On 14-04-11 01:05 PM, nitin.a.kamble@intel.com wrote:
> >> >> From: Nitin A Kamble <nitin.a.kamble@intel.com>
> >> >> 
> >> >> Use machine overrides for variables for this skeleton recipe so that
> >> >> people following skeleton do it right at the beginning.
> >> >> 
> >> >> The machine overrides for the variables reduces pollution of name
> >>
> >>space
> >>
> >> >> and avoid unintentional influences on other layers.
> >> >> 
> >> >> Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
> >> >> ---
> >> >> 
> >> >>   meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb | 8
> >>
> >>++++----
> >>
> >> >>   1 file changed, 4 insertions(+), 4 deletions(-)
> >> >> 
> >> >> diff --git a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
> >> >> b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
> >> >> index c329106..76457ca 100644
> >> >> --- a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
> >> >> +++ b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
> >> >> @@ -46,10 +46,10 @@ require recipes-kernel/linux/linux-yocto.inc
> >> >> 
> >> >>   # Override SRC_URI in a bbappend file to point at a different
> >>
> >>source
> >>
> >> >>   # tree if you do not want to build from Linus' tree.
> >> >> 
> >> >> -SRC_URI =
> >>
> >>"git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protoco
> >>
> >> >> l=git;nocheckout=1;name=machine" +SRC_URI_machine =
> >>
> >>"git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protoco
> >>
> >> >> l=git;nocheckout=1;name=machine"
> >> >> 
> >> >> -LINUX_VERSION ?= "3.4"
> >> >> -LINUX_VERSION_EXTENSION ?= "-custom"
> >> >> +LINUX_VERSION_machine ?= "3.4"
> >> >> +LINUX_VERSION_EXTENSION_machine ?= "-custom"
> >> > 
> >> > For some reason, I thought you meant ${MACHINE} instead of _machine ..
> >> > which is what I use for machine specific overrides.
> >> 
> >> I think macros can not used as overrides.
> >
> >Variable references can be used in overrides, provided the expansion
> >happens
> >at the right time. However, it would not be appropriate to use ${MACHINE}
> >here
> >because if it were used verbatim in the recipe, it would not have the
> >desired
> >effect - the value of ${MACHINE} would change with whatever MACHINE was
> >set to,
> >and since ${MACHINE} is always in OVERRIDES it would always be applied.
> 
> I think we should just drop the overrides. The overrides are needed with
> linux-yocto bbappends so we don't pollute the namespace, but here there is
> nothing to polute. This is the only recipe, you don't use bbappends with
> it. It needs some documentation, but we should just drop all the overrides
> in this recipe.

I think you're probably right with the way this recipe is intended to be used, 
yes.

Cheers,
Paul
Nitin A Kamble - April 18, 2014, 4:12 p.m.
> > >
> > >Variable references can be used in overrides, provided the expansion
> > >happens at the right time. However, it would not be appropriate to
> > >use ${MACHINE} here because if it were used verbatim in the recipe,
> > >it would not have the desired effect - the value of ${MACHINE} would
> > >change with whatever MACHINE was set to, and since ${MACHINE} is
> > >always in OVERRIDES it would always be applied.
> >
> > I think we should just drop the overrides. The overrides are needed
> > with linux-yocto bbappends so we don't pollute the namespace, but here
> > there is nothing to polute. This is the only recipe, you don't use
> > bbappends with it. It needs some documentation, but we should just
> > drop all the overrides in this recipe.
> 
> I think you're probably right with the way this recipe is intended to be used,
> yes.
> 

So shall we leave this recipe unchanged? As the commit was made to avoid the
unwanted recipe variable pollution across layers, which is not the case.

Nitin

> Cheers,
> Paul
> 
> --
> 
> Paul Eggleton
> Intel Open Source Technology Centre

Patch

diff --git a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
index c329106..76457ca 100644
--- a/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
+++ b/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
@@ -46,10 +46,10 @@  require recipes-kernel/linux/linux-yocto.inc
 
 # Override SRC_URI in a bbappend file to point at a different source
 # tree if you do not want to build from Linus' tree.
-SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol=git;nocheckout=1;name=machine"
+SRC_URI_machine = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol=git;nocheckout=1;name=machine"
 
-LINUX_VERSION ?= "3.4"
-LINUX_VERSION_EXTENSION ?= "-custom"
+LINUX_VERSION_machine ?= "3.4"
+LINUX_VERSION_EXTENSION_machine ?= "-custom"
 
 # Override SRCREV to point to a different commit in a bbappend file to
 # build a different release of the Linux kernel.
@@ -61,4 +61,4 @@  PV = "${LINUX_VERSION}+git${SRCPV}"
 
 # Override COMPATIBLE_MACHINE to include your machine in a bbappend
 # file. Leaving it empty here ensures an early explicit build failure.
-COMPATIBLE_MACHINE = "(^$)"
+COMPATIBLE_MACHINE_machine = "(^$)"