[oe-commits] [openembedded-core] 20/31: wic: use sparse_copy to preserve sparseness

git at git.openembedded.org git at git.openembedded.org
Fri Apr 29 08:24:27 UTC 2016


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

commit 9f054b016d98c41fb06b0456d5a633048f0aa470
Author: Ed Bartosh <ed.bartosh at linux.intel.com>
AuthorDate: Thu Apr 28 13:58:11 2016 +0300

    wic: use sparse_copy to preserve sparseness
    
    Used sparse_copy API in favor of dd/cp in rawcopy plugin to
    preserve sparseness of the copied raw content.
    
    [YOCTO #9099]
    
    Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/lib/wic/plugins/source/rawcopy.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py
index 0472f53..ba014b0 100644
--- a/scripts/lib/wic/plugins/source/rawcopy.py
+++ b/scripts/lib/wic/plugins/source/rawcopy.py
@@ -20,6 +20,7 @@ import os
 from wic import msger
 from wic.pluginbase import SourcePlugin
 from wic.utils.oe.misc import exec_cmd, get_bitbake_var
+from wic.filemap import sparse_copy
 
 class RawCopyPlugin(SourcePlugin):
     """
@@ -70,11 +71,9 @@ class RawCopyPlugin(SourcePlugin):
         dst = os.path.join(cr_workdir, source_params['file'])
 
         if 'skip' in source_params:
-            dd_cmd = "dd if=%s of=%s ibs=%s skip=1 conv=notrunc" % \
-                    (src, dst, source_params['skip'])
+            sparse_copy(src, dst, skip=source_params['skip'])
         else:
-            dd_cmd = "cp %s %s" % (src, dst)
-        exec_cmd(dd_cmd)
+            sparse_copy(src, dst)
 
         # get the size in the right units for kickstart (kB)
         du_cmd = "du -Lbks %s" % dst

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


More information about the Openembedded-commits mailing list