[bitbake-devel,PATCH_V2,09/16] hob/bitbake: when an image is saved, it should require an image from layers

Submitted by Cristiana Voicu on July 25, 2013, 11:42 a.m.

Details

Message ID 1374752549-29471-10-git-send-email-cristiana.voicu@intel.com
State New
Headers show

Commit Message

Cristiana Voicu July 25, 2013, 11:42 a.m.
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>
---
 bitbake/lib/bb/cooker.py |    7 +++++++
 1 file changed, 7 insertions(+)

Patch hide | download patch | download mbox

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: