Patchwork [v2] Add new IMAGE_CLASSES variable for classes for image generation

login
register
mail settings
Submitter Matthew McClintock
Date Nov. 2, 2011, 4:25 p.m.
Message ID <1320251115-29360-1-git-send-email-msm@freescale.com>
Download mbox | patch
Permalink /patch/14221/
State New, archived
Headers show

Comments

Matthew McClintock - Nov. 2, 2011, 4:25 p.m.
Allows us to import classes only for images and not to the global
namespace

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
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(-)
Saul Wold - Nov. 7, 2011, 7:07 p.m.
On 11/02/2011 09:25 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>
> ---
> 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(-)
>
> diff --git a/meta-yocto/conf/local.conf.sample b/meta-yocto/conf/local.conf.sample
> index da3f8df..8177713 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
>   #

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

Thanks
	Sau!

> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 05f4331..a2770a4 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 ?= ""

Patch

diff --git a/meta-yocto/conf/local.conf.sample b/meta-yocto/conf/local.conf.sample
index da3f8df..8177713 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..a2770a4 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 ?= ""