% (args.bdev, args.bmap))
try:
- flasher.write(False, not args.no_verify)
- except BmapFlasher.Error as err:
- log.error(str(err))
- raise SystemExit(1)
-
- # Synchronize the block device
- log.info("synchronizing block device '%s'" % args.bdev)
- try:
- flasher.sync()
- except BmapFlasher.Error as err:
- log.error(str(err))
+ try:
+ flasher.write(False, not args.no_verify)
+ except BmapFlasher.Error as err:
+ log.error(str(err))
+ raise SystemExit(1)
+
+ # Synchronize the block device
+ log.info("synchronizing block device '%s'" % args.bdev)
+ try:
+ flasher.sync()
+ except BmapFlasher.Error as err:
+ log.error(str(err))
+ raise SystemExit(1)
+ except KeyboardInterrupt:
+ log.error("the program is interrupted")
+ log.warning("do not panic if the program may not finish immediately, " \
+ "just wait")
+ log.warning("reason: this is the Linux kernel behavior - it " \
+ "synchronizes the block device")
raise SystemExit(1)
flashing_time = time.time() - start_time