diff options
Diffstat (limited to 'fastboot/bootimg.c')
-rw-r--r-- | fastboot/bootimg.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fastboot/bootimg.c b/fastboot/bootimg.c index 9e0e45c7b..240784fb0 100644 --- a/fastboot/bootimg.c +++ b/fastboot/bootimg.c @@ -37,10 +37,10 @@ void bootimg_set_cmdline(boot_img_hdr *h, const char *cmdline) strcpy((char*) h->cmdline, cmdline); } -boot_img_hdr *mkbootimg(void *kernel, unsigned kernel_size, - void *ramdisk, unsigned ramdisk_size, - void *second, unsigned second_size, - unsigned page_size, unsigned base, +boot_img_hdr *mkbootimg(void *kernel, unsigned kernel_size, unsigned kernel_offset, + void *ramdisk, unsigned ramdisk_size, unsigned ramdisk_offset, + void *second, unsigned second_size, unsigned second_offset, + unsigned page_size, unsigned base, unsigned tags_offset, unsigned *bootimg_size) { unsigned kernel_actual; @@ -68,12 +68,15 @@ boot_img_hdr *mkbootimg(void *kernel, unsigned kernel_size, hdr->kernel_size = kernel_size; hdr->ramdisk_size = ramdisk_size; hdr->second_size = second_size; - hdr->kernel_addr = base + 0x00008000; - hdr->ramdisk_addr = base + 0x01000000; - hdr->second_addr = base + 0x00F00000; - hdr->tags_addr = base + 0x00000100; + + hdr->kernel_addr = base + kernel_offset; + hdr->ramdisk_addr = base + ramdisk_offset; + hdr->second_addr = base + second_offset; + hdr->tags_addr = base + tags_offset; + hdr->page_size = page_size; + memcpy(hdr->magic + page_size, kernel, kernel_size); memcpy(hdr->magic + page_size + kernel_actual, |