Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] image_types.bbclass: Respect IMAGE_TYPEDEP dependencies
@ 2014-12-09 20:24 Otavio Salvador
  2014-12-09 20:24 ` [PATCH 2/2] lib/oe/image.py: Handle compressed IMAGE_TYPEDEP values Otavio Salvador
  0 siblings, 1 reply; 3+ messages in thread
From: Otavio Salvador @ 2014-12-09 20:24 UTC (permalink / raw)
  To: OpenEmbedded Core Mailing List; +Cc: Otavio Salvador

The IMAGE_TYPEDEP dependencies also need to be taken into account when
building an IMAGE_FSTYPE.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/classes/image_types.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 9aee745..24e4bbb 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -21,6 +21,8 @@ def imagetypes_getdepends(d):
                 basetype = type[:-len("." + ctype)]
                 adddep(d.getVar("COMPRESS_DEPENDS_%s" % ctype, True), deps)
                 break
+        for typedepends in (d.getVar("IMAGE_TYPEDEP_%s" % basetype, True) or "").split():
+            adddep(d.getVar('IMAGE_DEPENDS_%s' % typedepends, True) , deps)
         adddep(d.getVar('IMAGE_DEPENDS_%s' % basetype, True) , deps)
 
     depstr = ""
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] lib/oe/image.py: Handle compressed IMAGE_TYPEDEP values
  2014-12-09 20:24 [PATCH 1/2] image_types.bbclass: Respect IMAGE_TYPEDEP dependencies Otavio Salvador
@ 2014-12-09 20:24 ` Otavio Salvador
  2014-12-09 20:51   ` Mario Domenech Goulart
  0 siblings, 1 reply; 3+ messages in thread
From: Otavio Salvador @ 2014-12-09 20:24 UTC (permalink / raw)
  To: OpenEmbedded Core Mailing List; +Cc: Otavio Salvador

When computing the dependency graph for the image generation, we need
to take into account the compression type and identify the base type
it relates to. This allow for a more robust graph generation even when
using composed image types.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/lib/oe/image.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
index 7e080b0..9ac7d3d 100644
--- a/meta/lib/oe/image.py
+++ b/meta/lib/oe/image.py
@@ -48,6 +48,7 @@ class ImageDepGraph(object):
         graph = dict()
 
         def add_node(node):
+            node = self._image_base_type(node)
             deps = (self.d.getVar('IMAGE_TYPEDEP_' + node, True) or "")
             if deps != "":
                 graph[node] = deps
@@ -72,6 +73,18 @@ class ImageDepGraph(object):
         for item in remove_list:
             self.graph.pop(item, None)
 
+    def _image_base_type(self, type):
+        ctypes = self.d.getVar('COMPRESSIONTYPES', True).split()
+        if type == "vmdk" or type == "live" or type == "iso" or type == "hddimg":
+            type = "ext3"
+        basetype = type
+        for ctype in ctypes:
+            if type.endswith("." + ctype):
+                basetype = type[:-len("." + ctype)]
+                break
+
+        return basetype
+
     def _compute_dependencies(self):
         """
         returns dict object of nodes with [no_of_depends_on, no_of_depended_by]
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] lib/oe/image.py: Handle compressed IMAGE_TYPEDEP values
  2014-12-09 20:24 ` [PATCH 2/2] lib/oe/image.py: Handle compressed IMAGE_TYPEDEP values Otavio Salvador
@ 2014-12-09 20:51   ` Mario Domenech Goulart
  0 siblings, 0 replies; 3+ messages in thread
From: Mario Domenech Goulart @ 2014-12-09 20:51 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: OpenEmbedded Core Mailing List

On Tue,  9 Dec 2014 18:24:48 -0200 Otavio Salvador <otavio@ossystems.com.br> wrote:

> When computing the dependency graph for the image generation, we need
> to take into account the compression type and identify the base type
> it relates to. This allow for a more robust graph generation even when
> using composed image types.
>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  meta/lib/oe/image.py | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
> index 7e080b0..9ac7d3d 100644
> --- a/meta/lib/oe/image.py
> +++ b/meta/lib/oe/image.py
> @@ -48,6 +48,7 @@ class ImageDepGraph(object):
>          graph = dict()
>  
>          def add_node(node):
> +            node = self._image_base_type(node)
>              deps = (self.d.getVar('IMAGE_TYPEDEP_' + node, True) or "")
>              if deps != "":
>                  graph[node] = deps
> @@ -72,6 +73,18 @@ class ImageDepGraph(object):
>          for item in remove_list:
>              self.graph.pop(item, None)
>  
> +    def _image_base_type(self, type):
> +        ctypes = self.d.getVar('COMPRESSIONTYPES', True).split()
> +        if type == "vmdk" or type == "live" or type == "iso" or type == "hddimg":

This could be shorter as

   if type in ["vmdk", "live", "iso", "hddimg" ]

> +            type = "ext3"
> +        basetype = type
> +        for ctype in ctypes:
> +            if type.endswith("." + ctype):
> +                basetype = type[:-len("." + ctype)]
> +                break
> +
> +        return basetype
> +
>      def _compute_dependencies(self):
>          """
>          returns dict object of nodes with [no_of_depends_on, no_of_depended_by]
> -- 
> 2.1.3

Best wishes.
Mario
-- 
http://www.ossystems.com.br


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-09 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-09 20:24 [PATCH 1/2] image_types.bbclass: Respect IMAGE_TYPEDEP dependencies Otavio Salvador
2014-12-09 20:24 ` [PATCH 2/2] lib/oe/image.py: Handle compressed IMAGE_TYPEDEP values Otavio Salvador
2014-12-09 20:51   ` Mario Domenech Goulart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox