Hi 🙂 I expect that you have followed the “How to Build Android Kernel from source (Part 1)” in which I explained getting android kernel source and start building the source. Here I will be explaining how to overcome the errors and make a successful build.
I was building the kernel source of “omap” project which uses panda_defconfig.
Output of a Successful Build
Following is the output, which we expect at the end of a successful completion of building source of the kernel. In the process of compiling we get many errors and we will have to fix them to continue process.
Fixing Errors
In this section I have suggested some fixes for the errors. After each fix you will have to enter the command “make” to continue the compilation.
1. The first error which terminate the compilation is at ” drivers/rtc/alarm.c” file
Error: asm/mach/time.h: No such file or directory
Reason: The actual location asm/mach/time.h file is “android/kernel/arch/arm/include/asm/mach/time.h” But it search the file at location “android/kernel/include/”
Fix: Goto–> android–>kernel–>drivers—>rtc
Open the alarm.c file and change #include <../arch/arm/include/asm/mash/time.h>
2. The second error is at “sound/soc/soc-core.c” file
Error: ‘ISA_DMA_THRESHOLD’ undeclared (In the function soc_pcm_hw-params)
Fix: Based on the values in this article http://lists.infradead.org/pipermail/linux-arm-kernel/2011-May/051403.html
I defined the ‘ISA_DMA_THRESHOLD’ with value “0xffffffff”
Successful Completion
At the end of the successful building, it will generate the “bzImage“. It is the built “kernel” from the procedure.
Step 1: Create a new directory and copy the generated “bzImage” to new directory
Command: mkdir kernel-Tharaka
Command: cp arch/arm/boot/zImage kernel-Tharaka
Step 2: Finding modules
Command: find . -name ‘*ko’ -exec cp ‘{}’ kernel-Tharaka \;
This is the end result of compiling and building android kernel source. 🙂
Good Luck ! 🙂