How to learn to develop a custom Android kernel
If you havn’t used linux before, learn some basics first.
If you are already a linux user, here you go :
Grab your Sources from your device manufacturer or search it on xda, someone already have done some work for you.
Extract the source.
Use
- unzip kernel_source_filename.zip
Now go to arch/arm/configs directory if your phone is a arm one, or go to arch/arm64/configs/, you will find a lot of files there, find the one with name like your_device_codename_defconfig
Copy that name.
Download gcc toolchain from google sources
Not all versions will work with every kernel source, so keep that in mind.
Extract the toolchain in any folder
Go to the root directory of your kernel sources,
Type :
- export CROSS_COMPILE=/your/toolchain/location/here/bin/arm-eabi-
- export ARCH=arm
- or
- export ARCH=arm64
- make your_device_codename_here_defconfig
- make zImage
Go & get a cup of coffee.
Your kernel will be ready in few minutes in arch/arm/boot directory.
If you didn’t understand all of the above, watch this video :)