summaryrefslogtreecommitdiff
path: root/scripts/lib/wic/plugins/source
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:30:56 +0100
commit04eca59068a79ae6a9969be495c4cdf0c5c3e466 (patch)
treecea0a975242bff61661cffc1adbb7ef130696e98 /scripts/lib/wic/plugins/source
parent7f21427aca5df81d8881027fd98f71b821cf31d7 (diff)
downloadopenembedded-core-04eca59068a79ae6a9969be495c4cdf0c5c3e466.tar.gz
openembedded-core-04eca59068a79ae6a9969be495c4cdf0c5c3e466.tar.bz2
openembedded-core-04eca59068a79ae6a9969be495c4cdf0c5c3e466.zip
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@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/plugins/source')
-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
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