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 emulator
emulator
emulator64-arm
emulator64-mips
emulator64-x86
emulator-arm
emulator-mips
emulator_renderer
emulator-ui
emulator-x86
$ ls out/target/product/generic/ | grep img
ramdisk.img
system.img
userdata.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. master origin/linux-goldfish-3.0-wip
android-goldfish-3.4 origin/android-goldfish-2.6. 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.
Checking out files: % (/), done.
Branch android-goldfish-2.6. set up to track remote branch android-goldfish-2.6. from origin.
切换到一个新分支 'android-goldfish-2.6.29'

  then

$ ls
arch CREDITS drivers include Kbuild MAINTAINERS net samples sound
block crypto firmware init kernel Makefile README scripts usr
COPYING 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 ?= arm
CROSS_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

  

  

  

  

Compile android source and kernel for emulator in Debian的更多相关文章

  1. How to download and compile Android kernel goldfish ?

    Prerequisites Assuming that we already downloaded the android-ndk-r12b and sdk. w4118@w4118:~/utils$ ...

  2. How to compile and install Linux Kernel 5.1.2 from source code

    How to compile and install Linux Kernel 5.1.2 from source code Compiling a custom kernel has its adv ...

  3. 【转】在Ubuntu下编译Android源码并运行Emulator

    原文网址:http://www.mcuos.com/thread-4553-1-1.html 建立编译环境 1.在VirtualBox上安装Ubuntu 2.安装JDK   $ sudo apt-ge ...

  4. 【转】Ubuntu10.04上编译Android源码(Build Android source in Ubuntu10.04 Platform)

    原文网址:http://blog.csdn.net/chenyafei617/article/details/6570928 一.Introduction 今天我们就来谈谈如何在Ubuntu平台上面编 ...

  5. how to compile and replace ubuntu kernel

    how to compile and replace ubuntu kernel 0. environment -ubuntu 1804 64bit 1. prepare source code su ...

  6. 同步、更新、下载Android Source & SDK from 国内镜像站(转载)

    同步.更新.下载Android Source & SDK from 国内镜像站 转自: 同步.更新.下载Android Source & SDK from 国内镜像站 Download ...

  7. 同步、更新、下载Android Source & SDK from 国内镜像站

    转自: 同步.更新.下载Android Source & SDK from 国内镜像站 Download the android source from china mirrors     以 ...

  8. 配置android source 在ubuntu中编译环境

    在Ubuntu中可以配置 android source 编译环境,推荐使用最新的64位的Ubuntu  LTS(Long Time Support); 1.安装JDK. AOSP主分支代码需要java ...

  9. Error:Android Source Generator: [sdk] Android SDK is not specified.

    有时候使用intellij idea 带入android 项目,运行提示Error:Android Source Generator: [sdk] Android SDK is not specifi ...

随机推荐

  1. 利用JS判断浏览器版本

    function checkBrowser() { var browserName = navigator.userAgent.toLowerCase(); //var ua = navigator. ...

  2. 在SharePoint列表中使用动态筛选条件[今日][Today]

    如果在SharePoint使用了日历控件或者其他列表中有时间字段,用户经常希望能够动态使用条件字段进行筛选,例如希望筛选出开始日期是今天的事件.未来三日的事件. SharePoint的列表筛选条件支持 ...

  3. 【node错误】/usr/bin/env: node: No such file or directory

    背景 安装了node后,执行npm run xxx的命令的时候,报错,提示如下: /usr/bin/env: node: No such file or directory 步骤 1. 什么玩意,执行 ...

  4. easyui datagrid fit 属性

    fit:true - 自适应大小,填充容器 fitColumns:true - 自动使列适应表格宽度以防止出现水平滚动.

  5. SQLServer 语句相关

     --查询两行张表不同的数据 --相同数据 select tel_no from a intersect select tel_no from b --不同数据 select tel_no from ...

  6. Hello World 之 CGAL

    CGAL有神秘的面纱,让我不断想看清其真面目.开始吧! 1 Three Points and One Segment 第一个例子是创建3个点和一条线段,并且在其上进行一些操作. 所有的CGAL头文件都 ...

  7. Elasticsearch学习(4) spring boot整合Elasticsearch的聚合操作

    之前已将spring boot原生方式介绍了,接下将结介绍的是Elasticsearch聚合操作.聚合操作一般来说是解决一下复杂的业务,比如mysql中的求和和分组,由于博主踩的坑比较多,所以博客可能 ...

  8. 【Oracle 12c】最新CUUG OCP-071考试题库(59题)

    59.(16-8)choose two: Which two statements are true regarding the USING and ON clauses in table joins ...

  9. let、const和var的区别

    1.let是块级作用域,函数内部使用let定义后,对函数外部无影响. <!DOCTYPE html> <html lang="en"> <head&g ...

  10. mongodb 日志清理

    #!/bin/bash #Rotate the MongoDB logs to prevent a single logfile from consuming too much disk space. ...