diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 357: Add option --nocheck-mmc to linaro-media-create

Message ID 20110617183737.27855.53952.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

James Tunnicliffe June 17, 2011, 6:37 p.m. UTC
Merge authors:
  James Tunnicliffe (dooferlad)
Related merge proposals:
  https://code.launchpad.net/~dooferlad/linaro-image-tools/add_yes_to_write_to_mmc_option/+merge/64955
  proposed by: James Tunnicliffe (dooferlad)
------------------------------------------------------------
revno: 357 [merge]
committer: James Tunnicliffe <james.tunnicliffe@linaro.org>
branch nick: linaro-image-tools
timestamp: Fri 2011-06-17 18:56:04 +0100
message:
  Add option --nocheck-mmc to linaro-media-create
modified:
  linaro-media-create
  linaro_image_tools/media_create/__init__.py
  linaro_image_tools/media_create/check_device.py


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro-media-create'
--- linaro-media-create	2011-05-19 14:30:21 +0000
+++ linaro-media-create	2011-06-17 12:47:16 +0000
@@ -123,7 +123,8 @@ 
             print "The board '%s' does not support the --mmc option. Please use " \
                 "--image_file to create an image file for this board." % args.board
             sys.exit(1)
-        if not confirm_device_selection_and_ensure_it_is_ready(args.device):
+        if not confirm_device_selection_and_ensure_it_is_ready(args.device,
+                                                  args.nocheck_mmc):
             sys.exit(1)
     elif not args.should_format_rootfs or not args.should_format_bootfs:
         print ("Do not use --no-boot or --no-part in conjunction with "

=== modified file 'linaro_image_tools/media_create/__init__.py'
--- linaro_image_tools/media_create/__init__.py	2011-05-26 09:16:35 +0000
+++ linaro_image_tools/media_create/__init__.py	2011-06-17 12:47:16 +0000
@@ -119,6 +119,11 @@ 
         '--align-boot-part', dest='should_align_boot_part',
         action='store_true',
         help='Align boot partition too (might break older x-loaders).')
+    parser.add_argument(
+        '--nocheck-mmc', dest='nocheck_mmc',
+        action='store_true',
+        help='Assume yes to the question "Are you 100%% sure, on selecting [mmc]"')
+    
     return parser
 
 def get_android_args_parser():

=== modified file 'linaro_image_tools/media_create/check_device.py'
--- linaro_image_tools/media_create/check_device.py	2011-04-28 11:08:45 +0000
+++ linaro_image_tools/media_create/check_device.py	2011-06-17 17:54:19 +0000
@@ -110,7 +110,9 @@ 
         partitions.ensure_partition_is_not_mounted(part)
 
 
-def confirm_device_selection_and_ensure_it_is_ready(device):
+def confirm_device_selection_and_ensure_it_is_ready(
+                                                device,
+                                                yes_to_mmc_selection = False):
     """Confirm this is the device to use and ensure it's ready.
 
     If the device exists, the user is asked to confirm that this is the
@@ -123,7 +125,7 @@ 
     if _does_device_exist(device):
         print '\nI see...'
         _print_devices()
-        if _select_device(device):
+        if yes_to_mmc_selection or _select_device(device):
             _ensure_device_partitions_not_mounted(device)
             return True
     else: