Foray into Android Kernel hacking

A post after ages.. and we begin a new journey into the world of (Linux’s cousin) Android kernel hacking.

Presently, have taken baby steps in this field involving:

  • building the kernel from source using default defconfig of my device. Thanks to cheatman for the kernel source for my test device.
  • Thanks to excellent explanation provided at this xda link, kernel build was almost a cakewalk!
  • Kernel build produces a zImage, which is a compressed image of the kernel. Next step involves packaging the kernel into a form that a custom recovery installed in your Android devices can read it (FYI, I am currently using CWM Recovery).
  • Kernel packaging involves the following steps:
    1. Extract ramdisk (or, initramfs on older devices) from an existing boot.img. This can be obtained from freely downloadable flashable kernel zips corresponding to one’s device.
    2. Use this ramdisk along with the built zImage to create a new boot.img
    3. Create a zip out of this boot.img and META-INF folder that was obtained from flashable kernel zip in 1).
  • The linux tools for performing the above can be obtained from this link.
  • Once the zip is ready, copy it to your sdcard, boot to recovery and select option : install from zip and select your flashable kernel file.

Finally, a screenshot from my device 🙂

Screenshot of new kernel install from device's settings view

Screenshot of new kernel install

A major problem am facing presently is that WiFi on this device is not working since the new kernel install. Will try to figure out the issue and post an update soon.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s