am b6e1632f: am 8773d62c: Merge "mkbootimg: parse hexadecimal ints"

* commit 'b6e1632ff4179b79d7bd39fec81f6d7a3cb3f82d':
  mkbootimg: parse hexadecimal ints
This commit is contained in:
Rom Lemarchand 2015-06-03 02:19:14 +00:00 committed by Android Git Automerger
commit 74a38f1adb
1 changed files with 10 additions and 6 deletions

View File

@ -93,6 +93,10 @@ def write_padded_file(f_out, f_in, padding):
pad_file(f_out, padding)
def parse_int(x):
return int(x,0)
def parse_cmdline():
parser = ArgumentParser()
parser.add_argument('--kernel', help='path to the kernel', type=FileType('rb'),
@ -101,15 +105,15 @@ def parse_cmdline():
parser.add_argument('--second', help='path to the 2nd bootloader', type=FileType('rb'))
parser.add_argument('--cmdline', help='extra arguments to be passed on the '
'kernel command line', default='', action=ValidateStrLenAction, maxlen=1536)
parser.add_argument('--base', help='base address', type=int, default=0x10000000)
parser.add_argument('----kernel_offset', help='kernel offset', type=int, default=0x00008000)
parser.add_argument('--ramdisk_offset', help='ramdisk offset', type=int, default=0x01000000)
parser.add_argument('--second_offset', help='2nd bootloader offset', type=int,
parser.add_argument('--base', help='base address', type=parse_int, default=0x10000000)
parser.add_argument('----kernel_offset', help='kernel offset', type=parse_int, default=0x00008000)
parser.add_argument('--ramdisk_offset', help='ramdisk offset', type=parse_int, default=0x01000000)
parser.add_argument('--second_offset', help='2nd bootloader offset', type=parse_int,
default=0x00f00000)
parser.add_argument('--tags_offset', help='tags offset', type=int, default=0x00000100)
parser.add_argument('--tags_offset', help='tags offset', type=parse_int, default=0x00000100)
parser.add_argument('--board', help='board name', default='', action=ValidateStrLenAction,
maxlen=16)
parser.add_argument('--pagesize', help='page size', type=int,
parser.add_argument('--pagesize', help='page size', type=parse_int,
choices=[2**i for i in range(11,15)], default=2048)
parser.add_argument('--id', help='print the image ID on standard output',
action='store_true')