Skip to contentSkip to conversation

Hob: Bug fixes: image_types, runqemu/deploy functionality filter, and DISTRO setting

GIT PULL In review Dongxiao Xu 2 participants 12 messages Mar 24, 2012

lore
Share & tools
lore
#0 lore raw

Hi Richard,

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

Changes from v1:
1) Rebased to latest master.
2) Added a new patch "Hob: Set empty DISTRO if "defaultsetup" is selected" that fixed the multiple inclusion of defaultsetup.conf. This could solve the problem Eric Benard reported in mailing list.

Thanks,
Dongxiao

The following changes since commit 0348ef08db9ac425d83126d2e6eb465adc28b110:

Hob: Change the descriptions for view_recipe_button and view_package_button (2012-03-23 16:09:35 +0000)

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 (8):
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
Hob: Set empty DISTRO if "defaultsetup" is selected

 lib/bb/ui/crumbs/builder.py             |   20 +++++--
 lib/bb/ui/crumbs/hobeventhandler.py     |   92 ++++++++++++++-----------------
 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, 91 insertions(+), 70 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/8 Hob: Remove unnecessary PARSE_BBFILES command

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

---
 lib/bb/ui/crumbs/hobeventhandler.py |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
lib/bb/ui/crumbs/hobeventhandler.py +1 -5
index 07cc039..664f866 100644
@@ -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)
 
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 2/8 Hob: Cleanup for hobeventhandler.py

In reply to Dongxiao Xu
---
 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(-)
lib/bb/ui/crumbs/builder.py +1 -1
index 2fe67d9..0faef9b 100755
@@ -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,
lib/bb/ui/crumbs/hobeventhandler.py +31 -44

131 lines not on this page · raw message

lib/bb/ui/hob.py +2 -2
index daa708b..7c147c4 100755
@@ -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)
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH 3/8 Hob: Initial an empty label in recipeselectionpage.py

In reply to Dongxiao Xu

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

---
 lib/bb/ui/crumbs/recipeselectionpage.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/bb/ui/crumbs/recipeselectionpage.py +1 -1
index 881b2ec..ebdb7c1 100755
@@ -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)
Signature · 1 line
1.7.4.1
#4 lore raw

PATCH 4/8 Hob: Change the Hob initialization process

In reply to Dongxiao Xu

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

---
 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(-)
lib/bb/ui/crumbs/builder.py +11 -6
index 0faef9b..d348497 100755
@@ -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,
lib/bb/ui/crumbs/hobeventhandler.py +5 -1
index 8094d2d..308ef4d 100644
@@ -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)
lib/bb/ui/hob.py +0 -2
index 7c147c4..e72ab23 100755
@@ -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)
Signature · 1 line
1.7.4.1
#5 lore raw

PATCH 5/8 Hob: Fix the workaround to get image types

In reply to Dongxiao Xu
---
 lib/bb/ui/crumbs/hobeventhandler.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
lib/bb/ui/crumbs/hobeventhandler.py +1 -2
index 308ef4d..ec3e0ef 100644
@@ -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 ""
Signature · 1 line
1.7.4.1
#6 lore raw

PATCH 6/8 Hob: Add a supported image type "vmdk"

In reply to Dongxiao Xu
---
 lib/bb/ui/crumbs/hobwidget.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
lib/bb/ui/crumbs/hobwidget.py +1 -0
index 020c5e2..1213b11 100644
@@ -82,6 +82,7 @@ class hcc:
         "cpio"          : ["cpio"],
         "cpio.gz"       : ["cpio.gz"],
         "cpio.xz"       : ["cpio.xz"],
+        "vmdk"          : ["vmdk"],
         "cpio.lzma"     : ["cpio.lzma"],
     }
 
Signature · 1 line
1.7.4.1
#7 lore raw

PATCH 7/8 Hob: runqemu and deployment functionality filter

In reply to Dongxiao Xu

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.

---
 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(-)
lib/bb/ui/crumbs/builder.py +3 -0
index d348497..2984490 100755
@@ -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):
 
lib/bb/ui/crumbs/hobeventhandler.py +4 -0
index ec3e0ef..4b8aabc 100644
@@ -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
lib/bb/ui/crumbs/imagedetailspage.py +33 -11

68 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#8 lore raw

PATCH 8/8 Hob: Set empty DISTRO if "defaultsetup" is selected

In reply to Dongxiao Xu

In Hob advanced setting, if "defaultsetup" is selected, we need to set empty to DISTRO variable in bitbake server.

Otherwise, defaultsetup.conf will be parsed twice, causing TMPDIR and its related variables mess up.

---
 lib/bb/ui/crumbs/hobeventhandler.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
lib/bb/ui/crumbs/hobeventhandler.py +2 -0
index 4b8aabc..a98a0bb 100644
@@ -274,6 +274,8 @@ class HobHandler(gobject.GObject):
         self.server.runCommand(["setVariable", "IMAGE_FSTYPES", " ".join(image_fstypes).lstrip(" ")])
 
     def set_distro(self, distro):
+        if distro == "defaultsetup":
+            distro = ""
         self.server.runCommand(["setVariable", "DISTRO", distro])
 
     def set_package_format(self, format):
Signature · 1 line
1.7.4.1
#9 lore raw

Re: [PATCH 8/8] Hob: Set empty DISTRO if "defaultsetup" is selected

Quoted 16 lines · Dongxiao Xu

In Hob advanced setting, if "defaultsetup" is selected, we need to set empty to DISTRO variable in bitbake server.

Otherwise, defaultsetup.conf will be parsed twice, causing TMPDIR and its related variables mess up.

---
 lib/bb/ui/crumbs/hobeventhandler.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
lib/bb/ui/crumbs/hobeventhandler.py +0 -0
index 4b8aabc..a98a0bb 100644

lib/bb/ui/crumbs/hobeventhandler.py class HobHandler(gobject.GObject): · line 281

Quoted 8 lines
lib/bb/ui/crumbs/hobeventhandler.py +2 -0
@@ -274,6 +274,8 @@ class HobHandler(gobject.GObject):
         self.server.runCommand(["setVariable", "IMAGE_FSTYPES", " ".join(image_fstypes).lstrip(" ")])
 
     def set_distro(self, distro):
+        if distro == "defaultsetup":
+            distro = ""
         self.server.runCommand(["setVariable", "DISTRO", distro])
 
     def set_package_format(self, format):

This worries me a little since you're doing something different to what the usual case would be (DISTRO not set at all). Is there not a way we can not set DISTRO at all so we ensure we're consistent?

What I'd like to avoid is a set of "hob-only" bugs caused by doing things slightly differently.

Cheers,

Richard

#10 lore raw

Re: [PATCH 8/8] Hob: Set empty DISTRO if "defaultsetup" is selected

Quoted 24 lines · Richard Purdie
Quoted 23 lines · Dongxiao Xu

In Hob advanced setting, if "defaultsetup" is selected, we need to set empty to DISTRO variable in bitbake server.

Otherwise, defaultsetup.conf will be parsed twice, causing TMPDIR and its related variables mess up.

---
 lib/bb/ui/crumbs/hobeventhandler.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
lib/bb/ui/crumbs/hobeventhandler.py +2 -0
index 4b8aabc..a98a0bb 100644
@@ -274,6 +274,8 @@ class HobHandler(gobject.GObject):
         self.server.runCommand(["setVariable", "IMAGE_FSTYPES", " ".join(image_fstypes).lstrip(" ")])
 
     def set_distro(self, distro):
+        if distro == "defaultsetup":
+            distro = ""
         self.server.runCommand(["setVariable", "DISTRO", distro])
 
Quoted 8 lines

lib/bb/ui/crumbs/hobeventhandler.py class HobHandler(gobject.GObject): · line 281

Quoted 1 line
lib/bb/ui/crumbs/hobeventhandler.py +0 -0
     def set_package_format(self, format):

This worries me a little since you're doing something different to what the usual case would be (DISTRO not set at all). Is there not a way we can not set DISTRO at all so we ensure we're consistent?

What I'd like to avoid is a set of "hob-only" bugs caused by doing things slightly differently.

The logic should be:

def set_distro(self, distro):
if distro != "defaultsetup":
self.server.runCommand(["setVariable", "DISTRO", distro])

Do you think this is reasonable?

Thanks,
Dongxiao

Quoted 7 lines

Cheers,

Richard

#11 lore raw

Re: [PATCH 8/8] Hob: Set empty DISTRO if "defaultsetup" is selected

Quoted 34 lines · Dongxiao
Quoted 24 lines · Richard Purdie
Quoted 23 lines · Dongxiao Xu

In Hob advanced setting, if "defaultsetup" is selected, we need to set empty to DISTRO variable in bitbake server.

Otherwise, defaultsetup.conf will be parsed twice, causing TMPDIR and its related variables mess up.

---
 lib/bb/ui/crumbs/hobeventhandler.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
lib/bb/ui/crumbs/hobeventhandler.py +2 -0
index 4b8aabc..a98a0bb 100644
@@ -274,6 +274,8 @@ class HobHandler(gobject.GObject):
         self.server.runCommand(["setVariable", "IMAGE_FSTYPES", " ".join(image_fstypes).lstrip(" ")])
 
     def set_distro(self, distro):
+        if distro == "defaultsetup":
+            distro = ""
         self.server.runCommand(["setVariable", "DISTRO", distro])
 
Quoted 8 lines

lib/bb/ui/crumbs/hobeventhandler.py class HobHandler(gobject.GObject): · line 281

Quoted 1 line
lib/bb/ui/crumbs/hobeventhandler.py +0 -0
     def set_package_format(self, format):

This worries me a little since you're doing something different to what the usual case would be (DISTRO not set at all). Is there not a way we can not set DISTRO at all so we ensure we're consistent?

What I'd like to avoid is a set of "hob-only" bugs caused by doing things slightly differently.

Quoted 7 lines

The logic should be:

def set_distro(self, distro):
if distro != "defaultsetup":
self.server.runCommand(["setVariable", "DISTRO", distro])

Do you think this is reasonable?

Yes, I'm happier with that.

Cheers,

Richard