]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
hob/bitbake: when an image is saved, it should require an image from layers
authorCristiana Voicu <cristiana.voicu@intel.com>
Thu, 25 Jul 2013 07:45:28 +0000 (07:45 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 6 Aug 2013 12:00:07 +0000 (13:00 +0100)
Saving an image that requires another image will cause issues when
the second on is removed. So, we have agreed to "require" only the images
from layers.
The functionality is implemented in bitbake, in order to be more abstract,
and it is used by Hob when an image recipe is saved.

[YOCTO #4193]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/cooker.py

index a4a6be658d35a36db8f9b5b7cf9a1ebd90aedca6..f009210f755be768d65863460dc3409186ca6ac6 100644 (file)
@@ -1143,10 +1143,17 @@ class BBCooker:
             else:
                 dest = image
 
+        if base_image:
+            with open(base_image, 'r') as f:
+                require_line = f.readline()
+
         with open(dest, "w") as imagefile:
             if base_image is None:
                 imagefile.write("inherit image\n")
             else:
+                topdir = self.data.getVar("TOPDIR")
+                if topdir in base_image:
+                    base_image = require_line.split()[1]
                 imagefile.write("require " + base_image + "\n")
             package_install = "PACKAGE_INSTALL_forcevariable = \""
             for package in package_queue: