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 ...
随机推荐
- MFC中的DLL、LIb文件的创建、使用
动态链接库Dynamic-Linked Lib 的创建与使用 动态链接库(Dynamic Link Library 或者 Dynamic-link Library,缩写为 DLL),是微软公司在微软 ...
- FDMemTable三层提交数据总是不成功的原因
提交数据的代码如下: procedure TForm1.btnSaveClick(Sender: TObject);var LDeltas: TFDJSONDeltas;begin if FDMemT ...
- tomcat7-maven-plugin 端口
不知道有没有人像我这样,在pom配置了下面这段之后, <plugins> <plugin> <groupId>org.apache.tomcat.maven< ...
- GlusterFS 三
性能监控 Displaying the I/0 Information $gluster volume profile gv0 startStarting volume profile on gv0 ...
- HTML解析器软件
HTML解析器软件 HTML文档解析器 HTMLParser HTML Parser 是一个对HTML进行分析的快速实时的解析器,最新的发行版本是1.6,另外2.0的开发版本已经两年没有进展了.示例代 ...
- .net core 使用 redis
.net core 使用 redis 个人感觉.net core 对于微软技术而言有很重要的意义 ,所以最近已有时间就想看一看关于.net core 的文章. 今天我就来写一写如何在.net core ...
- 一起学习《C#高级编程》1--类型的安全性
感觉写随笔第一天就遇到了困难,感觉好费时间啊,回宿舍就得8点多,然后只能看一点书.之后写随笔,首先得回忆,然后组织,最后打字.还有就是宿舍迎来的断网的日子,特别不方便,只能第二天去公司发.本人目前是. ...
- 【Oracle 12c】最新CUUG OCP-071考试题库(56题)
56.(14-14) choose the best answer: You need to create a table with the following column specificatio ...
- 【Oracle 12c】最新CUUG OCP-071考试题库(55题)
55.(13-3) choose the best answer: Which statement is true regarding the SESSION_PRIVS dictionary vie ...
- 关于CocoaPods添加第三方库造成项目崩溃
在很多时候,我们接手了别人的代码,项目中已经使用cocoapods,但是再想通过pods添加第三方库时会造成崩溃,如果你没备份项目的话那你就悲催了,幸好当初用了git了,不然又够忙乎的了. 好,回到正 ...