Squashed 'import-layers/yocto-poky/' changes from dc8508f6099..67491b0c104

Yocto 2.2.2 (Morty)

Change-Id: Id9a452e28940d9f166957de243d9cb1d8818704e
git-subtree-dir: import-layers/yocto-poky
git-subtree-split: 67491b0c104101bb9f366d697edd23c895be4302
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/import-layers/yocto-poky/scripts/lib/wic/filemap.py b/import-layers/yocto-poky/scripts/lib/wic/filemap.py
index f3240ba..162603e 100644
--- a/import-layers/yocto-poky/scripts/lib/wic/filemap.py
+++ b/import-layers/yocto-poky/scripts/lib/wic/filemap.py
@@ -543,9 +543,9 @@
         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