Patchwork [3/6] Add new IMAGE_CLASSES variable for classes for image generation

login
register
mail settings
Submitter Matthew McClintock
Date Oct. 4, 2011, 10:03 p.m.
Message ID <1317765787-19127-3-git-send-email-msm@freescale.com>
Download mbox | patch
Permalink /patch/12753/
State New, archived
Headers show

Comments

Matthew McClintock - Oct. 4, 2011, 10:03 p.m.
Allows us to import classes only for images and not to the global
namespace

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
Work around to solve issue from this thread:

https://lists.yoctoproject.org/pipermail/yocto/2011-September/005059.html

 meta/classes/image.bbclass |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
McClintock Matthew-B29882 - Oct. 5, 2011, 10:52 p.m.
On Tue, Oct 4, 2011 at 5:03 PM, Matthew McClintock <msm@freescale.com> wrote:
> -inherit image_types
> +IMAGE_CLASESS ??= ""
> +inherit image_types ${IMAGE_CLASSES}

So this does not work properly, I thought I tested it but... need to
do something like this:

IMAGE_CLASSES = "image_types"
inherit ${IMAGE_CLASSES}

then let the user added via

IMAGE_CLASESS += "image_types_uboot"

then there will always be something that is expanded to avoid this issue:

ERROR: Could not inherit file classes/$IMAGE_CLASSES.bbclass
                           | ETA:  --:--:--
ERROR: Command execution failed: Exited with 1

or

ERROR: Could not inherit file classes/.bbclass
             | ETA:  --:--:--
ERROR: Command execution failed: Exited with 1

-M
Richard Purdie - Oct. 5, 2011, 11:53 p.m.
On Wed, 2011-10-05 at 22:52 +0000, McClintock Matthew-B29882 wrote:
> On Tue, Oct 4, 2011 at 5:03 PM, Matthew McClintock <msm@freescale.com> wrote:
> > -inherit image_types
> > +IMAGE_CLASESS ??= ""
> > +inherit image_types ${IMAGE_CLASSES}
> 
> So this does not work properly, I thought I tested it but... need to
> do something like this:
> 
> IMAGE_CLASSES = "image_types"
> inherit ${IMAGE_CLASSES}
> 
> then let the user added via
> 
> IMAGE_CLASESS += "image_types_uboot"
> 
> then there will always be something that is expanded to avoid this issue:
> 
> ERROR: Could not inherit file classes/$IMAGE_CLASSES.bbclass
>                            | ETA:  --:--:--
> ERROR: Command execution failed: Exited with 1

Its not expanding the variables? :/ This happened even when
IMAGE_CLASSES had a value before the inherit?

> or
> 
> ERROR: Could not inherit file classes/.bbclass
>              | ETA:  --:--:--
> ERROR: Command execution failed: Exited with 1

I'd be prepared to call this last one a bitbake bug...

Cheers,

Richard
McClintock Matthew-B29882 - Oct. 6, 2011, 12:25 a.m.
On Wed, Oct 5, 2011 at 6:53 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>> So this does not work properly, I thought I tested it but... need to
>> do something like this:
>>
>> IMAGE_CLASSES = "image_types"
>> inherit ${IMAGE_CLASSES}
>>
>> then let the user added via
>>
>> IMAGE_CLASESS += "image_types_uboot"
>>
>> then there will always be something that is expanded to avoid this issue:
>>
>> ERROR: Could not inherit file classes/$IMAGE_CLASSES.bbclass
>>                            | ETA:  --:--:--
>> ERROR: Command execution failed: Exited with 1
>
> Its not expanding the variables? :/ This happened even when
> IMAGE_CLASSES had a value before the inherit?

If I added a IMAGE_CLASSES to something other than "" it worked fine.
If I left it as "" it tried to expand the blank var and look in the
BBPATHS or wherever it looks for classes for an unnamed ".bbclass"
file.

-M
McClintock Matthew-B29882 - Oct. 11, 2011, 4:44 p.m.
On Wed, Oct 5, 2011 at 7:24 PM, Matthew McClintock <msm@freescale.com> wrote:
>> Its not expanding the variables? :/ This happened even when
>> IMAGE_CLASSES had a value before the inherit?
>
> If I added a IMAGE_CLASSES to something other than "" it worked fine.
> If I left it as "" it tried to expand the blank var and look in the
> BBPATHS or wherever it looks for classes for an unnamed ".bbclass"
> file.

>> IMAGE_CLASSES = "image_types"
>> inherit ${IMAGE_CLASSES}

Should I update this patch to look like the above? Tracking down the
bitbake issue will be a little more involved for me =)

-M

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index f17e989..f03df5b 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_CLASESS ??= ""
+inherit image_types ${IMAGE_CLASSES}
 
 IMAGE_POSTPROCESS_COMMAND ?= ""
 MACHINE_POSTPROCESS_COMMAND ?= ""