bitbake: hob: create a base hob image used to create custom images
authorCristiana Voicu <cristiana.voicu@intel.com>
Tue, 25 Feb 2014 13:30:10 +0000 (15:30 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 28 Feb 2014 14:48:40 +0000 (14:48 +0000)
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]
(Bitbake rev: 4587297b51b7ca71d314bdb2c06f2061e7d4aa7d)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/ui/crumbs/builder.py
bitbake/lib/bb/ui/crumbs/hobeventhandler.py
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
bitbake/lib/bb/ui/crumbs/imagedetailspage.py

index 5ae1ddb..1c8469b 100755 (executable)
@@ -446,7 +446,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)
index 1282070..e848405 100644 (file)
@@ -436,9 +436,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])
 
index 6372592..c4fd3f7 100644 (file)
@@ -379,7 +379,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",
index 271635f..352e948 100755 (executable)
@@ -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