Skip to contentSkip to conversation

Add new IMAGE_CLASSES variable for classes for image generation

PATCH Superseded Matthew McClintock 4 participants 10 messages Oct 28, 2011 – Nov 8, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add new IMAGE_CLASSES variable for classes for image generation

Allows us to import classes only for images and not to the global namespace

---
This is a resend

 meta-yocto/conf/local.conf.sample |    6 ++++++
 meta/classes/image.bbclass        |    3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)
meta-yocto/conf/local.conf.sample +6 -0
index da3f8df..5e59ad4 100644
@@ -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
 #
meta/classes/image.bbclass +2 -1
index 05f4331..e932879 100644
@@ -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 ?= ""
Signature · 1 line
1.7.6.1
#1 lore raw
Quoted 33 lines · Matthew McClintock

Allows us to import classes only for images and not to the global namespace

---
This is a resend

  meta-yocto/conf/local.conf.sample |    6 ++++++
  meta/classes/image.bbclass        |    3 ++-
  2 files changed, 8 insertions(+), 1 deletions(-)
meta-yocto/conf/local.conf.sample +6 -0
index da3f8df..5e59ad4 100644
@@ -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
  #
meta/classes/image.bbclass +0 -0
index 05f4331..e932879 100644

meta/classes/image.bbclass def get_devtable_list(d): · line 116

Quoted 7 lines
meta/classes/image.bbclass +2 -1
@@ -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!

Quoted 2 lines
meta/classes/image.bbclass +0 -0
  IMAGE_POSTPROCESS_COMMAND ?= ""
  MACHINE_POSTPROCESS_COMMAND ?= ""
#2 lore raw
Quoted 18 lines · Saul Wold
Quoted 18 lines
meta-yocto/conf/local.conf.sample +3 -0
+# Additional image generation features
+#
+# The following is a list of classes to import to use in the generation

of images

meta-yocto/conf/local.conf.sample +3 -0
+# currently an example class is image_types_uboot
+# IMAGE_CLASSES ?= "image_types_uboot"
+

 #
 # Runtime testing of images
 #

meta/classes/image.bbclass +0 -0
index 05f4331..e932879 100644
@@ -111,7 +111,8 @@ def get_devtable_list(d):
          str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable)

     return str

Quoted 5 lines

meta/classes/image.bbclass def get_devtable_list(d): · line 115

Quoted 4 lines
meta/classes/image.bbclass +2 -1
-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

#3 lore raw
Quoted 1 line · On Tue, Nov 1, 2011 at 7:50 PM, McClintock Matthew-B29882…

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

#4 lore raw
In reply to McClintock Matthew-B29882
Quoted 32 lines · On 11/01/2011 05:50 PM, McClintock Matthew-B29882 wrote:
Quoted 18 lines · Saul Wold
Quoted 18 lines
meta-yocto/conf/local.conf.sample +3 -0
+# Additional image generation features
+#
+# The following is a list of classes to import to use in the generation

of images

meta-yocto/conf/local.conf.sample +3 -0
+# currently an example class is image_types_uboot
+# IMAGE_CLASSES ?= "image_types_uboot"
+
  #
  # Runtime testing of images
  #
meta/classes/image.bbclass +0 -0
index 05f4331..e932879 100644
@@ -111,7 +111,8 @@ def get_devtable_list(d):
          str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable)
      return str
 
Quoted 5 lines

meta/classes/image.bbclass def get_devtable_list(d): · line 116

Quoted 4 lines
meta/classes/image.bbclass +2 -1
-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:

(quoted diff) +2 -0
+IMAGE_CLASSES ??= ""
+inherit image_types ${IMAGE_CLASSES}

which gives the following bitbake error:

Quoted 8 lines

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.

Quoted 1 line

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!

Quoted 7 lines

-M

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#5 lore raw
Quoted 10 lines · Saul Wold

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.

Quoted 7 lines
Quoted 1 line

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

#6 lore raw

PATCH v2 1/1 Add new IMAGE_CLASSES variable for classes for image generation

Allows us to import classes only for images and not to the global namespace

---
Change IMAGE_CLASSES definition to use ?= instead of = so it's clear we want to override this variable. This worked before because the value in my distro.conf file overwrote this value regardless of the fact it was set with =

 meta-yocto/conf/local.conf.sample |    6 ++++++
 meta/classes/image.bbclass        |    3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)
meta-yocto/conf/local.conf.sample +6 -0
index da3f8df..8177713 100644
@@ -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
 #
meta/classes/image.bbclass +2 -1
index 05f4331..a2770a4 100644
@@ -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 ?= ""
Signature · 1 line
1.7.6.1
#7 lore raw
Quoted 21 lines · Matthew McClintock

Allows us to import classes only for images and not to the global namespace

---
Change IMAGE_CLASSES definition to use ?= instead of = so it's clear we want to override this variable. This worked before because the value in my distro.conf file overwrote this value regardless of the fact it was set with =

  meta-yocto/conf/local.conf.sample |    6 ++++++
  meta/classes/image.bbclass        |    3 ++-
  2 files changed, 8 insertions(+), 1 deletions(-)
meta-yocto/conf/local.conf.sample +0 -0
index da3f8df..8177713 100644
@@ -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"

meta-yocto/conf/local.conf.sample EXTRA_IMAGE_FEATURES = "debug-tweaks" · line 174

Quoted 10 lines
meta-yocto/conf/local.conf.sample +6 -0
 
+# 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
  #

The preferred location for this advanced functionality should be the local.conf.sample.extended as Richard points out, please resubmit.

Thanks
Sau!

Quoted 14 lines
meta/classes/image.bbclass +2 -1
index 05f4331..a2770a4 100644
@@ -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 ?= ""
#8 lore raw

PATCH v3 1/1 Add new IMAGE_CLASSES variable for classes for image generation

Allows us to import classes only for images and not to the global namespace

---

v2: Change IMAGE_CLASSES definition to use ?= instead of = so it's clear we want to override this variable. This worked before because the value in my distro.conf file overwrote this value regardless of the fact it was set with =

v3: Move documentation to local.conf.sample.extended

 meta-yocto/conf/local.conf.sample.extended |    6 ++++++
 meta/classes/image.bbclass                 |    3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)
meta-yocto/conf/local.conf.sample.extended +6 -0
index 0c3197d..e9935ce 100644
@@ -114,3 +114,9 @@
 # The network based PR service host and port
 #PRSERV_HOST = "localhost"
 #PRSERV_PORT = "8585"
+
+# 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"
meta/classes/image.bbclass +2 -1
index 05f4331..a2770a4 100644
@@ -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 ?= ""
Signature · 1 line
1.7.6.1
Applied
#9 lore raw
Quoted 36 lines · Matthew McClintock

Allows us to import classes only for images and not to the global namespace

---

v2: Change IMAGE_CLASSES definition to use ?= instead of = so it's clear we want to override this variable. This worked before because the value in my distro.conf file overwrote this value regardless of the fact it was set with =

v3: Move documentation to local.conf.sample.extended

  meta-yocto/conf/local.conf.sample.extended |    6 ++++++
  meta/classes/image.bbclass                 |    3 ++-
  2 files changed, 8 insertions(+), 1 deletions(-)
meta-yocto/conf/local.conf.sample.extended +6 -0
index 0c3197d..e9935ce 100644
@@ -114,3 +114,9 @@
  # The network based PR service host and port
  #PRSERV_HOST = "localhost"
  #PRSERV_PORT = "8585"
+
+# 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"
meta/classes/image.bbclass +0 -0
index 05f4331..a2770a4 100644

meta/classes/image.bbclass def get_devtable_list(d): · line 118

Quoted 9 lines
meta/classes/image.bbclass +2 -1
@@ -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 ?= ""

Merged to OE-Core

Thanks
Sau!