Skip to content

Commit

Permalink
libbootimg: Fix support of Stock Sony ELF boot images
Browse files Browse the repository at this point in the history
 * Unlike all boot images built for CyanogenMod or AOSP based
    ROMs over the last years, the elf bootimages from Stock
    also include additional metadata in the header section
    that is required for the device to power up with its kernel

 * Add a 3900 8bits array at the end of the header,
    followed by the 16 chars of the added bootimage name,
    in order to match the Sony ELF 4096 first block
    and therefore save the additional data from Stock images

 * Regular Sony ELF images have about 1200-1600 chars there
    so filling the 4096 block is more than enough for this,
    and moving the bootimage name at the end makes things safer

Change-Id: Ic2b619b6f5e862920dcfefa5b86b016987305d4a
Signed-off-by: AdrianDC <[email protected]>
  • Loading branch information
AdrianDC committed Jun 4, 2016
1 parent cc1f4ba commit 11e79c5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/boot_img_hdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ struct boot_img_hdr_elf
uint32_t cmd_msize; /* cmdline size duplicate */
uint32_t cmd_flags; /* cmdline flags (0xAC to 0xAF) */
uint32_t cmd_align; /* cmdline alignment */
uint8_t header_vals[3900]; /* header additional values */
uint8_t name[BOOT_NAME_SIZE]; /* added - asciiz product name */
};

Expand Down

0 comments on commit 11e79c5

Please sign in to comment.