HTC Kaiser 编译Android Kernel zImage

以下是如何编译Android kernel zImage的步骤, 我翻译一下而已.
我是用VMWare的ubuntu 8.04来编译的, 基本上没遇到什么问题.


在Linux的环境下:

建立目录:

mkdir ~/android-kernel
cd android-kernel

下载源代码, 大概有280MB, 慢慢等哈~~~ (当然你要先安装git)
git clone git://git.linuxtogo.org/home/groups/mobile-linux/kernel.git

类似的屏幕信息:
Initialized empty Git repository in /home/user/android-kernel/kernel/.git/
remote: Counting objects: 908251, done.
remote: Compressing objects: 100% (153970/153970), done.
remote: Total 908251 (delta 755115), reused 906063 (delta 753016)
Receiving objects: 100% (908251/908251), 281.86 MiB | 292 KiB/s, done.
Resolving deltas: 100% (755115/755115), done.
Checking out files: 100% (22584/22584), done.

然后去到htc-msm branch:
cd kernel
git checkout -b htc-msm origin/htc-msm

屏幕信息:
Branch htc-msm set up to track remote branch refs/remotes/origin/htc-msm.
Switched to a new branch "htc-msm"

下载ARM的toolchain, 大概64MB左右, 下到~/android-kernel:

下载: http://www.codesourcery.com/gnu_toolchains/arm/portal/package2549/public/arm-none-linux-gnueabi/arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2


cd ~/android-kernel
tar xjf arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

编译kernel

准备缺省的Kaiser 配置文件.config:
cd ~/android-kernel/kernel
make htckaiser_defconfig ARCH=arm

然后编译zImage:

export PATH=~/android-kernel/arm-2008q1/bin:$PATH
make zImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

编译好的在: ~/android-kernel/kernel/arch/arm/boot/zImage

如果你的机器是多核的, 可以编译的时候用-j <cores/cpus_number>来加速:

比如, 双核的可以:

make -j 2 zImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

你可能感兴趣的:(android)