Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH 0/7][PULL] Hob: Bug fixes: image_types, runqemu/deploy filter
@ 2012-03-23 15:07 Dongxiao Xu
  2012-03-23 15:07 ` [PATCH 1/7] Hob: Remove unnecessary PARSE_BBFILES command Dongxiao Xu
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Dongxiao Xu @ 2012-03-23 15:07 UTC (permalink / raw)
  To: bitbake-devel

Hi Richard,

This pull request is for Hob related bug fixes, please help to review and pull.

Thanks,
Dongxiao

The following changes since commit 1119495cbfe2bd1ed0da630dc63f5860c1be73d4:

  lib/bb/ui/crumbs/builder: change dialogue title to Layers (2012-03-23 22:54:00 +0800)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib dxu4/hob-bugfix
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dxu4/hob-bugfix

Dongxiao Xu (7):
  Hob: Remove unnecessary PARSE_BBFILES command
  Hob: Cleanup for hobeventhandler.py
  Hob: Initial an empty label in recipeselectionpage.py
  Hob: Change the Hob initialization process
  Hob: Fix the workaround to get image types
  Hob: Add a supported image type "vmdk"
  Hob: runqemu and deployment functionality filter

 lib/bb/ui/crumbs/builder.py             |   20 +++++--
 lib/bb/ui/crumbs/hobeventhandler.py     |   90 ++++++++++++++-----------------
 lib/bb/ui/crumbs/hobwidget.py           |    1 +
 lib/bb/ui/crumbs/imagedetailspage.py    |   44 +++++++++++----
 lib/bb/ui/crumbs/recipeselectionpage.py |    2 +-
 lib/bb/ui/hob.py                        |    2 -
 6 files changed, 89 insertions(+), 70 deletions(-)

-- 
1.7.4.1




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

* [PATCH 1/7] Hob: Remove unnecessary PARSE_BBFILES command
  2012-03-23 15:07 [PATCH 0/7][PULL] Hob: Bug fixes: image_types, runqemu/deploy filter Dongxiao Xu
@ 2012-03-23 15:07 ` Dongxiao Xu
  2012-03-23 15:07 ` [PATCH 2/7] Hob: Cleanup for hobeventhandler.py Dongxiao Xu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Dongxiao Xu @ 2012-03-23 15:07 UTC (permalink / raw)
  To: bitbake-devel

The ASYNC commands can automatically detect if BB file parsing is needed.
Therefore remove this explicit parsing command.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/ui/crumbs/hobeventhandler.py |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py
index 07cc039..664f866 100644
--- a/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/lib/bb/ui/crumbs/hobeventhandler.py
@@ -62,7 +62,7 @@ class HobHandler(gobject.GObject):
                                      (gobject.TYPE_PYOBJECT,)),
     }
 
-    (CFG_AVAIL_LAYERS, CFG_PATH_LAYERS, CFG_FILES_DISTRO, CFG_FILES_MACH, CFG_FILES_SDKMACH, FILES_MATCH_CLASS, PARSE_CONFIG, PARSE_BBFILES, GENERATE_TGTS, GENERATE_PACKAGEINFO, BUILD_TARGET_RECIPES, BUILD_TARGET_IMAGE, CMD_END) = range(13)
+    (CFG_AVAIL_LAYERS, CFG_PATH_LAYERS, CFG_FILES_DISTRO, CFG_FILES_MACH, CFG_FILES_SDKMACH, FILES_MATCH_CLASS, PARSE_CONFIG, GENERATE_TGTS, GENERATE_PACKAGEINFO, BUILD_TARGET_RECIPES, BUILD_TARGET_IMAGE, CMD_END) = range(12)
     (LAYERS_REFRESH, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(5)
 
     def __init__(self, server, recipe_model, package_model):
@@ -136,8 +136,6 @@ class HobHandler(gobject.GObject):
             self.server.runCommand(["findFilesMatchingInDir", "rootfs_", "classes"])
         elif next_command == self.PARSE_CONFIG:
             self.server.runCommand(["parseConfigurationFiles", "", ""])
-        elif next_command == self.PARSE_BBFILES:
-            self.server.runCommand(["parseFiles"])
         elif next_command == self.GENERATE_TGTS:
             self.server.runCommand(["generateTargetsTree", "classes/image.bbclass", []])
         elif next_command == self.GENERATE_PACKAGEINFO:
@@ -345,7 +343,6 @@ class HobHandler(gobject.GObject):
         targets.extend(tgts)
         self.recipe_queue = targets
         self.commands_async.append(self.PARSE_CONFIG)
-        self.commands_async.append(self.PARSE_BBFILES)
         self.commands_async.append(self.BUILD_TARGET_RECIPES)
         self.run_next_command(self.GENERATE_PACKAGES)
 
@@ -353,7 +350,6 @@ class HobHandler(gobject.GObject):
         self.package_queue = tgts
         self.toolchain_build = toolchain_build
         self.commands_async.append(self.PARSE_CONFIG)
-        self.commands_async.append(self.PARSE_BBFILES)
         self.commands_async.append(self.BUILD_TARGET_IMAGE)
         self.run_next_command(self.GENERATE_IMAGE)
 
-- 
1.7.4.1




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

* [PATCH 2/7] Hob: Cleanup for hobeventhandler.py
  2012-03-23 15:07 [PATCH 0/7][PULL] Hob: Bug fixes: image_types, runqemu/deploy filter Dongxiao Xu
  2012-03-23 15:07 ` [PATCH 1/7] Hob: Remove unnecessary PARSE_BBFILES command Dongxiao Xu
@ 2012-03-23 15:07 ` Dongxiao Xu
  2012-03-23 15:07 ` [PATCH 3/7] Hob: Initial an empty label in recipeselectionpage.py Dongxiao Xu
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Dongxiao Xu @ 2012-03-23 15:07 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/ui/crumbs/builder.py         |    2 +-
 lib/bb/ui/crumbs/hobeventhandler.py |   75 ++++++++++++++--------------------
 lib/bb/ui/hob.py                    |    4 +-
 3 files changed, 34 insertions(+), 47 deletions(-)

diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index 2fe67d9..0faef9b 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -409,7 +409,7 @@ class Builder(gtk.Window):
         self.parameters.all_layers = layers
 
     def handler_command_succeeded_cb(self, handler, initcmd):
-        if initcmd == self.handler.LAYERS_REFRESH:
+        if initcmd == self.handler.GENERATE_CONFIGURATION:
             self.image_configuration_page.switch_machine_combo()
         elif initcmd in [self.handler.GENERATE_RECIPES,
                          self.handler.GENERATE_PACKAGES,
diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py
index 664f866..8094d2d 100644
--- a/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/lib/bb/ui/crumbs/hobeventhandler.py
@@ -62,8 +62,8 @@ class HobHandler(gobject.GObject):
                                      (gobject.TYPE_PYOBJECT,)),
     }
 
-    (CFG_AVAIL_LAYERS, CFG_PATH_LAYERS, CFG_FILES_DISTRO, CFG_FILES_MACH, CFG_FILES_SDKMACH, FILES_MATCH_CLASS, PARSE_CONFIG, GENERATE_TGTS, GENERATE_PACKAGEINFO, BUILD_TARGET_RECIPES, BUILD_TARGET_IMAGE, CMD_END) = range(12)
-    (LAYERS_REFRESH, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(5)
+    (GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(5)
+    (SUB_PATH_LAYERS, SUB_FILES_DISTRO, SUB_FILES_MACH, SUB_FILES_SDKMACH, SUB_MATCH_CLASS, SUB_PARSE_CONFIG, SUB_GNERATE_TGTS, SUB_GENERATE_PKGINFO, SUB_BUILD_RECIPES, SUB_BUILD_IMAGE) = range(10)
 
     def __init__(self, server, recipe_model, package_model):
         super(HobHandler, self).__init__()
@@ -84,21 +84,6 @@ class HobHandler(gobject.GObject):
         self.error_msg = ""
         self.initcmd = None
 
-    def kick(self):
-        import xmlrpclib
-        try:
-            # kick the while thing off
-            self.commands_async.append(self.CFG_PATH_LAYERS)
-            self.commands_async.append(self.CFG_FILES_DISTRO)
-            self.commands_async.append(self.CFG_FILES_MACH)
-            self.commands_async.append(self.CFG_FILES_SDKMACH)
-            self.commands_async.append(self.FILES_MATCH_CLASS)
-            self.run_next_command()
-            return True
-        except xmlrpclib.Fault as x:
-            print("XMLRPC Fault getting commandline:\n %s" % x)
-            return False
- 
     def set_busy(self):
         if not self.generating:
             self.emit("generating-data")
@@ -122,30 +107,28 @@ class HobHandler(gobject.GObject):
                 self.emit("command-succeeded", self.initcmd)
             return
 
-        if next_command == self.CFG_AVAIL_LAYERS:
-            self.server.runCommand(["findCoreBaseFiles", "layers", "conf/layer.conf"])
-        elif next_command == self.CFG_PATH_LAYERS:
+        if next_command == self.SUB_PATH_LAYERS:
             self.server.runCommand(["findConfigFilePath", "bblayers.conf"])
-        elif next_command == self.CFG_FILES_DISTRO:
+        elif next_command == self.SUB_FILES_DISTRO:
             self.server.runCommand(["findConfigFiles", "DISTRO"])
-        elif next_command == self.CFG_FILES_MACH:
+        elif next_command == self.SUB_FILES_MACH:
             self.server.runCommand(["findConfigFiles", "MACHINE"])
-        elif next_command == self.CFG_FILES_SDKMACH:
+        elif next_command == self.SUB_FILES_SDKMACH:
             self.server.runCommand(["findConfigFiles", "MACHINE-SDK"])
-        elif next_command == self.FILES_MATCH_CLASS:
+        elif next_command == self.SUB_MATCH_CLASS:
             self.server.runCommand(["findFilesMatchingInDir", "rootfs_", "classes"])
-        elif next_command == self.PARSE_CONFIG:
+        elif next_command == self.SUB_PARSE_CONFIG:
             self.server.runCommand(["parseConfigurationFiles", "", ""])
-        elif next_command == self.GENERATE_TGTS:
+        elif next_command == self.SUB_GNERATE_TGTS:
             self.server.runCommand(["generateTargetsTree", "classes/image.bbclass", []])
-        elif next_command == self.GENERATE_PACKAGEINFO:
+        elif next_command == self.SUB_GENERATE_PKGINFO:
             self.server.runCommand(["triggerEvent", "bb.event.RequestPackageInfo()"])
-        elif next_command == self.BUILD_TARGET_RECIPES:
+        elif next_command == self.SUB_BUILD_RECIPES:
             self.clear_busy()
             self.building = True
             self.server.runCommand(["buildTargets", self.recipe_queue, "build"])
             self.recipe_queue = []
-        elif next_command == self.BUILD_TARGET_IMAGE:
+        elif next_command == self.SUB_BUILD_IMAGE:
             self.clear_busy()
             self.building = True
             targets = ["hob-image"]
@@ -264,14 +247,10 @@ class HobHandler(gobject.GObject):
         self.server.runCommand(["initCooker"])
 
     def refresh_layers(self, bblayers):
-        self.server.runCommand(["initCooker"])
-        self.server.runCommand(["setVariable", "BBLAYERS", " ".join(bblayers)])
-        self.commands_async.append(self.PARSE_CONFIG)
-        self.commands_async.append(self.CFG_FILES_DISTRO)
-        self.commands_async.append(self.CFG_FILES_MACH)
-        self.commands_async.append(self.CFG_FILES_SDKMACH)
-        self.commands_async.append(self.FILES_MATCH_CLASS)
-        self.run_next_command(self.LAYERS_REFRESH)
+        self.init_cooker()
+        self.set_bblayers(bblayers)
+        self.commands_async.append(self.SUB_PARSE_CONFIG)
+        self.generate_configuration()
 
     def set_extra_inherit(self, bbclass):
         inherits = self.server.runCommand(["getVariable", "INHERIT"]) or ""
@@ -330,27 +309,35 @@ class HobHandler(gobject.GObject):
             self.server.runCommand(["setVariable", key, value])
 
     def request_package_info_async(self):
-        self.commands_async.append(self.GENERATE_PACKAGEINFO)
+        self.commands_async.append(self.SUB_GENERATE_PKGINFO)
         self.run_next_command(self.POPULATE_PACKAGEINFO)
 
+    def generate_configuration(self):
+        self.commands_async.append(self.SUB_PATH_LAYERS)
+        self.commands_async.append(self.SUB_FILES_DISTRO)
+        self.commands_async.append(self.SUB_FILES_MACH)
+        self.commands_async.append(self.SUB_FILES_SDKMACH)
+        self.commands_async.append(self.SUB_MATCH_CLASS)
+        self.run_next_command(self.GENERATE_CONFIGURATION)
+
     def generate_recipes(self):
-        self.commands_async.append(self.PARSE_CONFIG)
-        self.commands_async.append(self.GENERATE_TGTS)
+        self.commands_async.append(self.SUB_PARSE_CONFIG)
+        self.commands_async.append(self.SUB_GNERATE_TGTS)
         self.run_next_command(self.GENERATE_RECIPES)
                  
     def generate_packages(self, tgts):
         targets = []
         targets.extend(tgts)
         self.recipe_queue = targets
-        self.commands_async.append(self.PARSE_CONFIG)
-        self.commands_async.append(self.BUILD_TARGET_RECIPES)
+        self.commands_async.append(self.SUB_PARSE_CONFIG)
+        self.commands_async.append(self.SUB_BUILD_RECIPES)
         self.run_next_command(self.GENERATE_PACKAGES)
 
     def generate_image(self, tgts, toolchain_build=False):
         self.package_queue = tgts
         self.toolchain_build = toolchain_build
-        self.commands_async.append(self.PARSE_CONFIG)
-        self.commands_async.append(self.BUILD_TARGET_IMAGE)
+        self.commands_async.append(self.SUB_PARSE_CONFIG)
+        self.commands_async.append(self.SUB_BUILD_IMAGE)
         self.run_next_command(self.GENERATE_IMAGE)
 
     def build_failed_async(self):
diff --git a/lib/bb/ui/hob.py b/lib/bb/ui/hob.py
index daa708b..7c147c4 100755
--- a/lib/bb/ui/hob.py
+++ b/lib/bb/ui/hob.py
@@ -56,10 +56,10 @@ def main (server = None, eventHandler = None):
     package_model = PackageListModel()
 
     hobHandler = HobHandler(server, recipe_model, package_model)
-    if hobHandler.kick() == False:
-        return 1
     builder = Builder(hobHandler, recipe_model, package_model)
 
+    hobHandler.generate_configuration()
+
     # This timeout function regularly probes the event queue to find out if we
     # have any messages waiting for us.
     gobject.timeout_add(10, event_handle_idle_func, eventHandler, hobHandler)
-- 
1.7.4.1




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

* [PATCH 3/7] Hob: Initial an empty label in recipeselectionpage.py
  2012-03-23 15:07 [PATCH 0/7][PULL] Hob: Bug fixes: image_types, runqemu/deploy filter Dongxiao Xu
  2012-03-23 15:07 ` [PATCH 1/7] Hob: Remove unnecessary PARSE_BBFILES command Dongxiao Xu
  2012-03-23 15:07 ` [PATCH 2/7] Hob: Cleanup for hobeventhandler.py Dongxiao Xu
@ 2012-03-23 15:07 ` Dongxiao Xu
  2012-03-23 15:07 ` [PATCH 4/7] Hob: Change the Hob initialization process Dongxiao Xu
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Dongxiao Xu @ 2012-03-23 15:07 UTC (permalink / raw)
  To: bitbake-devel

When creating label in recipeselectionpage.py, the builder's
configuration may not be ready yet, so create an empty label in
initialization.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/ui/crumbs/recipeselectionpage.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/bb/ui/crumbs/recipeselectionpage.py b/lib/bb/ui/crumbs/recipeselectionpage.py
index 881b2ec..ebdb7c1 100755
--- a/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -118,7 +118,7 @@ class RecipeSelectionPage (HobPage):
         self.create_visual_elements()
 
     def create_visual_elements(self):
-        self.label = gtk.Label("Recipes included: %s" % len(self.builder.configuration.selected_recipes))
+        self.label = gtk.Label()
         self.eventbox = self.add_onto_top_bar(self.label, 73)
         self.pack_start(self.eventbox, expand=False, fill=False)
         self.pack_start(self.group_align, expand=True, fill=True)
-- 
1.7.4.1




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

* [PATCH 4/7] Hob: Change the Hob initialization process
  2012-03-23 15:07 [PATCH 0/7][PULL] Hob: Bug fixes: image_types, runqemu/deploy filter Dongxiao Xu
                   ` (2 preceding siblings ...)
  2012-03-23 15:07 ` [PATCH 3/7] Hob: Initial an empty label in recipeselectionpage.py Dongxiao Xu
@ 2012-03-23 15:07 ` Dongxiao Xu
  2012-03-23 15:07 ` [PATCH 5/7] Hob: Fix the workaround to get image types Dongxiao Xu
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Dongxiao Xu @ 2012-03-23 15:07 UTC (permalink / raw)
  To: bitbake-devel

This change allows adding extra inherits before getting all the
parameters.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/ui/crumbs/builder.py         |   17 +++++++++++------
 lib/bb/ui/crumbs/hobeventhandler.py |    6 +++++-
 lib/bb/ui/hob.py                    |    2 --
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index 0faef9b..d348497 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -186,11 +186,6 @@ class Builder(gtk.Window):
 
         self.template = None
 
-        # settings
-        params = self.handler.get_parameters()
-        self.configuration = Configuration(params)
-        self.parameters = Parameters(params)
-
         # build step
         self.current_step = None
         self.previous_step = None
@@ -224,6 +219,10 @@ class Builder(gtk.Window):
         self.handler.connect("command-succeeded",        self.handler_command_succeeded_cb)
         self.handler.connect("command-failed",           self.handler_command_failed_cb)
 
+        self.handler.init_cooker()
+        self.handler.set_extra_inherit("image_types")
+        self.handler.parse_config()
+
         self.switch_page(self.MACHINE_SELECTION)
 
     def create_visual_elements(self):
@@ -409,7 +408,13 @@ class Builder(gtk.Window):
         self.parameters.all_layers = layers
 
     def handler_command_succeeded_cb(self, handler, initcmd):
-        if initcmd == self.handler.GENERATE_CONFIGURATION:
+        if initcmd == self.handler.PARSE_CONFIG:
+            # settings
+            params = self.handler.get_parameters()
+            self.configuration = Configuration(params)
+            self.parameters = Parameters(params)
+            self.handler.generate_configuration()
+        elif initcmd == self.handler.GENERATE_CONFIGURATION:
             self.image_configuration_page.switch_machine_combo()
         elif initcmd in [self.handler.GENERATE_RECIPES,
                          self.handler.GENERATE_PACKAGES,
diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py
index 8094d2d..308ef4d 100644
--- a/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/lib/bb/ui/crumbs/hobeventhandler.py
@@ -62,7 +62,7 @@ class HobHandler(gobject.GObject):
                                      (gobject.TYPE_PYOBJECT,)),
     }
 
-    (GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(5)
+    (PARSE_CONFIG, GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(6)
     (SUB_PATH_LAYERS, SUB_FILES_DISTRO, SUB_FILES_MACH, SUB_FILES_SDKMACH, SUB_MATCH_CLASS, SUB_PARSE_CONFIG, SUB_GNERATE_TGTS, SUB_GENERATE_PKGINFO, SUB_BUILD_RECIPES, SUB_BUILD_IMAGE) = range(10)
 
     def __init__(self, server, recipe_model, package_model):
@@ -246,6 +246,10 @@ class HobHandler(gobject.GObject):
     def init_cooker(self):
         self.server.runCommand(["initCooker"])
 
+    def parse_config(self):
+        self.commands_async.append(self.SUB_PARSE_CONFIG)
+        self.run_next_command(self.PARSE_CONFIG)
+
     def refresh_layers(self, bblayers):
         self.init_cooker()
         self.set_bblayers(bblayers)
diff --git a/lib/bb/ui/hob.py b/lib/bb/ui/hob.py
index 7c147c4..e72ab23 100755
--- a/lib/bb/ui/hob.py
+++ b/lib/bb/ui/hob.py
@@ -58,8 +58,6 @@ def main (server = None, eventHandler = None):
     hobHandler = HobHandler(server, recipe_model, package_model)
     builder = Builder(hobHandler, recipe_model, package_model)
 
-    hobHandler.generate_configuration()
-
     # This timeout function regularly probes the event queue to find out if we
     # have any messages waiting for us.
     gobject.timeout_add(10, event_handle_idle_func, eventHandler, hobHandler)
-- 
1.7.4.1




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

* [PATCH 5/7] Hob: Fix the workaround to get image types
  2012-03-23 15:07 [PATCH 0/7][PULL] Hob: Bug fixes: image_types, runqemu/deploy filter Dongxiao Xu
                   ` (3 preceding siblings ...)
  2012-03-23 15:07 ` [PATCH 4/7] Hob: Change the Hob initialization process Dongxiao Xu
@ 2012-03-23 15:07 ` Dongxiao Xu
  2012-03-23 15:07 ` [PATCH 6/7] Hob: Add a supported image type "vmdk" Dongxiao Xu
  2012-03-23 15:07 ` [PATCH 7/7] Hob: runqemu and deployment functionality filter Dongxiao Xu
  6 siblings, 0 replies; 8+ messages in thread
From: Dongxiao Xu @ 2012-03-23 15:07 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/ui/crumbs/hobeventhandler.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py
index 308ef4d..ec3e0ef 100644
--- a/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/lib/bb/ui/crumbs/hobeventhandler.py
@@ -430,8 +430,7 @@ class HobHandler(gobject.GObject):
 
         params["image_fstypes"] = self.server.runCommand(["getVariable", "IMAGE_FSTYPES"]) or ""
 
-        # walkaround
-        params["image_types"] = " ".join(hcc.SUPPORTED_IMAGE_TYPES.keys()).lstrip(" ")
+        params["image_types"] = self.server.runCommand(["getVariable", "IMAGE_TYPES"]) or ""
 
         params["conf_version"] = self.server.runCommand(["getVariable", "CONF_VERSION"]) or ""
         params["lconf_version"] = self.server.runCommand(["getVariable", "LCONF_VERSION"]) or ""
-- 
1.7.4.1




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

* [PATCH 6/7] Hob: Add a supported image type "vmdk"
  2012-03-23 15:07 [PATCH 0/7][PULL] Hob: Bug fixes: image_types, runqemu/deploy filter Dongxiao Xu
                   ` (4 preceding siblings ...)
  2012-03-23 15:07 ` [PATCH 5/7] Hob: Fix the workaround to get image types Dongxiao Xu
@ 2012-03-23 15:07 ` Dongxiao Xu
  2012-03-23 15:07 ` [PATCH 7/7] Hob: runqemu and deployment functionality filter Dongxiao Xu
  6 siblings, 0 replies; 8+ messages in thread
From: Dongxiao Xu @ 2012-03-23 15:07 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/ui/crumbs/hobwidget.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/bb/ui/crumbs/hobwidget.py b/lib/bb/ui/crumbs/hobwidget.py
index 9d144c9..70644dc 100644
--- a/lib/bb/ui/crumbs/hobwidget.py
+++ b/lib/bb/ui/crumbs/hobwidget.py
@@ -82,6 +82,7 @@ class hcc:
         "cpio"          : ["cpio"],
         "cpio.gz"       : ["cpio.gz"],
         "cpio.xz"       : ["cpio.xz"],
+        "vmdk"          : ["vmdk"],
         "cpio.lzma"     : ["cpio.lzma"],
     }
 
-- 
1.7.4.1




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

* [PATCH 7/7] Hob: runqemu and deployment functionality filter
  2012-03-23 15:07 [PATCH 0/7][PULL] Hob: Bug fixes: image_types, runqemu/deploy filter Dongxiao Xu
                   ` (5 preceding siblings ...)
  2012-03-23 15:07 ` [PATCH 6/7] Hob: Add a supported image type "vmdk" Dongxiao Xu
@ 2012-03-23 15:07 ` Dongxiao Xu
  6 siblings, 0 replies; 8+ messages in thread
From: Dongxiao Xu @ 2012-03-23 15:07 UTC (permalink / raw)
  To: bitbake-devel

Implement the filter for runqemu and deployment functionality.

runqemu
1) suffix should be in the list of RUNNABLE_IMAGE_TYPES.
2) machine should match the pattern of RUNNABLE_MACHINE_PATTERNS.

deployment:
1) suffix should be in the list of DEPLOYMENT_IMAGE_TYPES.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/ui/crumbs/builder.py          |    3 ++
 lib/bb/ui/crumbs/hobeventhandler.py  |    4 +++
 lib/bb/ui/crumbs/imagedetailspage.py |   44 +++++++++++++++++++++++++--------
 3 files changed, 40 insertions(+), 11 deletions(-)

diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index d348497..2984490 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -135,6 +135,9 @@ class Parameters:
         self.image_names = []
         self.image_addr = params["image_addr"]
         self.image_types = params["image_types"].split()
+        self.runnable_image_types = params["runnable_image_types"].split()
+        self.runnable_machine_patterns = params["runnable_machine_patterns"].split()
+        self.deployable_image_types = params["deployable_image_types"].split()
 
 class Builder(gtk.Window):
 
diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py
index ec3e0ef..4b8aabc 100644
--- a/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/lib/bb/ui/crumbs/hobeventhandler.py
@@ -434,4 +434,8 @@ class HobHandler(gobject.GObject):
 
         params["conf_version"] = self.server.runCommand(["getVariable", "CONF_VERSION"]) or ""
         params["lconf_version"] = self.server.runCommand(["getVariable", "LCONF_VERSION"]) or ""
+
+        params["runnable_image_types"] = self.server.runCommand(["getVariable", "RUNNABLE_IMAGE_TYPES"]) or ""
+        params["runnable_machine_patterns"] = self.server.runCommand(["getVariable", "RUNNABLE_MACHINE_PATTERNS"]) or ""
+        params["deployable_image_types"] = self.server.runCommand(["getVariable", "DEPLOYABLE_IMAGE_TYPES"]) or ""
         return params
diff --git a/lib/bb/ui/crumbs/imagedetailspage.py b/lib/bb/ui/crumbs/imagedetailspage.py
index 07a6eb0..5a5ec3f 100755
--- a/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/lib/bb/ui/crumbs/imagedetailspage.py
@@ -183,7 +183,6 @@ class ImageDetailsPage (HobPage):
             self.image_store.set(self.image_store.append(), 0, image_name, 1, image_size, 2, False)
         image_table = HobViewTable(self.__columns__)
         image_table.set_model(self.image_store)
-        image_table.toggle_default()
         image_size = self._size_to_string(os.stat(os.path.join(image_addr, image_names[0])).st_size)
         image_table.connect("toggled", self.toggled_cb)
         view_files_button = gtk.LinkButton("file://%s" % image_addr, "View files")
@@ -256,6 +255,29 @@ class ImageDetailsPage (HobPage):
         model[path][columnid] = True
         self.refresh_package_detail_box(model[path][1])
 
+        type_runnable = False
+        mach_runnable = False
+        image_name = model[path][0]
+        for t in self.builder.parameters.runnable_image_types:
+            if image_name.endswith(t):
+                type_runnable = True
+                break
+
+        for t in self.builder.parameters.runnable_machine_patterns:
+            if t in image_name:
+                mach_runnable = True
+                break
+
+        self.run_button.set_sensitive(type_runnable and mach_runnable)
+
+        deployable = False
+        for t in self.builder.parameters.deployable_image_types:
+            if image_name.endswith(t):
+                deployable = True
+                break
+
+        self.deploy_button.set_sensitive(deployable)
+
     def create_bottom_buttons(self, buttonlist):
         # Create the buttons at the bottom
         bottom_buttons = gtk.HBox(False, 6)
@@ -264,13 +286,13 @@ class ImageDetailsPage (HobPage):
         # create button "Deploy image"
         name = "Deploy image"
         if name in buttonlist:
-            deploy_button = HobButton('Deploy image')
-            deploy_button.set_size_request(205, 49)
-            deploy_button.set_tooltip_text("Deploy image to get your target board")
-            deploy_button.set_flags(gtk.CAN_DEFAULT)
-            deploy_button.grab_default()
-            deploy_button.connect("clicked", self.deploy_button_clicked_cb)
-            bottom_buttons.pack_end(deploy_button, expand=False, fill=False)
+            self.deploy_button = HobButton('Deploy image')
+            self.deploy_button.set_size_request(205, 49)
+            self.deploy_button.set_tooltip_text("Deploy image to get your target board")
+            self.deploy_button.set_flags(gtk.CAN_DEFAULT)
+            self.deploy_button.grab_default()
+            self.deploy_button.connect("clicked", self.deploy_button_clicked_cb)
+            bottom_buttons.pack_end(self.deploy_button, expand=False, fill=False)
             created = True
 
         name = "Run image"
@@ -281,9 +303,9 @@ class ImageDetailsPage (HobPage):
                 bottom_buttons.pack_end(label, expand=False, fill=False)
 
             # create button "Run image"
-            run_button = HobAltButton("Run image")
-            run_button.connect("clicked", self.run_button_clicked_cb)
-            bottom_buttons.pack_end(run_button, expand=False, fill=False)
+            self.run_button = HobAltButton("Run image")
+            self.run_button.connect("clicked", self.run_button_clicked_cb)
+            bottom_buttons.pack_end(self.run_button, expand=False, fill=False)
             created = True
 
         name = "Save as template"
-- 
1.7.4.1




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

end of thread, other threads:[~2012-03-23 15:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-23 15:07 [PATCH 0/7][PULL] Hob: Bug fixes: image_types, runqemu/deploy filter Dongxiao Xu
2012-03-23 15:07 ` [PATCH 1/7] Hob: Remove unnecessary PARSE_BBFILES command Dongxiao Xu
2012-03-23 15:07 ` [PATCH 2/7] Hob: Cleanup for hobeventhandler.py Dongxiao Xu
2012-03-23 15:07 ` [PATCH 3/7] Hob: Initial an empty label in recipeselectionpage.py Dongxiao Xu
2012-03-23 15:07 ` [PATCH 4/7] Hob: Change the Hob initialization process Dongxiao Xu
2012-03-23 15:07 ` [PATCH 5/7] Hob: Fix the workaround to get image types Dongxiao Xu
2012-03-23 15:07 ` [PATCH 6/7] Hob: Add a supported image type "vmdk" Dongxiao Xu
2012-03-23 15:07 ` [PATCH 7/7] Hob: runqemu and deployment functionality filter Dongxiao Xu

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