Skip to content

Instantly share code, notes, and snippets.

@bartosh
Created March 20, 2017 16:14
Show Gist options
  • Save bartosh/d3a419a61af67c1ee5fc08232b50eb14 to your computer and use it in GitHub Desktop.
Save bartosh/d3a419a61af67c1ee5fc08232b50eb14 to your computer and use it in GitHub Desktop.
diff --git a/meta-refkit/lib/image-dsk.py b/meta-refkit/lib/image-dsk.py
index 2bddc5f..ee7d7c3 100644
--- a/meta-refkit/lib/image-dsk.py
+++ b/meta-refkit/lib/image-dsk.py
@@ -73,6 +73,7 @@ def sparse_copy(src_fname, dst_fname, offset_mib=0):
dst_file = open(dst_fname, 'r+b')
except IOError:
dst_file = open(dst_fname, 'wb')
+ dst_file.truncate(os.path.getsize(src_fname))
for first, last in filemap.get_mapped_ranges(0, filemap.blocks_cnt):
start = first * filemap.block_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment