Patchwork [bitbake-devel,4/8] Hob: Fix the workaround to get image types

login
register
mail settings
Submitter Shane Wang
Date March 22, 2012, 3:38 p.m.
Message ID <72d28089005830f17dda4acdf7d956941ce152ee.1332430442.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/24143/
State New
Headers show

Comments

Shane Wang - March 22, 2012, 3:38 p.m.
From: Dongxiao Xu <dongxiao.xu@intel.com>

Inherit image_types.bbclass before getting parameters to fix the
original workaround.

Besides, kick the handler things off after Builder is initialized.

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

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index e9d10c5..fe7b5d5 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -379,6 +379,11 @@  class HobHandler(gobject.GObject):
         self.build.reset()
 
     def get_parameters(self):
+        # inherit image_types.bbclass
+        self.init_cooker()
+        self.set_extra_inherit("image_types")
+        self.parse_config()
+    
         # retrieve the parameters from bitbake
         params = {}
         params["core_base"] = self.server.runCommand(["getVariable", "COREBASE"]) or ""
@@ -444,8 +449,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 ""
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
index daa708b..4c3e572 100755
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -56,9 +56,10 @@  def main (server = None, eventHandler = None):
     package_model = PackageListModel()
 
     hobHandler = HobHandler(server, recipe_model, package_model)
+    builder = Builder(hobHandler, recipe_model, package_model)
+
     if hobHandler.kick() == False:
         return 1
-    builder = Builder(hobHandler, recipe_model, package_model)
 
     # This timeout function regularly probes the event queue to find out if we
     # have any messages waiting for us.