diff options
author | George Kraft <george.kraft@calxeda.com> | 2013-04-30 13:47:06 -0500 |
---|---|---|
committer | George Kraft <george.kraft@calxeda.com> | 2013-04-30 13:47:06 -0500 |
commit | 7daf4f92ee27983c2ca9ce78e2afdcff3b94318f (patch) | |
tree | 93f381129c9cbfa53dd012228170aa4c7e6bb54d | |
parent | 97d62a26d2f83c74d48bb36ef4c9562036f3fdd1 (diff) | |
download | cxmanage-7daf4f92ee27983c2ca9ce78e2afdcff3b94318f.tar.gz |
CXMAN-189: Change "fullupdate" command to "fwupdate --full"
Looks like it doesn't need to be a distinct command after all.
-rwxr-xr-x | scripts/cxmanage | 88 |
1 files changed, 39 insertions, 49 deletions
diff --git a/scripts/cxmanage b/scripts/cxmanage index ad9c948..69135e2 100755 --- a/scripts/cxmanage +++ b/scripts/cxmanage @@ -60,10 +60,8 @@ PARSER_EPILOG = """examples: cxmanage -a fwupdate package ECX-1000_update.tar.gz 192.168.1.1""" FWUPDATE_EPILOG = """examples: - cxmanage -a fwupdate package ECX-1000_update.tar.gz 192.168.1.1""" - -FULLUPDATE_EPILOG = """examples: - cxmanage -a fullupdate package ECX-1000_update.tar.gz 192.168.1.1""" + cxmanage -a fwupdate package ECX-1000_update.tar.gz 192.168.1.1 + cxmanage -a fwupdate --full package ECX-1000_update.tar.gz 192.168.1.1""" FWUPDATE_IMAGE_TYPES = ['PACKAGE'] + sorted([ 'DEL', @@ -176,53 +174,45 @@ def build_parser(): mcreset.set_defaults(func=mcreset_command) #fwupdate command - fwupdate = subparsers.add_parser('fwupdate', help='update firmware (quick)', + fwupdate = subparsers.add_parser('fwupdate', help='update firmware', formatter_class=argparse.RawDescriptionHelpFormatter, epilog=FWUPDATE_EPILOG) - fwupdate.set_defaults(func=fwupdate_command, full=False) - - #fullupdate command - fullupdate = subparsers.add_parser('fullupdate', - help='update primary AND backup partitions (will reset MC)', - formatter_class=argparse.RawDescriptionHelpFormatter, - epilog=FULLUPDATE_EPILOG) - fullupdate.set_defaults(func=fwupdate_command, full=True) - - #shared fwupdate/fullupdate args - for command in [fwupdate, fullupdate]: - command.add_argument('image_type', metavar='IMAGE_TYPE', - help='image type to use (%s)' % ", ".join(FWUPDATE_IMAGE_TYPES), - type=lambda string: string.upper(), - choices = FWUPDATE_IMAGE_TYPES) - command.add_argument('filename', help='path to file to upload') - command.add_argument('--partition', - help='Specify partition to update', default='INACTIVE', - type=lambda string: string.upper(), - choices = list([ - 'FIRST', - 'SECOND', - 'BOTH', - 'OLDEST', - 'NEWEST', - 'INACTIVE' - ])) - simg_args = command.add_mutually_exclusive_group() - simg_args.add_argument('--force-simg', - help='Force addition of SIMG header', - default=False, action='store_true') - simg_args.add_argument('--skip-simg', - help='Skip addition of SIMG header', - default=False, action='store_true') - command.add_argument('--priority', - help='Priority for SIMG header', default=None, type=int) - command.add_argument('-d', '--daddr', - help='Destination address for SIMG', - default=None, type=lambda x : int(x, 16)) - command.add_argument('--skip-crc32', - help='Skip crc32 calculation for SIMG', - default=False, action='store_true') - command.add_argument('--version', dest='fw_version', - help='Version for SIMG header', default=None) + fwupdate.add_argument('image_type', metavar='IMAGE_TYPE', + help='image type to use (%s)' % ", ".join(FWUPDATE_IMAGE_TYPES), + type=lambda string: string.upper(), + choices = FWUPDATE_IMAGE_TYPES) + fwupdate.add_argument('filename', help='path to file to upload') + fwupdate.add_argument('--full', action='store_true', default=False, + help='Update primary AND backup partitions (will reset MC)') + fwupdate.add_argument('--partition', + help='Specify partition to update', default='INACTIVE', + type=lambda string: string.upper(), + choices = list([ + 'FIRST', + 'SECOND', + 'BOTH', + 'OLDEST', + 'NEWEST', + 'INACTIVE' + ])) + simg_args = fwupdate.add_mutually_exclusive_group() + simg_args.add_argument('--force-simg', + help='Force addition of SIMG header', + default=False, action='store_true') + simg_args.add_argument('--skip-simg', + help='Skip addition of SIMG header', + default=False, action='store_true') + fwupdate.add_argument('--priority', + help='Priority for SIMG header', default=None, type=int) + fwupdate.add_argument('-d', '--daddr', + help='Destination address for SIMG', + default=None, type=lambda x : int(x, 16)) + fwupdate.add_argument('--skip-crc32', + help='Skip crc32 calculation for SIMG', + default=False, action='store_true') + fwupdate.add_argument('--version', dest='fw_version', + help='Version for SIMG header', default=None) + fwupdate.set_defaults(func=fwupdate_command) #fwinfo command fwinfo = subparsers.add_parser('fwinfo', help='get FW info') |