Patchwork [bitbake-devel,09/14] bitbake: when an image is saved, it should require an image from layers

login
register
mail settings
Submitter Cristiana Voicu
Date July 17, 2013, 10:35 a.m.
Message ID <1374057344-19708-10-git-send-email-cristiana.voicu@intel.com>
Download mbox | patch
Permalink /patch/53865/
State New
Headers show

Comments

Cristiana Voicu - July 17, 2013, 10:35 a.m.
If the image required is not from the layers and it is removed, when sanity
check is running, Hob will show some errors related to this.
Agreed to "require" only the images from layers.

[YOCTO #4193]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
---
 bitbake/lib/bb/cooker.py |    7 +++++++
 1 file changed, 7 insertions(+)
Chris Larson - July 19, 2013, 3:18 p.m.
On Wed, Jul 17, 2013 at 3:35 AM, Cristiana Voicu
<cristiana.voicu@intel.com>wrote:

> If the image required is not from the layers and it is removed, when sanity
> check is running, Hob will show some errors related to this.
> Agreed to "require" only the images from layers.
>
> [YOCTO #4193]
> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
>

Two issues with the commit message summary:
- bitbake: isn't necessary for the commit going to bit bake, only for when
it gets pulled into poky
- nowhere does it make it clear that this is hob-related

Patch

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 9965417..ad92dea 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1147,10 +1147,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: