Monday, April 9, 2012

HowTo - Building Android kernel modules (bcm4329.ko)


This document tells us how to build individual modules instead of compiling the whole kernel. 

bcm4329.ko is the wireless driver module for Google Nexus One. It is located in the kernel files. 

Under kernel directory:

1. Include the arm-eabi- tool directory into the path.

$ export PATH=$PATH:~/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/

2. Generate the configuration file.

2.1 Use herring_defconfig as the default configuration file.

$ make ARCH=arm herring_defconfig

2.2 Modify the configuration file.

vi .config

Make changes as follows:

CONFIG_CROSS_COMPILE = "arm-eabi-"
CONFIG_LOCAL_VERSION = "-cyanogenmod"
#CONFIG_LOCALVERSION_AUTO
set all CONFIG_BCM* to m

3. Change another file (and I don't know why)

$ vi scripts/setlocalversion
Locate the following line

if $short; then
echo "+"

and change echo "+" to echo ""

5. Set building architecture to be arm.

$ export ARCH=arm

6. Make.

$ make modules

7. Push the new module into the phone.

7.1 Remount to be writable.
  
$ adb remount

7.2 Push.

adb push drivers/net/wireless/bcm4329/bcm4320.ko /system/modules



Ref: http://stevechui.blogspot.com/2011/10/compiling-kernel-modules-tunko-for.html

1 comment: