Compile android source and kernel for emulator in Debian
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的更多相关文章
- How to download and compile Android kernel goldfish ?
Prerequisites Assuming that we already downloaded the android-ndk-r12b and sdk. w4118@w4118:~/utils$ ...
- 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 ...
- 【转】在Ubuntu下编译Android源码并运行Emulator
原文网址:http://www.mcuos.com/thread-4553-1-1.html 建立编译环境 1.在VirtualBox上安装Ubuntu 2.安装JDK $ sudo apt-ge ...
- 【转】Ubuntu10.04上编译Android源码(Build Android source in Ubuntu10.04 Platform)
原文网址:http://blog.csdn.net/chenyafei617/article/details/6570928 一.Introduction 今天我们就来谈谈如何在Ubuntu平台上面编 ...
- how to compile and replace ubuntu kernel
how to compile and replace ubuntu kernel 0. environment -ubuntu 1804 64bit 1. prepare source code su ...
- 同步、更新、下载Android Source & SDK from 国内镜像站(转载)
同步.更新.下载Android Source & SDK from 国内镜像站 转自: 同步.更新.下载Android Source & SDK from 国内镜像站 Download ...
- 同步、更新、下载Android Source & SDK from 国内镜像站
转自: 同步.更新.下载Android Source & SDK from 国内镜像站 Download the android source from china mirrors 以 ...
- 配置android source 在ubuntu中编译环境
在Ubuntu中可以配置 android source 编译环境,推荐使用最新的64位的Ubuntu LTS(Long Time Support); 1.安装JDK. AOSP主分支代码需要java ...
- Error:Android Source Generator: [sdk] Android SDK is not specified.
有时候使用intellij idea 带入android 项目,运行提示Error:Android Source Generator: [sdk] Android SDK is not specifi ...
随机推荐
- 用 pyqt4 编写的一个翻译小工具
有时候我们在开发时遇到一些陌生的英文单词或者不容易看出某些长句的中文意思时该怎么办呢?打开桌面上的翻译软件?打开浏览器里收藏着的翻译网址或者直接贴上百度的搜索框去查?这些方法固然可以,还很常见,但如果 ...
- datasnap远程方法支持自定义对象传参
有同仁需要远程方法传输自定义的数据类型,他以为要自己写代码会很复杂,其实DATASNAP早就为我们想到了. datasnap的数据序列和还原真是无与伦比的强大,其远程方法支持自定义对象传参,DATAS ...
- CentOS6.5中使用 iperf 检测主机间网络带宽
安装方式 # yum install http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm# yum inst ...
- ASP.NET MVC验证DateTime的问题
今天碰到一个Bug,在IE8中,日期验证失效,输入正确的日期格式也会验证失败,提示:xxx必须是日期格式(the field xxx must be a date) 最终找到问题所在:jquery.v ...
- [Erlang26]怎么通过beam文件得到所有的record或源代码?
怎么通过beam文件得到所有的record或源代码? 1. 首先必须要在compile里面加上debug_info信息: 1 > c(load,[debug_info]). {ok,load ...
- mongodb 连接失败
需要加一个配置文件,mongo.config bind_ip = 127.0.0.1 dbpath = D:\MongoDB\data\db logpath = D:\MongoDB\data\mon ...
- Luogu4551 最长异或路径
题目链接:戳我 emmmmmmmmmm异或一个数两次等于没有操作对吧...所以我们按照前缀的异或和,建一个01trie.....然后之后.....直接在树上贪心地找能和它每一位不一样的数....然后. ...
- Cookie背景了解
Cookie的复数形态是Cookies, 英文的意思是小甜饼,小饼干. 类型为小型文本文件, 指某些网站为了辨别用户身份储存在用户本地中断上的数据. 是前网景公司的员工 卢-蒙特利在1993年3月发明 ...
- [Objective-C语言教程]结构体(17)
Objective-C数组可定义包含多个相同类型的数据项的变量类型,但结构体是Objective-C编程中的另一个用户定义数据类型,它可组合不同类型的数据项. 结构体用于表示记录,假设要图书馆中跟踪书 ...
- Leetcode 98 验证二叉搜索树 Python实现
给定一个二叉树,判断其是否是一个有效的二叉搜索树. 假设一个二叉搜索树具有如下特征: 节点的左子树只包含小于当前节点的数. 节点的右子树只包含大于当前节点的数. 所有左子树和右子树自身必须也是二叉搜索 ...