Skip to content

Kernel building guide for Motorola Cliq

adumont edited this page Jun 22, 2011 · 10 revisions

Initialize your workspace:

mkdir ~/workspace
cd ~/workspace

If you are just building the kernel and not a full ROM, you will need to download the ARM compiler. Which version of the compiler you use depends on the version of Android you're planning on building. This is known to work on eclair (4.2.1) and gingerbread (4.4.3). Replace <android version> with eclair, froyo, gingerbread, etc.

git clone -b <android version>  git://android.git.kernel.org/platform/prebuilt.git prebuilt

If you are building a full ROM or already have the compiler you want to use, link it in (indicate the right path for your system):

ln -s ~/prebuilt prebuilt

Clone the Kernel sources ("cmkernel" branch is for CM4morrison kernel):

git clone -b cmkernel git://github.com/adumont/kernel_morrison.git kernel

Get BCM Wlan Open Source DHD driver sources:

mkdir -p system/wlan/bcm && cd system/wlan/bcm
git clone -b master git://github.com/adumont/wlan-bcm-osrc.git osrc

Build the kernel:

export PLATFORM_DIR=~/workspace
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PLATFORM_DIR/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin:$PATH
      
cd $PLATFORM_DIR/kernel

Prepare the config. Use the default (stock) config, or CM4Morrison 's one:

make msm7x01a_mot_defconfig

or

make cm4morrison_defconfig

Change the .config to meet your needs, or use:

make menuconfig

Compile the kernel:

make ANDROID_BUILD_TOP=$PLATFORM_DIR &&
make -C $PLATFORM_DIR/system/wlan/bcm/osrc/open-src/src/dhd/linux ANDROID_BUILD_TOP=$PLATFORM_DIR

You can add "-jN" to any 'make' command to run the build in parallel. Setting N to the number of cores in your system is a good idea. You can also add "V=1" to any kernel build to see the commands being used to build. This is especially useful if you are trying to debug a build.

Clone this wiki locally