Skip to content

Reproduction of Joying boot images #2

@lbdroid

Description

@lbdroid

Joying uses non-standard boot and recovery images.
The 6.0 boot.img appears to be a lot "closer" to standard than previously, but still off.

Utilities;
unmkbootimg: https://forum.xda-developers.com/showthread.php?t=1877807
mkbootimg: https://android.googlesource.com/platform/system/core/+/android-7.1.2_r11/mkbootimg/mkbootimg

The 6.0 boot.img is pretty easy to deal with.
unmkbootimg boot.img spits out this;

unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 8388608
Kernel address 0x2600000
Ramdisk size 5400125
Ramdisk address 0x400000
Secondary size 0
Secondary address 0x2400010
Kernel tags address 0x100
Flash page size 4096
Board name is ""
Command line "idle=halt notsc androidboot.hardware=sofiaboard apic=sofia nolapic_pm firmware_class.path=/system/vendor/firmware androidboot.selinux=disabled nolapic_timer x86_intel_xgold_timer=soctimer_only vmalloc=512m slub_max_order=0 uvcvideo.en_autosuspend=0 console=ttyFIQ0,115200n8 earlyprintk=xgold"

*** WARNING ****
This image is built using NON-standard mkbootimg!
OFF_KERNEL_ADDR is 0x02600000
OFF_RAMDISK_ADDR is 0x00400000
OFF_SECOND_ADDR is 0x02400010
Please modify mkbootimg.c using the above values to build your image.
****************

Extracting kernel to file zImage ...
Extracting root filesystem to file initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
  mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x0 --cmdline 'idle=halt notsc androidboot.hardware=sofiaboard apic=sofia nolapic_pm firmware_class.path=/system/vendor/firmware androidboot.selinux=disabled nolapic_timer x86_intel_xgold_timer=soctimer_only vmalloc=512m slub_max_order=0 uvcvideo.en_autosuspend=0 console=ttyFIQ0,115200n8 earlyprintk=xgold' --pagesize 4096 -o new_boot.img
---------------

Nice thing is that it doesn't actually know what its talking about when it is telling you to modify bootimg.c. This is not needed in the newer mkbootimg, which is actually a python script.

The command to recompile is close to what is needed, you just need to add in the offsets.

--kernel_offset 0x02600000 --ramdisk_offset 0x00400000 --second_offset 0x02400010

The result is a new_boot.img that is byte for byte identical to the original.

$ md5sum *.img
3cb4ecb1cf9b3a2924e725fe1d91ccd3  boot.img
3cb4ecb1cf9b3a2924e725fe1d91ccd3  new_boot.img

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions