bmap-creator: print a warning if no holes found
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Thu, 1 Nov 2012 14:16:33 +0000 (16:16 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Thu, 1 Nov 2012 14:18:38 +0000 (16:18 +0200)
Probably this means that the image file was not handled correctly and holes
were expanded.

Change-Id: I602b52ee6471e0a15938e2100b29329a1b066b3f
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmap-creator

index 4ea6028..2a6f6c5 100755 (executable)
@@ -129,7 +129,11 @@ def main():
         log.error(str(err))
         raise SystemExit(1)
 
-    # TODO: complain if no holes
+    if creator.bmap_mapped_cnt == creator.bmap_blocks_cnt:
+        log.warning("all %s are mapped, no holes in '%s'" \
+                    % (creator.bmap_image_size_human, args.image))
+        log.warning("was the image handled incorrectly and holes " \
+                    "were expanded?")
 
 if __name__ == "__main__":
     sys.exit(main())