Flashing custom kernel into Android phone (Pixel)

0

I'm trying to modify the kernel of a Pixel 4a 5g phone. For that, I've downloaded the stock boot.img from https://developers.google.com/android/images. I've also got a kernel src code (https://android.googlesource.com/kernel/common/+/refs/heads/android-4.19-stable) and compiled it. It results into an Image and Image.gz files.

In my understanding, I have to unpack the boot.img file, replace the kernel it contains with my Image.gz and pack it. Using unmkbootimg, I get zImage and initramfs.cpio.gz but I think they are corrupted. Below is what I get:

unmkbootimg version 1.2 - Mikael Q Kuisma <kuisma@ping.se>
Kernel size 11562794
Kernel address 0xd7719f
Ramdisk size 369099082
Ramdisk address 0x62c
Secondary size 0
Secondary address 0x0
Kernel tags address 0x0
Flash page size 0
Board name is ""
Command line ""

*** WARNING ****
This image is built using NON-standard mkbootimg!
OFF_KERNEL_ADDR is 0x00D7729F
OFF_RAMDISK_ADDR is 0x0000072C
OFF_SECOND_ADDR is 0x00000100
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 ...
%Premature end-of-file saving initramfs.cpio.gz.

Can somebody tell me a good and easy way of doing this?

android
linux-kernel
google-pixel
asked on Stack Overflow Dec 21, 2020 by jorge

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0