[oe-commits] [openembedded-core] 05/20: wic/rawcopy: Support files in sub-directories

git at git.openembedded.org git at git.openembedded.org
Sat Oct 19 17:14:06 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 073c435644091c2801e45c6d02afa917de575082
Author: Eugene Smirnov <eu.smirnoff at gmail.com>
AuthorDate: Fri Oct 18 13:16:14 2019 +0200

    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 at here.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/lib/wic/plugins/source/rawcopy.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py
index df86d67..82970ce 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:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list