Patchwork [bitbake-devel,2/5] hob: create a base hob image used to create custom images

login
register
mail settings
Submitter Cristiana Voicu
Date Dec. 17, 2013, 1:04 p.m.
Message ID <1387285447-18057-3-git-send-email-cristiana.voicu@intel.com>
Download mbox | patch
Permalink /patch/63467/
State New
Headers show

Comments

Cristiana Voicu - Dec. 17, 2013, 1:04 p.m.
In order to remove hob-image.bb from meta-hob, a hob-image.bb should
be created somewhere in the build directory. I've saved it in build/recipes/images
directory, and moved the templates to recipes/images/custom (here are those
templates saved by the user).
The image is created when hob starts. Also it appends to BBFILES the directory
where it is created.

Removed images directory from meta-hob.

[YOCTO #5118]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py                |    3 ++-
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py        |    9 ++++++++-
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |    2 +-
 bitbake/lib/bb/ui/crumbs/imagedetailspage.py       |    2 +-
 meta-hob/recipes-core/images/hob-image.bb          |    1 -
 5 files changed, 12 insertions(+), 5 deletions(-)
 delete mode 100644 meta-hob/recipes-core/images/hob-image.bb

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 0ce9297..cc418fd 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -441,7 +441,8 @@  class Builder(gtk.Window):
         self.handler.connect("recipe-populated",         self.handler_recipe_populated_cb)
         self.handler.connect("package-populated",        self.handler_package_populated_cb)
 
-        self.handler.append_to_bbfiles("${TOPDIR}/recipes/images/*.bb")
+        self.handler.append_to_bbfiles("${TOPDIR}/recipes/images/custom/*.bb")
+        self.handler.generate_hob_base_image()
         self.initiate_new_build_async()
 
         signal.signal(signal.SIGINT, self.event_handle_SIGINT)
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index b12f2d8..4cb10b7 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -440,9 +440,16 @@  class HobHandler(gobject.GObject):
         self.run_next_command(self.GENERATE_IMAGE)
 
     def generate_new_image(self, image, base_image, package_queue, description):
-        base_image = self.runCommand(["matchFile", self.base_image + ".bb"])
+        if base_image:
+            base_image = self.runCommand(["matchFile", self.base_image + ".bb"])
         self.runCommand(["generateNewImage", image, base_image, package_queue, False, description])
 
+    def generate_hob_base_image(self):
+        image_dir = self.get_topdir() + "/recipes/images/"
+        self.ensure_dir(image_dir)
+        self.generate_new_image(image_dir+"hob-image.bb", None, [], "")
+        self.append_to_bbfiles(image_dir + "*.bb")
+
     def ensure_dir(self, directory):
         self.runCommand(["ensureDir", directory])
 
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
index 79709d0..5e40f71 100644
--- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -378,7 +378,7 @@  class ImageConfigurationPage (HobPage):
         selected_image = self.image_combo.get_active_text()
         if selected_image == self.__custom_image__:
             topdir = self.builder.get_topdir()
-            images_dir = topdir + "/recipes/images/"
+            images_dir = topdir + "/recipes/images/custom/"
             self.builder.ensure_dir(images_dir)
 
             dialog = RetrieveImageDialog(images_dir, "Select from my image recipes",
diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
index 271635f..352e948 100755
--- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
@@ -632,7 +632,7 @@  class ImageDetailsPage (HobPage):
 
     def save_button_clicked_cb(self, button):
         topdir = self.builder.get_topdir()
-        images_dir = topdir + "/recipes/images/"
+        images_dir = topdir + "/recipes/images/custom/"
         self.builder.ensure_dir(images_dir)
 
         self.name_field_template = self.builder.image_configuration_page.custom_image_selected
diff --git a/meta-hob/recipes-core/images/hob-image.bb b/meta-hob/recipes-core/images/hob-image.bb
deleted file mode 100644
index c8d6f49..0000000
--- a/meta-hob/recipes-core/images/hob-image.bb
+++ /dev/null
@@ -1 +0,0 @@ 
-inherit image