system/corennnnn
修訂 | 028d05f8b216720a877601d41055ff9503fd4ac0 (tree) |
---|---|
時間 | 2016-09-04 08:47:11 |
作者 | M1cha <sigmaepsilon92@gmai...> |
Commiter | Steve Kondik |
mkbootimg: add support for --dt
Change-Id: I19f149fac693420cf1f630b51293bbd3650a1b59
@@ -57,7 +57,7 @@ def write_header(args): | ||
57 | 57 | args.base + args.second_offset, # physical load addr |
58 | 58 | args.base + args.tags_offset, # physical addr for kernel tags |
59 | 59 | args.pagesize, # flash page size we assume |
60 | - 0, # future expansion: MUST be 0 | |
60 | + filesize(args.dt), # size in bytes | |
61 | 61 | (args.os_version << 11) | args.os_patch_level)) # os version and patch level |
62 | 62 | args.output.write(pack('16s', args.board.encode())) # asciiz product name |
63 | 63 | args.output.write(pack('512s', args.cmdline[:512].encode())) |
@@ -66,6 +66,7 @@ def write_header(args): | ||
66 | 66 | update_sha(sha, args.kernel) |
67 | 67 | update_sha(sha, args.ramdisk) |
68 | 68 | update_sha(sha, args.second) |
69 | + update_sha(sha, args.dt) | |
69 | 70 | img_id = pack('32s', sha.digest()) |
70 | 71 | |
71 | 72 | args.output.write(img_id) |
@@ -150,6 +151,7 @@ def parse_cmdline(): | ||
150 | 151 | choices=[2**i for i in range(11,15)], default=2048) |
151 | 152 | parser.add_argument('--id', help='print the image ID on standard output', |
152 | 153 | action='store_true') |
154 | + parser.add_argument('--dt', help='path to the device tree image', type=FileType('rb')) | |
153 | 155 | parser.add_argument('-o', '--output', help='output file name', type=FileType('wb'), |
154 | 156 | required=True) |
155 | 157 | return parser.parse_args() |
@@ -159,6 +161,7 @@ def write_data(args): | ||
159 | 161 | write_padded_file(args.output, args.kernel, args.pagesize) |
160 | 162 | write_padded_file(args.output, args.ramdisk, args.pagesize) |
161 | 163 | write_padded_file(args.output, args.second, args.pagesize) |
164 | + write_padded_file(args.output, args.dt, args.pagesize) | |
162 | 165 | |
163 | 166 | |
164 | 167 | def main(): |