summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-04-06 14:58:49 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-12 15:09:57 +0100
commit8838dd2dbd7ff2a3c93e0bdc6d8b181ee8079c3f (patch)
treea5917cf90829e91b3e4b6b69fd644cec71e7b153 /scripts
parent7792688ac24931cdf70b61839b55120c50e8e10d (diff)
downloadpoky-8838dd2dbd7ff2a3c93e0bdc6d8b181ee8079c3f.tar.gz
oe-selftest: test wic sparse_copy API
Added new parameter 'api' to sparse_copy function to specify underlying filemap API to use. By default sparse_copy will try both available APIs. Added test case for sparse_copy to wic test suite. (From OE-Core rev: 88701cef6ba399e82f96ed1b0eef9a44ed8c1687) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/filemap.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py
index 080668e7c2..1f1aacc522 100644
--- a/scripts/lib/wic/filemap.py
+++ b/scripts/lib/wic/filemap.py
@@ -530,9 +530,11 @@ def filemap(image, log=None):
530 except ErrorNotSupp: 530 except ErrorNotSupp:
531 return FilemapSeek(image, log) 531 return FilemapSeek(image, log)
532 532
533def sparse_copy(src_fname, dst_fname, offset=0, skip=0): 533def sparse_copy(src_fname, dst_fname, offset=0, skip=0, api=None):
534 """Efficiently copy sparse file to or into another file.""" 534 """Efficiently copy sparse file to or into another file."""
535 fmap = filemap(src_fname) 535 if not api:
536 api = filemap
537 fmap = api(src_fname)
536 try: 538 try:
537 dst_file = open(dst_fname, 'r+b') 539 dst_file = open(dst_fname, 'r+b')
538 except IOError: 540 except IOError: