bmap-flasher: kill the --no-sync option
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 7 Nov 2012 08:52:34 +0000 (10:52 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Thu, 8 Nov 2012 08:10:40 +0000 (10:10 +0200)
The kernel sychronizes block devices on close automatically (in case of
the last reference becomes 0), so --no-sync does not work anyway.

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

index 9acaacb..97e349b 100755 (executable)
@@ -55,12 +55,6 @@ def parse_arguments():
     text = "do not verify the data checksum while writing"
     parser.add_argument("--no-verify", action="store_true", help = text)
 
-    # The --no-sync option
-    text = "do not synchronize the block device after flashing (use "  \
-           "carefully and make sure you synchronize the block device " \
-           "manually before you unplug it)"
-    parser.add_argument("--no-sync", action="store_true", help = text)
-
     # The --quiet option
     text = "be quiet"
     parser.add_argument("-q", "--quiet", action="store_true", help = text)
@@ -131,13 +125,12 @@ def main():
         raise SystemExit(1)
 
     # Synchronize the block device
-    if not args.no_sync:
-        log.info("synchronizing block device '%s'" % args.bdev)
-        try:
-            flasher.sync()
-        except BmapFlasher.Error as err:
-            log.error(str(err))
-            raise SystemExit(1)
+    log.info("synchronizing block device '%s'" % args.bdev)
+    try:
+        flasher.sync()
+    except BmapFlasher.Error as err:
+        log.error(str(err))
+        raise SystemExit(1)
 
     flashing_time = time.time() - start_time
     flashing_speed = flasher.bmap_image_size / flashing_time