Patchwork Add new IMAGE_CLASSES variable for classes for image generation

login
register
mail settings
Submitter Matthew McClintock
Date Oct. 28, 2011, 7:26 a.m.
Message ID <1319786807-9015-1-git-send-email-msm@freescale.com>
Download mbox | patch
Permalink /patch/13983/
State New, archived
Headers show

Comments

Matthew McClintock - Oct. 28, 2011, 7:26 a.m.
Allows us to import classes only for images and not to the global
namespace

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
This is a resend

 meta-yocto/conf/local.conf.sample |    6 ++++++
 meta/classes/image.bbclass        |    3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)
Saul Wold - Nov. 2, 2011, 12:31 a.m.
On 10/28/2011 12:26 AM, Matthew McClintock wrote:
> Allows us to import classes only for images and not to the global
> namespace
>
> Signed-off-by: Matthew McClintock<msm@freescale.com>
> ---
> This is a resend
>
>   meta-yocto/conf/local.conf.sample |    6 ++++++
>   meta/classes/image.bbclass        |    3 ++-
>   2 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/meta-yocto/conf/local.conf.sample b/meta-yocto/conf/local.conf.sample
> index da3f8df..5e59ad4 100644
> --- a/meta-yocto/conf/local.conf.sample
> +++ b/meta-yocto/conf/local.conf.sample
> @@ -163,6 +163,12 @@ EXTRA_IMAGE_FEATURES = "debug-tweaks"
>   # NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
>   USER_CLASSES ?= "image-mklibs image-prelink"
>
> +# Additional image generation features
> +#
> +# The following is a list of classes to import to use in the generation of images
> +# currently an example class is image_types_uboot
> +# IMAGE_CLASSES ?= "image_types_uboot"
> +
>   #
>   # Runtime testing of images
>   #
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 05f4331..e932879 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -111,7 +111,8 @@ def get_devtable_list(d):
>           str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable)
>       return str
>
> -inherit image_types
> +IMAGE_CLASSES = "image_types"
> +inherit ${IMAGE_CLASSES}
>
Does this really work with =, should it not be ?= here?

Sau!

>   IMAGE_POSTPROCESS_COMMAND ?= ""
>   MACHINE_POSTPROCESS_COMMAND ?= ""
McClintock Matthew-B29882 - Nov. 2, 2011, 12:50 a.m.
On Tue, Nov 1, 2011 at 7:31 PM, Saul Wold <saul.wold@intel.com> wrote:
>> +# Additional image generation features
>> +#
>> +# The following is a list of classes to import to use in the generation
>> of images
>> +# currently an example class is image_types_uboot
>> +# IMAGE_CLASSES ?= "image_types_uboot"
>> +
>>  #
>>  # Runtime testing of images
>>  #
>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>> index 05f4331..e932879 100644
>> --- a/meta/classes/image.bbclass
>> +++ b/meta/classes/image.bbclass
>> @@ -111,7 +111,8 @@ def get_devtable_list(d):
>>          str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable)
>>      return str
>>
>> -inherit image_types
>> +IMAGE_CLASSES = "image_types"
>> +inherit ${IMAGE_CLASSES}
>>
> Does this really work with =, should it not be ?= here?

Ugh. No. This was an attempt to fix this:

+IMAGE_CLASSES ??= ""
+inherit image_types ${IMAGE_CLASSES}

which gives the following bitbake error:

ERROR: classes/.bbclass is not a BitBake file
ERROR: Command execution failed: Exited with 1

when IMAGE_CLASSES is left as "". It's trying to inherit a ".bbclass"
file. There is no good alternative because I have to enforce
IMAGE_CLASSES is only modified by appending to it. So the only
solution is to modifed the local.conf.sample to say

IMAGE_CLASSES += "image_types_uboot" and leave the other bit as is...

-M
McClintock Matthew-B29882 - Nov. 2, 2011, 12:54 a.m.
On Tue, Nov 1, 2011 at 7:50 PM, McClintock Matthew-B29882
<B29882@freescale.com> wrote:
> IMAGE_CLASSES += "image_types_uboot" and leave the other bit as is...

Except it seems I have to do this:

IMAGE_CLASSES_append = " image_types_uboot"

if I want the value to actually be appended.

-M
Saul Wold - Nov. 2, 2011, 12:56 a.m.
On 11/01/2011 05:50 PM, McClintock Matthew-B29882 wrote:
> On Tue, Nov 1, 2011 at 7:31 PM, Saul Wold<saul.wold@intel.com>  wrote:
>>> +# Additional image generation features
>>> +#
>>> +# The following is a list of classes to import to use in the generation
>>> of images
>>> +# currently an example class is image_types_uboot
>>> +# IMAGE_CLASSES ?= "image_types_uboot"
>>> +
>>>   #
>>>   # Runtime testing of images
>>>   #
>>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>>> index 05f4331..e932879 100644
>>> --- a/meta/classes/image.bbclass
>>> +++ b/meta/classes/image.bbclass
>>> @@ -111,7 +111,8 @@ def get_devtable_list(d):
>>>           str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable)
>>>       return str
>>>
>>> -inherit image_types
>>> +IMAGE_CLASSES = "image_types"
>>> +inherit ${IMAGE_CLASSES}
>>>
>> Does this really work with =, should it not be ?= here?
>
> Ugh. No. This was an attempt to fix this:
>
> +IMAGE_CLASSES ??= ""
> +inherit image_types ${IMAGE_CLASSES}
>
> which gives the following bitbake error:
>
> ERROR: classes/.bbclass is not a BitBake file
> ERROR: Command execution failed: Exited with 1
>
> when IMAGE_CLASSES is left as "". It's trying to inherit a ".bbclass"
> file. There is no good alternative because I have to enforce
> IMAGE_CLASSES is only modified by appending to it. So the only
> solution is to modifed the local.conf.sample to say
>
Right I understood that part from before I think.  But why can't you have

IMAGE_CLASSES ?= "image_types"

and then in the local.conf override that with

IMAGE_CLASSES = "image_types_uboot"

since image_types_uboot inherits image_types.

> IMAGE_CLASSES += "image_types_uboot" and leave the other bit as is...

I have to admit I like this a little better with the possible thought of 
breaking up image_types a little more, keep more used ones in 
image_types, but move lesser used ones to their on .bbclass

Them IMAGE_CLASSES truly is a list of image_type classes.

Sau!


> -M
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
McClintock Matthew-B29882 - Nov. 2, 2011, 3:03 p.m.
On Tue, Nov 1, 2011 at 7:56 PM, Saul Wold <saul.wold@intel.com> wrote:
> Right I understood that part from before I think.  But why can't you have
>
> IMAGE_CLASSES ?= "image_types"
>
> and then in the local.conf override that with
>
> IMAGE_CLASSES = "image_types_uboot"
>
> since image_types_uboot inherits image_types.
>
>> IMAGE_CLASSES += "image_types_uboot" and leave the other bit as is...
>
> I have to admit I like this a little better with the possible thought of
> breaking up image_types a little more, keep more used ones in image_types,
> but move lesser used ones to their on .bbclass
>
> Them IMAGE_CLASSES truly is a list of image_type classes.

I think this is best, let the user override IMAGE_CLASSES to
(eventually) be able to add individual image_types_XYZ. Will send new
patch.

-M

Patch

diff --git a/meta-yocto/conf/local.conf.sample b/meta-yocto/conf/local.conf.sample
index da3f8df..5e59ad4 100644
--- a/meta-yocto/conf/local.conf.sample
+++ b/meta-yocto/conf/local.conf.sample
@@ -163,6 +163,12 @@  EXTRA_IMAGE_FEATURES = "debug-tweaks"
 # NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
 USER_CLASSES ?= "image-mklibs image-prelink"
 
+# Additional image generation features
+#
+# The following is a list of classes to import to use in the generation of images
+# currently an example class is image_types_uboot
+# IMAGE_CLASSES ?= "image_types_uboot"
+
 #
 # Runtime testing of images
 #
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 05f4331..e932879 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -111,7 +111,8 @@  def get_devtable_list(d):
         str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable)
     return str
 
-inherit image_types
+IMAGE_CLASSES = "image_types"
+inherit ${IMAGE_CLASSES}
 
 IMAGE_POSTPROCESS_COMMAND ?= ""
 MACHINE_POSTPROCESS_COMMAND ?= ""