diff options
| author | Lee Chee Yang <Chee.Yang.Lee@intel.com> | 2021-02-08 09:22:55 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-02-26 15:30:39 +0000 |
| commit | e63e8599d848919701f5927a2f52c7f0529b45f2 (patch) | |
| tree | 05a9fb886df04736b7ce0857b1053ba33ecec5e5 /scripts/lib/wic/plugins/imager/direct.py | |
| parent | 1874f7f50591dd868322c3dfb87f233b6e32bd9c (diff) | |
| download | poky-e63e8599d848919701f5927a2f52c7f0529b45f2.tar.gz | |
wic: debug mode to keep tmp directory
files in wic tmp directory can be usefull for debugging, so do not remove
tmp directory when wic create run with debugging mode (-D or --debug).
also update wic.Wic.test_debug_short and wic.Wic.test_debug_long to
check for tmp directory.
[YOCTO#14216]
(From OE-Core rev: 04d334d5bc5353c39c5059d25d97f111a9e368d9)
Signed-off-by: Lee Chee Yang <Chee.Yang.Lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a122e2418b67d38f691edcf8dd846c167d6b4fa9)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/plugins/imager/direct.py')
| -rw-r--r-- | scripts/lib/wic/plugins/imager/direct.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py index 7e1c1c03ab..ea709e8c54 100644 --- a/scripts/lib/wic/plugins/imager/direct.py +++ b/scripts/lib/wic/plugins/imager/direct.py | |||
| @@ -54,6 +54,7 @@ class DirectPlugin(ImagerPlugin): | |||
| 54 | self.native_sysroot = native_sysroot | 54 | self.native_sysroot = native_sysroot |
| 55 | self.oe_builddir = oe_builddir | 55 | self.oe_builddir = oe_builddir |
| 56 | 56 | ||
| 57 | self.debug = options.debug | ||
| 57 | self.outdir = options.outdir | 58 | self.outdir = options.outdir |
| 58 | self.compressor = options.compressor | 59 | self.compressor = options.compressor |
| 59 | self.bmap = options.bmap | 60 | self.bmap = options.bmap |
| @@ -274,8 +275,9 @@ class DirectPlugin(ImagerPlugin): | |||
| 274 | if os.path.isfile(path): | 275 | if os.path.isfile(path): |
| 275 | shutil.move(path, os.path.join(self.outdir, fname)) | 276 | shutil.move(path, os.path.join(self.outdir, fname)) |
| 276 | 277 | ||
| 277 | # remove work directory | 278 | # remove work directory when it is not in debugging mode |
| 278 | shutil.rmtree(self.workdir, ignore_errors=True) | 279 | if not self.debug: |
| 280 | shutil.rmtree(self.workdir, ignore_errors=True) | ||
| 279 | 281 | ||
| 280 | # Overhead of the MBR partitioning scheme (just one sector) | 282 | # Overhead of the MBR partitioning scheme (just one sector) |
| 281 | MBR_OVERHEAD = 1 | 283 | MBR_OVERHEAD = 1 |
