diff options
author | Cristiana Voicu <cristiana.voicu@intel.com> | 2013-07-25 07:45:28 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-06 13:02:25 +0100 |
commit | 63157e2c8726ed78f6b98c24a27d392a6452be55 (patch) | |
tree | 3d6a6b7a238a724c9e3f0e731f41936d6b73c617 /bitbake/lib/bb/cooker.py | |
parent | 08ccfacbc1a12904f51b9412fd13267edc265019 (diff) | |
download | poky-63157e2c8726ed78f6b98c24a27d392a6452be55.tar.gz |
bitbake: hob/bitbake: when an image is saved, it should require an image from layers
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]
(Bitbake rev: 28296ca78507ba2e414eb136c81afee65a8e25e5)
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index a4a6be658d..f009210f75 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1143,10 +1143,17 @@ class BBCooker: | |||
1143 | else: | 1143 | else: |
1144 | dest = image | 1144 | dest = image |
1145 | 1145 | ||
1146 | if base_image: | ||
1147 | with open(base_image, 'r') as f: | ||
1148 | require_line = f.readline() | ||
1149 | |||
1146 | with open(dest, "w") as imagefile: | 1150 | with open(dest, "w") as imagefile: |
1147 | if base_image is None: | 1151 | if base_image is None: |
1148 | imagefile.write("inherit image\n") | 1152 | imagefile.write("inherit image\n") |
1149 | else: | 1153 | else: |
1154 | topdir = self.data.getVar("TOPDIR") | ||
1155 | if topdir in base_image: | ||
1156 | base_image = require_line.split()[1] | ||
1150 | imagefile.write("require " + base_image + "\n") | 1157 | imagefile.write("require " + base_image + "\n") |
1151 | package_install = "PACKAGE_INSTALL_forcevariable = \"" | 1158 | package_install = "PACKAGE_INSTALL_forcevariable = \"" |
1152 | for package in package_queue: | 1159 | for package in package_queue: |