diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-04-28 13:58:10 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-06 10:31:13 +0100 |
commit | db9557cc46ff643ab894bbf724c9952290cd9f22 (patch) | |
tree | 3e5665e0f6df82b4a75adccbc9d6f09889c6d924 /scripts/lib | |
parent | 4b971568e142952aa4c71ebc7a1f5326717ff210 (diff) | |
download | poky-db9557cc46ff643ab894bbf724c9952290cd9f22.tar.gz |
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]
(From OE-Core rev: 7f21427aca5df81d8881027fd98f71b821cf31d7)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/wic/utils/partitionedfs.py | 6 |
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 | |||
22 | from wic import msger | 22 | from wic import msger |
23 | from wic.utils.errors import ImageError | 23 | from wic.utils.errors import ImageError |
24 | from wic.utils.oe.misc import exec_cmd, exec_native_cmd | 24 | from wic.utils.oe.misc import exec_cmd, exec_native_cmd |
25 | from wic.filemap import sparse_copy | ||
25 | 26 | ||
26 | # Overhead of the MBR partitioning scheme (just one sector) | 27 | # Overhead of the MBR partitioning scheme (just one sector) |
27 | MBR_OVERHEAD = 1 | 28 | MBR_OVERHEAD = 1 |
@@ -343,10 +344,7 @@ class Image(object): | |||
343 | source = part['source_file'] | 344 | source = part['source_file'] |
344 | if source: | 345 | if source: |
345 | # install source_file contents into a partition | 346 | # install source_file contents into a partition |
346 | cmd = "dd if=%s of=%s bs=%d seek=%d count=%d conv=notrunc" % \ | 347 | sparse_copy(source, image_file, part['start'] * self.sector_size) |
347 | (source, image_file, self.sector_size, | ||
348 | part['start'], part['size']) | ||
349 | exec_cmd(cmd) | ||
350 | 348 | ||
351 | msger.debug("Installed %s in partition %d, sectors %d-%d, " | 349 | msger.debug("Installed %s in partition %d, sectors %d-%d, " |
352 | "size %d sectors" % \ | 350 | "size %d sectors" % \ |