add command-line arguments to mkbootimg to move kernel, ramdisk, etc.
Bug: 6918260 Change-Id: I5d4af6314fded027952941110a520dc9aa234a14
This commit is contained in:
parent
a11f4bcfd4
commit
ed95159056
|
@ -109,18 +109,17 @@ int main(int argc, char **argv)
|
|||
int fd;
|
||||
SHA_CTX ctx;
|
||||
uint8_t* sha;
|
||||
unsigned base = 0x10000000;
|
||||
unsigned kernel_offset = 0x00008000;
|
||||
unsigned ramdisk_offset = 0x01000000;
|
||||
unsigned second_offset = 0x00f00000;
|
||||
unsigned tags_offset = 0x00000100;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
memset(&hdr, 0, sizeof(hdr));
|
||||
|
||||
/* default load addresses */
|
||||
hdr.kernel_addr = 0x10008000;
|
||||
hdr.ramdisk_addr = 0x11000000;
|
||||
hdr.second_addr = 0x10F00000;
|
||||
hdr.tags_addr = 0x10000100;
|
||||
|
||||
while(argc > 0){
|
||||
char *arg = argv[0];
|
||||
char *val = argv[1];
|
||||
|
@ -140,11 +139,15 @@ int main(int argc, char **argv)
|
|||
} else if(!strcmp(arg, "--cmdline")) {
|
||||
cmdline = val;
|
||||
} else if(!strcmp(arg, "--base")) {
|
||||
unsigned base = strtoul(val, 0, 16);
|
||||
hdr.kernel_addr = base + 0x00008000;
|
||||
hdr.ramdisk_addr = base + 0x01000000;
|
||||
hdr.second_addr = base + 0x00F00000;
|
||||
hdr.tags_addr = base + 0x00000100;
|
||||
base = strtoul(val, 0, 16);
|
||||
} else if(!strcmp(arg, "--kernel_offset")) {
|
||||
kernel_offset = strtoul(val, 0, 16);
|
||||
} else if(!strcmp(arg, "--ramdisk_offset")) {
|
||||
ramdisk_offset = strtoul(val, 0, 16);
|
||||
} else if(!strcmp(arg, "--second_offset")) {
|
||||
second_offset = strtoul(val, 0, 16);
|
||||
} else if(!strcmp(arg, "--tags_offset")) {
|
||||
tags_offset = strtoul(val, 0, 16);
|
||||
} else if(!strcmp(arg, "--board")) {
|
||||
board = val;
|
||||
} else if(!strcmp(arg,"--pagesize")) {
|
||||
|
@ -159,6 +162,10 @@ int main(int argc, char **argv)
|
|||
}
|
||||
hdr.page_size = pagesize;
|
||||
|
||||
hdr.kernel_addr = base + kernel_offset;
|
||||
hdr.ramdisk_addr = base + ramdisk_offset;
|
||||
hdr.second_addr = base + second_offset;
|
||||
hdr.tags_addr = base + tags_offset;
|
||||
|
||||
if(bootimg == 0) {
|
||||
fprintf(stderr,"error: no output filename specified\n");
|
||||
|
|
Loading…
Reference in New Issue