summaryrefslogtreecommitdiff
path: root/scripts/lib/wic
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-04-28 13:58:10 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-06 10:30:56 +0100
commit7f21427aca5df81d8881027fd98f71b821cf31d7 (patch)
tree1883b650a0e937692508ab2e5a6c1ecf2645ed40 /scripts/lib/wic
parentbfde62bdc03152a4d3d383512479b974fa867f94 (diff)
downloadopenembedded-core-7f21427aca5df81d8881027fd98f71b821cf31d7.tar.gz
openembedded-core-7f21427aca5df81d8881027fd98f71b821cf31d7.tar.bz2
openembedded-core-7f21427aca5df81d8881027fd98f71b821cf31d7.zip
wic: use sparse_copy to copy partitions
Copied partition images into final partitioned image using sparse_copy API. This method preserves sparseness of the final image. It also makes wic much faster, as unmapped blocks of the partition images are not copied. [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')
-rw-r--r--scripts/lib/wic/utils/partitionedfs.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py
index 4170ec1918..534635b2ac 100644
--- a/scripts/lib/wic/utils/partitionedfs.py
+++ b/scripts/lib/wic/utils/partitionedfs.py
@@ -22,6 +22,7 @@ import os
from wic import msger
from wic.utils.errors import ImageError
from wic.utils.oe.misc import exec_cmd, exec_native_cmd
+from wic.filemap import sparse_copy
# Overhead of the MBR partitioning scheme (just one sector)
MBR_OVERHEAD = 1
@@ -343,10 +344,7 @@ class Image(object):
source = part['source_file']
if source:
# install source_file contents into a partition
- cmd = "dd if=%s of=%s bs=%d seek=%d count=%d conv=notrunc" % \
- (source, image_file, self.sector_size,
- part['start'], part['size'])
- exec_cmd(cmd)
+ sparse_copy(source, image_file, part['start'] * self.sector_size)
msger.debug("Installed %s in partition %d, sectors %d-%d, "
"size %d sectors" % \