The Android build system doesn't compile kernel on-fly. It just contains a prebuilt kernel binary which will be added to the target image. This approach may be good enough for the arm emulator target, but not suitable for x86 platforms. The x86 platforms have various hardware. The kernel binary and its modules may need to be adjusted at compile time or runtime.
This article describes an extra feature of the build system of android-x86 project. That is, the ability to build kernel and modules by a predefined or customized config during the building process.
We have modified the Android build system to compile a kernel image on-fly.
You need to use our repository to get this feature.
Read the article Get Source Code for details.
We put a default config for android-x86 in kernel/arch/x86/configs/. To build a kernel image from this config, run
make iso_img TARGET_PRODUCT=android_x86
make kernel TARGET_PRODUCT=android_x86
Since donut-x86 we have supported multiple targets, e.g., eeepc, tegav2, ... Each target may has its customized kernel config located in its device definition directory. When you choose a target (by specifying TARGET_PRODUCT or lunch command, see Get Source Code for details.), the customized kernel config of this target will be used to build the kernel image.
Suppose you already have a workable kernel config for you hardware, it's easy to tell the build system to use your config to build the iso. Just put your config file to kernel/arch/x86/configs/, and run (suppose the name of your config is my_defconfig)
make iso_img TARGET_PRODUCT=android_x86 TARGET_KERNEL_CONFIG=my_defconfig
It is never advisable to edit the kernel config file directly, as it may generate faulty configuration (dependencies not met etc.). The correct way to customize the kernel config is (on the top of android-x86 tree)
make -C kernel O=$OUT/obj/kernel ARCH=x86 menuconfig
make -C kernel distclean
rm -rf $OUT/obj/kernel
If you have a workable prebuilt kernel binary for your hardware, you can generate the iso with it:
make iso_img TARGET_PRODUCT=android_x86 TARGET_PREBUILT_KERNEL=<path to the prebuilt kernel>
The kernel build system can also be used to compile kernel for ARM. For example, to compile kernel 2.6.29 for the goldfish CPU of the arm emulator, run
git checkout x86/android-goldfish-2.6.29
make kernel TARGET_KERNEL_CONFIG=goldfish_defconfig TARGET_NO_KERNEL=