1.准备编译环境
sudo apt-get install build-essential ncurses-dev
2.Get kernel source
git clone git://android.git.kernel.org/kernel/common.git
git checkout origin/android-goldfish-2.6.29 -b goldfish
3.Get prebuilt source
git clone git://android.git.kernel.org/platform/prebuilt.git
4.Export Environment Variable
export PATH=$PATH:/home/falson/mydroid_prebuilt/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin
export ARCH=arm
5.设定交叉编译参数
打开kernel目录下的Makefile文件,把CROSS_COMPILE指向刚才下载的prebuilt中的arm-eabi编译器
CROSS_COMPILE ?= arm-eabi-
把
LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,/
$(call ld-option, -Wl$(comma)–build-id,))
这一行注释掉,并且添加一个空的LDFLAGS_BUILD_ID定义,如下:
LDFLAGS_BUILD_ID =
6.从1.5_r1捆绑的SDK中获得内核配置文件
启动模拟器,然后通过adb pull命令(该命令用于从设备上复制文件到本地)即可完成。
adb pull /proc/config.gz ~/
gunzip config.gz
mv config ~/sources/goldfish-kernel/.config
make
7.为了启动模拟器,首先需要编译出模拟器和SDK
下载全部的工程代码
sudo apt-get install git-core curl
curl http://android.git.kernel.org/repo >~/bin/repo
chmod a+x ~/bin/repo
cd ~/mydroid
repo sync
make
make sdk
生成的所有工具在~/mydroid/out/host/linux-x86/bin下
生成的系统image在~/mydroid/out/target/product/generic下
生成的sdk工具目录在~/mydroid/out/host/linux-x86/sdk/android-sdk_eng.falson_linux-x86/tools下
根据SDK生成AVD:android create avd -t 1 -n falsonAVD
通过android list target看看所有的target列表
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/knock/archive/2010/03/09/5359388.aspx