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 ...
随机推荐
- git fatal:HttpRequestException encountered
网上查了一下发现是Github 禁用了TLS v1.0 and v1.1,必须更新Windows的git凭证管理器,才行. https://github.com/Microsoft/Git-Crede ...
- 如何注册GitHub
一.个人介绍 姓名:张志龙 学号:1413042026 班级:网工141 爱好:宅物 能力:c++编程 二.注册 注册GitHub其实很简单 首先我们要做的是打开官网 www.github.com(如 ...
- Elasticsearch中的索引管理和搜索常用命令总结
添加一个index,指定分片是3,副本是1 curl -XPUT "http://10.10.110.125:9200/test_ods" -d' { "settings ...
- Async 和 Await 的异步编程 资料汇总
使用 Async 和 Await 的异步编程 https://msdn.microsoft.com/zh-cn/library/hh191443(v=vs.120).aspx 异步程序中的控制流 ht ...
- ASP.NET Core学习总结(2)
public class ControllerActionInvoker : ResourceInvoker, IActionInvoker 我们知道,ControllerActionInvoker实 ...
- WPF 触摸屏多点触控图像的缩放旋转和移动
<dxc:DXWindow xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:d ...
- @JoinColumn 详解
1. 一对一 现假设有Person表和Address表,是一对一的关系,在Person中有一个指向Address表主键的字段addressID,所以主控方一定是Person,所谓主控方就是能改变关联关 ...
- BASE64编码乱码问题的浅层分析与解释
本文由作者朱臻授权网易云社区发布. 1问题案例 曾在开发过程中,我们遇到了BASE64编码乱码的问题,该问题的场景如下: 当web前端,将带有中文字符的字符串base64编码后,传到后端.当后端将数据 ...
- 【题解】 UVa11210 Chinese Mahjong
pdf传送门 直接模拟+搜索,考虑一下选哪一个是将,然后搜出顺子和刻子,最后判断一下可不可行就好了! #include<stdio.h> #include<string.h> ...
- Sublime写作
下载 Sublime Text 快捷键(MAC环境) sublime text 批量删除空白行 Sublime text3!行首,行尾,批量编辑!