diff options
author | Marius Avram <marius.avram@intel.com> | 2014-04-01 13:59:05 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-04-04 15:08:26 +0100 |
commit | 56c776de3b8f4ec3eb991325bb88e53539542e09 (patch) | |
tree | 6305e80712a8914eac8d4a327b0761256ca0eed8 /bitbake/lib/bb | |
parent | 07231022e20e3e15f2c851617626b52e8de0843c (diff) | |
download | poky-56c776de3b8f4ec3eb991325bb88e53539542e09.tar.gz |
bitbake: cooker: Overwrite IMAGE_BASENAME to default in custom image
This solves a problem of custom images which inherit a base
image with IMAGE_BASENAME overwritten in their recipe by a
different value than its default one: ${PN}.
The value of IMAGE_BASE causes a crash when hob will try to
create symbolic links to the resulting images from the deploy
directory, because it will look for names similar to
<original_recipe_name>-edited-timestamp-machine.rootfs.*
which might be different from the actual resulting image.
The solution is to simply overwrite IMAGE_BASENAME in the
custom recipe to the default value in the case IMAGE_BASENAME
is found in the base recipe.
Some recipes which were affected by this problem are those
from meta-fsl-demos (e.g.: fsl-image-test).
[YOCTO #6017]
(Bitbake rev: e42ee93519000f827be49659b6b5fb7717b3d592)
Signed-off-by: Marius Avram <marius.avram@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index f41f5946ae..f44a08889a 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1228,6 +1228,7 @@ class BBCooker: | |||
1228 | ''' | 1228 | ''' |
1229 | Create a new image with a "require"/"inherit" base_image statement | 1229 | Create a new image with a "require"/"inherit" base_image statement |
1230 | ''' | 1230 | ''' |
1231 | import re | ||
1231 | if timestamp: | 1232 | if timestamp: |
1232 | image_name = os.path.splitext(image)[0] | 1233 | image_name = os.path.splitext(image)[0] |
1233 | timestr = time.strftime("-%Y%m%d-%H%M%S") | 1234 | timestr = time.strftime("-%Y%m%d-%H%M%S") |
@@ -1238,9 +1239,14 @@ class BBCooker: | |||
1238 | else: | 1239 | else: |
1239 | dest = image | 1240 | dest = image |
1240 | 1241 | ||
1242 | basename = False | ||
1241 | if base_image: | 1243 | if base_image: |
1242 | with open(base_image, 'r') as f: | 1244 | with open(base_image, 'r') as f: |
1243 | require_line = f.readline() | 1245 | require_line = f.readline() |
1246 | p = re.compile("IMAGE_BASENAME *=") | ||
1247 | for line in f: | ||
1248 | if p.search(line): | ||
1249 | basename = True | ||
1244 | 1250 | ||
1245 | with open(dest, "w") as imagefile: | 1251 | with open(dest, "w") as imagefile: |
1246 | if base_image is None: | 1252 | if base_image is None: |
@@ -1259,6 +1265,11 @@ class BBCooker: | |||
1259 | description_var = "DESCRIPTION = \"" + description + "\"\n" | 1265 | description_var = "DESCRIPTION = \"" + description + "\"\n" |
1260 | imagefile.write(description_var) | 1266 | imagefile.write(description_var) |
1261 | 1267 | ||
1268 | if basename: | ||
1269 | # If this is overwritten in a inherited image, reset it to default | ||
1270 | image_basename = "IMAGE_BASENAME = \"${PN}\"\n" | ||
1271 | imagefile.write(image_basename) | ||
1272 | |||
1262 | self.state = state.initial | 1273 | self.state = state.initial |
1263 | if timestamp: | 1274 | if timestamp: |
1264 | return timestr | 1275 | return timestr |