获取android源代码
To clone one of these trees, install git , and run:
git clone git://android.git.kernel.org/
+ project path.
To clone the entire platform, install repo , and run:
mkdir mydroid
cd mydroid
repo init -u git://android.git.kernel.org/platform/manifest.git
repo sync
For more information about git , see an overview
打算全部下载回来再说,先下载repo脚本
更多git和repo使用说明看这里:
http://source.android.com/download/using-repo
curl http://android.git.kernel.org/repo >repo
chmod +x repo
[email protected]:~/android/source$ ./repo init -u git://android.git.kernel.org/platform/manifest.git
gpg: keyring `/home/wen/.repoconfig/gnupg/secring.gpg' created
gpg: keyring `/home/wen/.repoconfig/gnupg/pubring.gpg' created
gpg: /home/wen/.repoconfig/gnupg/trustdb.gpg: trustdb created
gpg: key 920F5C65: public key "Repo Maintainer <[email protected] >" imported
gpg: Total number processed: 1
gpg: imported: 1
Getting repo ...
from git://android.git.kernel.org/tools/repo.git
[email protected]:~/android/source$ ./repo sync
和远程服务器同步,过程比较长,全部代码下来好几Gb
打算编译一个vmware虚拟机上能运行的
目前google已经出e pc支持的版本了
切换到cupcake 分支,master分支不是太稳定
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b
cupcake
$ repo sync
同步后,很多的更改会uncommit
建立一个local_manifest.xml
$ vi ./.repo/local_manifest.xml
<manifest>
<project name="platform/vendor/asus/eee_701" path="vendor/asus/
eee_701"/>
</manifest>
$ repo sync
... A new repo command ( 1.8) is available.
... You should upgrade soon:
cp /home/invain/bin_x86/mydroid/.repo/repo/repo /home/invain/bin/
repo
Initializing project platform/vendor/asus/eee_701 ...
remote: Counting objects: 33, done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 33 (delta 2), reused 33 (delta 2)
Unpacking objects: 100% (33/33), done.
From git://android.git.kernel.org/platform/vendor/asus/eee_701
* [new branch] cupcake -> korg/cupcake
* [new branch] master -> korg/master
Ubuntu Linux (32-bit x86)
To set up your Linux development environment, make sure you have the following:- Required Packages:
- Git 1.5.4 or newerand the GNU Privacy Guard.
- Git 1.5.4 or newerand the GNU Privacy Guard.
-
- JDK 5.0, update 12 or higher. Java 6 is not supported, because of incompatibilities with @Override.
- JDK 5.0, update 12 or higher. Java 6 is not supported, because of incompatibilities with @Override.
-
- flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev (optional), build-essential, zip, curl.
$ sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl li b ncurses5-dev zlib1g-dev
- You might also want Valgrind, a tool that will help you find memory leaks, stack corruption, array bounds overflows, etc.
$ sudo apt-get install valgrind
- Intrepid ( 8.10) users may need a newer version of libreadline:
Device drivers / Network device support / Ethernet (10 or 100Mbit) / EISA, VLB, PCI and on board controllers / AMD PCnet32 PCI support
Device drivers / Graphics support / Support for frame buffer devices / VESA VGA graphics support
Device drivers / Graphics support / Console display driver support / Framebuffer Console support
Device drivers / Graphics support / Console display driver support / Select Compiled-in fonts (VGA 8x8 font, VGA 8x16 font)
,再把這些取消:
Device drivers / Real Time Clock / Android alarm driver
Device drivers / Misc devices / Android pmem allocator
,然後重新建置 kernel:make bzImage。
編譯好之後,把 arch/x86/boot/bzImage 複製為 mydroid/vendor/asus/eee_701/kernel。 接下来就可以编译了:
TARGET_ARCH=x86 TARGET_PRODUCT=eee_701 DISABLE_DEXPREOPT=
true
make
-j2 installer_img CC=gcc CXX=g++
出现错误
No rule to make target `vendor/google/frameworks/maps/com.google.android.maps.xml'
把eee_701.mk中的 'generic_with_google.mk'改为 'generic.mk'
编译遇到新错误
其他用户编译会提示没有找到e2fschk
这里不能简单的把文件从sbin目录复制到bin目录
否则会和root用户编译一样
出现下面的错误
Copy: out/target/product/eee_701/installer/root/system/bin/netcfg
Copying installer base files...
Copy: out/target/product/eee_701/obj/lib/libdiskconfig.so -> out/
target/product/eee_701/installer/root/system/lib/libdiskconfig.so
Copy: ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy: ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy: ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy: ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy: ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy: ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy: ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
Try `cp --help' for more information.
Copy: ->
dirname: missing operand
Try `dirname --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.
cp: missing file operand
android目录下的external/e2fsprogs 就是这些工具,没有编译而已
打下面的patch
http://code.google.com/p/patch-hosting-for-android-x86-support/downloads/list
project external/e2fsprogs/
diff --git a/Android.mk b/Android.mk
index e71cf08..3d39a41 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,3 +1,3 @@
-ifneq ($(TARGET_SIMULATOR),true)
-# include $(call all-subdir-makefiles)
+ifeq ($(TARGET_ARCH),x86)
+include $(call all-subdir-makefiles)
endif
这样e2fsprogs下面的工具就编译好了,可以在out/target/
更多相关文章
- 如何调用android内置图片,比如menu->add的加号图片,search的放大镜
- Android真机调试 Android.Util.AndroidRuntimeException: You ca
- 修正android cocos2dx项目当点击属性时提示错误的问题
- javax.net.ssl.SSLException: hostname in certificate didn't m
- Couldn't find meta-data for provider with authority
- Android(安卓)项目打包时出现“TaskExecutionException :':app:me
- android studio 4.0. gradle 4.0. tinker集成报错
- 在mac 上配置AndroidStudio碰到的坑
- Android的常见错误及解决办法