]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: filemap: Fixed spared_copy skip
authorDaniel Schultz <d.schultz@phytec.de>
Tue, 7 Mar 2017 13:41:56 +0000 (14:41 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 10 Mar 2017 10:15:45 +0000 (10:15 +0000)
This patches removes the empty space in front of the copied file which
was skipped. Without this reduction it's not possible to place a
partition with rawcopy and skip parameter on a desired alignment.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/wic/filemap.py

index f3240ba8d870bf9e99d21cdc2c094551ee1c5bd1..162603ed0a101d9bf472acb0d45a1e06856b692e 100644 (file)
@@ -543,9 +543,9 @@ def sparse_copy(src_fname, dst_fname, offset=0, skip=0):
         end = (last + 1) * fmap.block_size
 
         if start < skip < end:
-            start = skip
-
-        fmap._f_image.seek(start, os.SEEK_SET)
+            fmap._f_image.seek(skip, os.SEEK_SET)
+        else:
+            fmap._f_image.seek(start, os.SEEK_SET)
         dst_file.seek(offset + start, os.SEEK_SET)
 
         chunk_size = 1024 * 1024