This post describes the process of building an individual kernel module for Android without compiling the whole kernel.
In order to do this, you need to make sure you already have your Android kernel source compiled, and the version of your module should be the same with the version of your kernel.
Here are some good links for compiling a whole Android kernel: Kernel source (CyanogenMod version) Building kernel from source Integrate kernel into image
After you compile a whole kernel and installed it into your device, if you just want to modify some driver and recompile the specific module, you don’t need to recompile the kernel again. Here is how to compile and install a single module for Android kernel.
In this example, we are interested in buiding the wireless driver module
for Google Nexus One – bcm4329.ko. Suppose you are now under the
kernel source directory. Here we go:
1. Include the arm-eabi- tool directory into the path.
1
| |
2. Generate the configuration file.
(1) Use herring_defconfig as the default configuration file.
1
| |
(2) Modify the configuration file .config with the following changes.
1 2 3 | |
And set all CONFIG_BCM* to m .
(3) Change another file (and I don’t know why)
1
| |
Locate the following line:
1 2 | |
and change echo "+" to echo "".
3. Set building architecture to be arm.
1
| |
4. Make
1
| |
5. Push the new module into the phone.
(1) Remount to be writable.
1
| |
(2) Push into the device.
1
| |