Remove All Ads from XDA

How to flash a kernel on android device with two boot partitions.

17 posts
Thanks Meter: 2
By Vats12, Junior Member on 22nd May 2019, 01:18 PM
Post Reply Email Thread

I have an android device and its kernel source code. I am able to compile the kernel source code and get "Image.gz-dtb" image file.
Now I need to flash it on my android device.

As per my knowledge the step required to flashing a kernel image on android device is as following:
Android Image Kitchen
  1. Pull your device's boot image from the latest image available for your device (whether it be a ROM or stock)
  2. Download the latest Android Image Kitchen from this thread.
  3. Run the following with the boot image:
    Code: <image_name>.img
  4. Locate the zImage file and replace it with your kernel image (rename it to what came out of the boot image)
  5. Run the following to repack:
  6. Flash the new boot image with fastboot or TWRP!

These steps are copied from:

I am facing a problem in following these steps because the device I am using has two boot partitions i.e.
boot_a -> /dev/block/sde11
boot_b -> /dev/block/sde39

So I am not able to proceed with the first step to pull the boot image.
I can pull both image with dd command i.e. `dd if=/dev/block/sde11 of=/sdcard/boot_a.img` and `dd if=/dev/block/sde39 of=/sdcard/boot_b.img` but I don't know what should I do after that because I have only single image file generated from the source code.

I searched over the internet for A/B partitioning and I found that these are used for seamless updates i.e. One partition is active at a time and another partition which is inactive can be used to flash the update. On reboot, another partition will become active and One partition will become inactive. More Info:

If my understanding is true then I just need to follow following steps to find the correct image to be used at the first step of flashing the kernel:
1. fastboot getvar all | grep “current-slot”
2. dd if=<path to boot of active slot> of=/sdcard/boot.img
3. Continue with boot.img and flash the kernel with above written steps for flashing a kernel.

Anyone who has this knowledge, please confirm. I will be very thankful to you.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes