summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Smirnov <eu.smirnoff@gmail.com>2019-10-18 13:16:14 +0200
committerArmin Kuster <akuster808@gmail.com>2019-10-25 23:44:34 -0700
commit03796926046e5b5b57349d66de6bb009a34d2cb2 (patch)
tree5a1d5392bbfbac319ee78757cbccc02e4dba8600
parente8f39536d2616ea0bb8bab459da29af63e3ee336 (diff)
downloadopenembedded-core-contrib-03796926046e5b5b57349d66de6bb009a34d2cb2.tar.gz
openembedded-core-contrib-03796926046e5b5b57349d66de6bb009a34d2cb2.tar.bz2
openembedded-core-contrib-03796926046e5b5b57349d66de6bb009a34d2cb2.zip
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. 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>
-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):
src = os.path.join(kernel_dir, source_params['file'])
dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno))
+ if not os.path.exists(os.path.dirname(dst)):
+ os.makedirs(os.path.dirname(dst))
+
if 'skip' in source_params:
sparse_copy(src, dst, skip=int(source_params['skip']))
else: