summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-06-13 14:22:04 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-14 10:18:29 +0100
commitb67fd459d2d11c1f09c1c66f6ea0898266439f67 (patch)
tree47af91e33a4a177436aa666872fb2c155de5d4ab /scripts/lib/wic
parent59e0600427a7cb72146be1e3f8d7b4f977f4c848 (diff)
downloadpoky-b67fd459d2d11c1f09c1c66f6ea0898266439f67.tar.gz
filemap: check if dest is written for every block
If lenght parameter is provided to sparse_copy call it's mandatory to check if the output file is fully written after reading unmapped block from input file. If it's not done then sparse_copy can write more data than specified length. (From OE-Core rev: 289b1767182982dfb6912e64481150697ba93e4d) 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/filemap.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py
index 8719f443c5..764dbbe588 100644
--- a/scripts/lib/wic/filemap.py
+++ b/scripts/lib/wic/filemap.py
@@ -563,6 +563,13 @@ def sparse_copy(src_fname, dst_fname, skip=0, seek=0,
563 start = skip 563 start = skip
564 564
565 fmap._f_image.seek(start, os.SEEK_SET) 565 fmap._f_image.seek(start, os.SEEK_SET)
566
567 written += start - skip - written
568 if length and written >= length:
569 dst_file.seek(seek + length, os.SEEK_SET)
570 dst_file.close()
571 return
572
566 dst_file.seek(seek + start - skip, os.SEEK_SET) 573 dst_file.seek(seek + start - skip, os.SEEK_SET)
567 574
568 chunk_size = 1024 * 1024 575 chunk_size = 1024 * 1024