summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/cooker.py11
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