libbootimg icon indicating copy to clipboard operation
libbootimg copied to clipboard

libbootimg: Fix support of Stock Sony ELF boot images

Open AdrianDC opened this issue 9 years ago • 6 comments

  • 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]

AdrianDC avatar Jun 05 '16 22:06 AdrianDC

Tested on both Primary and Secondary Stock 4.3 based installations. Stock kernel now injected properly, simple update giving the same binary result.

AdrianDC avatar Jun 05 '16 22:06 AdrianDC

Confirmed working fine for Huashan ELF stock bootimages.

AdrianDC avatar Jun 10 '16 15:06 AdrianDC

Up

AdrianDC avatar Aug 15 '16 23:08 AdrianDC

Updated with support for the newer Sony ELF boot images.

  • Tested on the original ELF 8960 devices : SP / T / TX / V
  • Tested on the newer ELF 8974 devices : Z2
  • Tested on regular bootimage devices : X Performance
  • Other device under test
  • Also compatible with No-Kexec V4.1 changes to the boot name

AdrianDC avatar Nov 26 '16 14:11 AdrianDC

Up. Used globally on Sony and non-Sony devices since 2016.

AdrianDC avatar Oct 05 '17 20:10 AdrianDC

You should fix the build.

include/libbootimg.h

The #include <cutils/klog.h> obviously needs #ifdef DEBUG_KMSG protection!

cryptomilk avatar Nov 01 '17 15:11 cryptomilk