Patchwork [bitbake-devel] hob: fix customization of empty image recipe

login
register
mail settings
Submitter Marius Avram
Date April 3, 2014, 12:15 p.m.
Message ID <1396527360-25682-1-git-send-email-marius.avram@intel.com>
Download mbox | patch
Permalink /patch/70061/
State New
Headers show

Comments

Marius Avram - April 3, 2014, 12:15 p.m.
This fixes a problem which happened when you tried to build an
image by selecting 'Start with an empty image recipe' from the
Image configuration page of hob.

The reason on of the bug was that the name of the resulting image
was threated the same way as ordinary custom images, when in fact
they should use the default name: "hob-image", because they do not
derive from any other recipe.

[YOCTO #6102]

Signed-off-by: Marius Avram <marius.avram@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py         |    3 ++-
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    9 +++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 9adb1f7..3033e77 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -739,7 +739,8 @@  class Builder(gtk.Window):
 
     def set_base_image(self):
         self.configuration.initial_selected_image = self.configuration.selected_image
-        self.hob_image = self.configuration.selected_image + "-edited"
+        if self.configuration.selected_image != self.recipe_model.__custom_image__:
+            self.hob_image = self.configuration.selected_image + "-edited"
 
     def reset(self):
         self.configuration.curr_mach = ""
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 890e05f..62c4704 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -171,10 +171,11 @@  class HobHandler(gobject.GObject):
                 self.generate_hob_base_image(target)
                 self.set_var_in_file("LINGUAS_INSTALL", "", "local.conf")
                 hobImage = self.runCommand(["matchFile", target + ".bb"])
-                baseImage = self.runCommand(["matchFile", self.base_image + ".bb"])
-                version = self.runCommand(["generateNewImage", hobImage, baseImage, self.package_queue, True, ""])
-                target += version
-                self.recipe_model.set_custom_image_version(version)
+                if self.base_image != self.recipe_model.__custom_image__:
+                    baseImage = self.runCommand(["matchFile", self.base_image + ".bb"])
+                    version = self.runCommand(["generateNewImage", hobImage, baseImage, self.package_queue, True, ""])
+                    target += version
+                    self.recipe_model.set_custom_image_version(version)
 
             targets = [target]
             if self.toolchain_packages: