1. 下载好kernel源码
git clone https://android.googlesource.com/kernel/samsung.git
后,我们开始kernel的编译。
2. 首先用 git branch -a查看一下有多少个branch
* master remotes/origin/HEAD -> origin/master remotes/origin/android-samsung-2.6.35-gingerbread remotes/origin/android-samsung-3.0-ics-mr1 remotes/origin/master
3. 检出 3.0-ics的branch, 在本地命名branch为my_nexus
liaowm@liaowm-Systme:~/nexus/kernel/samsung$ git checkout -b my_nexus origin/android-samsung-3.0_ics_mr1 liaowm@liaowm-Systme:~/nexus/kernel/samsung$ git branch -a master * my_nexus remotes/origin/HEAD -> origin/master remotes/origin/android-samsung-2.6.35-gingerbread remotes/origin/android-samsung-3.0-ics-mr1 remotes/origin/master
4. kernel build
4.1. 在/arch/arm/configs下找到很多机型的config, 应该用哪个呢?网上查了下,应该用herring_defconfig,结合官网(http://source.android.com/source/building-kernels.html)指引,输入以下命令编译kernel:
$ export ARM=arm $ export CROSS_COMPILE=arm-eabi- $ make herring_defconfig $ make -j16
4.2 编译完成后,把bImage复制到android的目录下
$ cp arch/arm/bot/zImage ../android/device/samsung/crespo/kernel