1、download the android source code

  Reference from

http://source.android.com/source/downloading.html

  follow the reference:

  Create the dir and export the PATH

$ mkdir ~/bin$ PATH=~/bin:$PATH

  Download the repo

$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo$ chmod 775 ~/bin/repo

  Repo init the code version you want

$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1

  finally sync the codes

$ repo sync// better way$ repo sync -j16

  if try to stop the repo, just try

Ctrl + z   

  and continue the repo

$ repo sync // or $ repo sync -j16

  after download, must enter "repo sync" to check the code again.

  2、download the kernel

  Reference from

https://android.googlesource.com/

  click the kernel/common, there would be a instruction on the top:

git clone https://android.googlesource.com/kernel/common

  the version for emulator

git clone https://android.googlesource.com/kernel/goldfish

  3、Compile the source code

  1) check the build environment

http://source.android.com/source/initializing.html

  2) compile

$ cd ~/Android/source_code/$ make// or $ make -j4

  3) there would be the files in the following dir

$ ls out/host/linux-x86/bin/ | grep emulatoremulatoremulator64-armemulator64-mipsemulator64-x86emulator-armemulator-mipsemulator_rendereremulator-uiemulator-x86$ ls out/target/product/generic/ | grep imgramdisk.imgsystem.imguserdata.img

  4、 Compile the kernel

$ cd goldfish/$ ls

  but there is no files now.

  checkout for the real codes.

$ git checkout android-goldfish-2.6.29          master                           origin/linux-goldfish-3.0-wip android-goldfish-3.4             origin/android-goldfish-2.6.29   origin/master HEAD                             origin/android-goldfish-3.4      linux-goldfish-3.0-wip           origin/HEAD           

  choose the version you want

$ git checkout android-goldfish-2.6.29 Checking out files: 100% (26821/26821), done.Branch android-goldfish-2.6.29 set up to track remote branch android-goldfish-2.6.29 from origin.切换到一个新分支 'android-goldfish-2.6.29'

  then

$ lsarch     CREDITS        drivers   include  Kbuild  MAINTAINERS  net             samples   soundblock    crypto         firmware  init     kernel  Makefile     README          scripts   usrCOPYING  Documentation  fs        ipc      lib     mm           REPORTING-BUGS  security  virt

  compile the kernel

  1) crrect the Mafile

$ vim Makefile//correct the following messenge#ARCH           ?= $(SUBARCH)ARCH            ?= armCROSS_COMPILE   ?= arm-none-linux-gnueabi-

  2) make menuconfig

$ make menuconfig>> Save an Alternate Configuration File       

  3) make

  TIPS : there would be error without libnucurses

$ sudo apt-get install libncurses5 libncurses5-dev// in AMD64$ sudo apt-get install libncurses5 libncurses5-dev$ sudo apt-get install ia32-libs $ sudo apt-get install lib32ncurses5 lib32ncurses5-dev

  

  

  

  

更多相关文章

  1. 使用U3D 实现 Android(安卓)Launcher(提供源码)
  2. Android(安卓)RIL CDMA分支总结(1)
  3. 获取android源代码
  4. Android(安卓)6编译环境搭建 (Marshmallow)
  5. Android(安卓)CDMA分支
  6. android源码/内核下载
  7. Android(安卓)项目多版本管理
  8. Android(安卓)lunch分析以及产品分支构建
  9. Android(安卓)4.0 分页指示器 Android(安卓)ViewPagerIndicator

随机推荐

  1. android开发环境搭建备忘
  2. Android自动测试之monkeyrunner工具(一)
  3. Android快速开发工具集合——YUtils
  4. Android BroadcastReceiver介绍
  5. Android中禁用屏幕旋转
  6. A20红外遥控器与Android功能的适配
  7. Android(安卓)4.0 多平台界面支持原理分
  8. Android canvas clip 参数解释
  9. Android系统启动执行jar程序
  10. S3C6410(M8用的) 移植Android 内核