summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/image.py
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2015-10-02 10:25:21 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-07 00:11:16 +0100
commita0d9d2d727d646d7847ca9824ae535f9e369d485 (patch)
tree730bfe5e3db23caab9aa7ee155ed1a45ab9c7e35 /meta/lib/oe/image.py
parent8ee9a933a5bfc8c1de95aa1770bfd64add12f927 (diff)
downloadpoky-a0d9d2d727d646d7847ca9824ae535f9e369d485.tar.gz
lib/oe/image.py: Add image generation for companion debug filesystem
The companion debug filesystem, enabled with IMAGE_GEN_DEBUGFS, was creating the companion filesystem but was missing the code to actually package it into a usable filesystem. The code (and associated documentation) will allow the debugfs to generate a companion tarball or other image. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/image.py')
-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