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-29 09:08:17 +0000 |
commit | 6fb5afb65de3a2f94d705e93ebdbc1f46299e885 (patch) | |
tree | fa3efa9c735dcde23c51a76f6a00fd4be3b624d2 /scripts | |
parent | 13a3b14503679b24e28517a75059e3ba78e3fbe3 (diff) | |
download | poky-6fb5afb65de3a2f94d705e93ebdbc1f46299e885.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: 03796926046e5b5b57349d66de6bb009a34d2cb2)
Signed-off-by: Eugene Smirnov <evgenii.smirnov@here.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 073c435644091c2801e45c6d02afa917de575082)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-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: |