summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/image.py46
1 files changed, 37 insertions, 9 deletions
diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
index f9e9bfd587..b0d81a6b22 100644
--- a/meta/lib/oe/image.py
+++ b/meta/lib/oe/image.py
@@ -5,7 +5,7 @@ import multiprocessing
5 5
6 6
7def generate_image(arg): 7def generate_image(arg):
8 (type, subimages, create_img_cmd) = arg 8 (type, subimages, create_img_cmd, sprefix) = arg
9 9
10 bb.note("Running image creation script for %s: %s ..." % 10 bb.note("Running image creation script for %s: %s ..." %
11 (type, create_img_cmd)) 11 (type, create_img_cmd))
@@ -264,9 +264,9 @@ class Image(ImageDepGraph):
264 264
265 return (alltypes, filtered_groups, cimages) 265 return (alltypes, filtered_groups, cimages)
266 266
267 def _write_script(self, type, cmds): 267 def _write_script(self, type, cmds, sprefix=""):
268 tempdir = self.d.getVar('T', True) 268 tempdir = self.d.getVar('T', True)
269 script_name = os.path.join(tempdir, "create_image." + type) 269 script_name = os.path.join(tempdir, sprefix + "create_image." + type)
270 rootfs_size = self._get_rootfs_size() 270 rootfs_size = self._get_rootfs_size()
271 271
272 self.d.setVar('img_creation_func', '\n'.join(cmds)) 272 self.d.setVar('img_creation_func', '\n'.join(cmds))
@@ -284,7 +284,7 @@ class Image(ImageDepGraph):
284 284
285 return script_name 285 return script_name
286 286
287 def _get_imagecmds(self): 287 def _get_imagecmds(self, sprefix=""):
288 old_overrides = self.d.getVar('OVERRIDES', 0) 288 old_overrides = self.d.getVar('OVERRIDES', 0)
289 289
290 alltypes, fstype_groups, cimages = self._get_image_types() 290 alltypes, fstype_groups, cimages = self._get_image_types()
@@ -320,9 +320,9 @@ class Image(ImageDepGraph):
320 else: 320 else:
321 subimages.append(type) 321 subimages.append(type)
322 322
323 script_name = self._write_script(type, cmds) 323 script_name = self._write_script(type, cmds, sprefix)
324 324
325 image_cmds.append((type, subimages, script_name)) 325 image_cmds.append((type, subimages, script_name, sprefix))
326 326
327 image_cmd_groups.append(image_cmds) 327 image_cmd_groups.append(image_cmds)
328 328
@@ -355,6 +355,27 @@ class Image(ImageDepGraph):
355 355
356 image_cmd_groups = self._get_imagecmds() 356 image_cmd_groups = self._get_imagecmds()
357 357
358 # Process the debug filesystem...
359 debugfs_d = bb.data.createCopy(self.d)
360 if self.d.getVar('IMAGE_GEN_DEBUGFS', True) == "1":
361 bb.note("Processing debugfs image(s) ...")
362 orig_d = self.d
363 self.d = debugfs_d
364
365 self.d.setVar('IMAGE_ROOTFS', orig_d.getVar('IMAGE_ROOTFS', True) + '-dbg')
366 self.d.setVar('IMAGE_NAME', orig_d.getVar('IMAGE_NAME', True) + '-dbg')
367 self.d.setVar('IMAGE_LINK_NAME', orig_d.getVar('IMAGE_LINK_NAME', True) + '-dbg')
368
369 debugfs_image_fstypes = orig_d.getVar('IMAGE_FSTYPES_DEBUGFS', True)
370 if debugfs_image_fstypes:
371 self.d.setVar('IMAGE_FSTYPES', orig_d.getVar('IMAGE_FSTYPES_DEBUGFS', True))
372
373 self._remove_old_symlinks()
374
375 image_cmd_groups += self._get_imagecmds("debugfs.")
376
377 self.d = orig_d
378
358 self._write_wic_env() 379 self._write_wic_env()
359 380
360 for image_cmds in image_cmd_groups: 381 for image_cmds in image_cmd_groups:
@@ -369,9 +390,16 @@ class Image(ImageDepGraph):
369 if result is not None: 390 if result is not None:
370 bb.fatal(result) 391 bb.fatal(result)
371 392
372 for image_type, subimages, script in image_cmds: 393 for image_type, subimages, script, sprefix in image_cmds:
373 bb.note("Creating symlinks for %s image ..." % image_type) 394 if sprefix == 'debugfs.':
374 self._create_symlinks(subimages) 395 bb.note("Creating symlinks for %s debugfs image ..." % image_type)
396 orig_d = self.d
397 self.d = debugfs_d
398 self._create_symlinks(subimages)
399 self.d = orig_d
400 else:
401 bb.note("Creating symlinks for %s image ..." % image_type)
402 self._create_symlinks(subimages)
375 403
376 execute_pre_post_process(self.d, post_process_cmds) 404 execute_pre_post_process(self.d, post_process_cmds)
377 405