summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-04-28 13:58:11 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-06 10:31:13 +0100
commit7669219652bcc10fe957114952861d450f825274 (patch)
tree21a4ffb766ffb4bf7a48e5bd1e765fd0d9291860
parentdb9557cc46ff643ab894bbf724c9952290cd9f22 (diff)
downloadpoky-7669219652bcc10fe957114952861d450f825274.tar.gz
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] (From OE-Core rev: 04eca59068a79ae6a9969be495c4cdf0c5c3e466) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/wic/plugins/source/rawcopy.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py
index 0472f536ba..ba014b0714 100644
--- a/scripts/lib/wic/plugins/source/rawcopy.py
+++ b/scripts/lib/wic/plugins/source/rawcopy.py
@@ -20,6 +20,7 @@ import os
20from wic import msger 20from wic import msger
21from wic.pluginbase import SourcePlugin 21from wic.pluginbase import SourcePlugin
22from wic.utils.oe.misc import exec_cmd, get_bitbake_var 22from wic.utils.oe.misc import exec_cmd, get_bitbake_var
23from wic.filemap import sparse_copy
23 24
24class RawCopyPlugin(SourcePlugin): 25class RawCopyPlugin(SourcePlugin):
25 """ 26 """
@@ -70,11 +71,9 @@ class RawCopyPlugin(SourcePlugin):
70 dst = os.path.join(cr_workdir, source_params['file']) 71 dst = os.path.join(cr_workdir, source_params['file'])
71 72
72 if 'skip' in source_params: 73 if 'skip' in source_params:
73 dd_cmd = "dd if=%s of=%s ibs=%s skip=1 conv=notrunc" % \ 74 sparse_copy(src, dst, skip=source_params['skip'])
74 (src, dst, source_params['skip'])
75 else: 75 else:
76 dd_cmd = "cp %s %s" % (src, dst) 76 sparse_copy(src, dst)
77 exec_cmd(dd_cmd)
78 77
79 # get the size in the right units for kickstart (kB) 78 # get the size in the right units for kickstart (kB)
80 du_cmd = "du -Lbks %s" % dst 79 du_cmd = "du -Lbks %s" % dst