summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/filemap.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py
index 1f1aacc522..585b7ea84e 100644
--- a/scripts/lib/wic/filemap.py
+++ b/scripts/lib/wic/filemap.py
@@ -545,11 +545,14 @@ def sparse_copy(src_fname, dst_fname, offset=0, skip=0, api=None):
545 start = first * fmap.block_size 545 start = first * fmap.block_size
546 end = (last + 1) * fmap.block_size 546 end = (last + 1) * fmap.block_size
547 547
548 if skip >= end:
549 continue
550
548 if start < skip < end: 551 if start < skip < end:
549 fmap._f_image.seek(skip, os.SEEK_SET) 552 start = skip
550 else: 553
551 fmap._f_image.seek(start, os.SEEK_SET) 554 fmap._f_image.seek(start, os.SEEK_SET)
552 dst_file.seek(offset + start, os.SEEK_SET) 555 dst_file.seek(offset + start - skip, os.SEEK_SET)
553 556
554 chunk_size = 1024 * 1024 557 chunk_size = 1024 * 1024
555 to_read = end - start 558 to_read = end - start