summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEugene Smirnov <eu.smirnoff@gmail.com>2019-10-18 13:16:14 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-10-19 23:18:33 +0100
commit8d619931eecd40c952c16864a4dc4f4dae2a0c63 (patch)
tree6d402c4ca9c1da062fa2d691ff362d194f3d0766 /scripts
parentc8535ece54fea0f8d3226666799611825587dbdf (diff)
downloadpoky-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')
-rw-r--r--scripts/lib/wic/plugins/source/rawcopy.py3
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: