diff options
| author | Eugene Smirnov <eu.smirnoff@gmail.com> | 2019-10-18 13:16:14 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-10-19 23:18:33 +0100 |
| commit | 8d619931eecd40c952c16864a4dc4f4dae2a0c63 (patch) | |
| tree | 6d402c4ca9c1da062fa2d691ff362d194f3d0766 /scripts/lib/wic/plugins/source/rawcopy.py | |
| parent | c8535ece54fea0f8d3226666799611825587dbdf (diff) | |
| download | poky-8d619931eecd40c952c16864a4dc4f4dae2a0c63.tar.gz | |
wic/rawcopy: Support files in sub-directories
If the source file is located in a subdirectory of DEPLOY_DIR
rawcopy will currently fail in sparse_copy function on
open(dst_fname, 'wb'), as the parent directory for destination
file does not exist.
This patch helps to avoid that by recursively creating
parent directories.
(From OE-Core rev: 073c435644091c2801e45c6d02afa917de575082)
Signed-off-by: Eugene Smirnov <evgenii.smirnov@here.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/plugins/source/rawcopy.py')
| -rw-r--r-- | scripts/lib/wic/plugins/source/rawcopy.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py index df86d6729c..82970ce51b 100644 --- a/scripts/lib/wic/plugins/source/rawcopy.py +++ b/scripts/lib/wic/plugins/source/rawcopy.py | |||
| @@ -59,6 +59,9 @@ class RawCopyPlugin(SourcePlugin): | |||
| 59 | src = os.path.join(kernel_dir, source_params['file']) | 59 | src = os.path.join(kernel_dir, source_params['file']) |
| 60 | dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno)) | 60 | dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno)) |
| 61 | 61 | ||
| 62 | if not os.path.exists(os.path.dirname(dst)): | ||
| 63 | os.makedirs(os.path.dirname(dst)) | ||
| 64 | |||
| 62 | if 'skip' in source_params: | 65 | if 'skip' in source_params: |
| 63 | sparse_copy(src, dst, skip=int(source_params['skip'])) | 66 | sparse_copy(src, dst, skip=int(source_params['skip'])) |
| 64 | else: | 67 | else: |
