android source code download notes
来源:互联网 发布:交友app源码多少钱 编辑:程序博客网 时间:2024/05/19 13:23
download is successfully finished in light of following steps.
1、install repo
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo $ chmod +x ~/bin/repo
2、repo init
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.3_r1
3、repo downloa
$ repo sync
additionally.
debian linux 6.0.6
assume install root directory = /home/myname/android
1. install tools
apt-get install git-core curl
2. intall Repo
mkdir bin in current directory
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ./bin/repo
chmod a+x ./bin/repo
add repo PATH to /etc/profile
3. Repo init
repo init -u https://android.googlesource.com/platform/manifest
or
repo init -u git://android.git.kernel.org/platform/manifest.git
or
repo init -u http://android.git.kernel.org/platform/manifest.git
if "repo initialized in /android" arise, that showes local version repo had been initiliazed successfully。
4. download android
repo sync
转载
Git是Linux Torvalds(Linux之父)为了帮助管理Linux内核开发而开发的一个开放源码的分布式版本控制软件,它不同于Subversion、CVS这样的集中式版本控制系统。在集中式版本控制系统中只有一个仓库(Repository),许多个工作目录(Working Copy),而在Git这样的分布式版本控制系统中(其他主要的分布式版本控制系统还有BitKeeper、Mercurial、GNU Arch、Bazaar、Darcs、SVK、Monotone等),每一个工作目录都包含一个完整仓库,它们支持离线工作,本地提交可以稍后提交到服务器上。
因为Android是由Kernel、Dalvik、Bionic、Prebuilt、build等多个项目组成,如果我们分别使用Git来逐个获取显得很麻烦,所以Android项目编写了一个名为Repo的Python的脚本来统一管理这些项目的仓库,使得项目的获取更加简单。
在Ubuntu 8.04上安装Git只需要设定正确的更新源,然后使用apt-get就可以了,apt-get是一条Linux命令,主要用于自动从互联网的软件仓库中搜索、安装、升级、卸载软件或操作系统。
apt-get命令一般需要root权限执行,所以一般跟着sudo命令。
sudo apt-get install git-core curl
这条命令会从互联网的软件仓库中安装git-core和curl。
其中curl是一个利用URL语法在命令行方式下工作的文件传输工具,它支持很多协议,包括FTP、FTPS、HTTP、HTTPS、TELENT等,我们需要安装它从网络上获取Repo脚本文件。
curl http://android.git.kernel.org/repo >~/bin/repo
这句命令会下载repo脚本文件到当前主目录的/bin目录下,并保存在文件repo中。
最后我们需要给repo文件可执行权限
chmod a+x ~/bin/repo
接下来我们就可以利用repo脚本和Git、curl软件获取Android的源代码了:)
首先建一个目录,比如~/android。
然后使用下面命令获取源码:
repo init –u git://android.git.kernel.org/platform/manifest.git
这个过程会持续很长的时间下载完毕后会看到repo initialized in /android这样的提示,说明本地的版本库已经初始化完毕。
在运行这个工具的时候,它首先会去检查当前目录下的.repo目录,然后从脚本内置的(或命令行指定的)一个地址 git://android.kernel.org/tools/repo.git 去使用git clone一份最新的repo工具的完整的版本库放置到 .repo/repo 目录下,之后checkout出最新的代码。这些代码就是repo的其它部分的代码。这其中的 main.py 就是repo构建工具的主干入口代码。
而在之前的构造过程中的调用命令 $ repo init -u git://android.git.kernel.org/platform/manifest.git 中,repo首先完成了前面所说的对自身的更新和初始化,然后通过调用后面补充进来的代码完成init的操作。在这个操作中, repo从 git://android.git.kernel.org/platform/manifest.git 这个地址下载了一份整个源码仓库的清单的版本库,并checkout出一份最新的清单,即 .repo/manifests/default.xml 文件。该文件是一个xml文件,在这个文件中描述了获取代码的远程版本库地址、其中所涉及到的每个项目的地址等等。下面是其中一部分:
<manifest branch="master">
<remote name="korg"
fetch="git://android.git.kernel.org/"
review="review.source.android.com" />
<project path="bionic" name="platform/bionic" />
<project path="external/clearsilver" name="platform/external/clearsilver">
<import>
<remap strip="clearsilver-%version%/" />
<mirror url="http://android.git.kernel.org/pub/clearsilver-%version%.tar.gz" />
<snapshot version="0.10.5" check="ec5fff5d7367ddd29a619cf81ae264687fde94c8" />
</import>
</project>
... ...
</manifest>
这里只是截取了其中一小部分的片段用来说明问题。
remote节点的fetch属性描述了远程的版本库的基本地址,之后是一系列的project节点。每一个project节点都有一个path和name属性,path是该项目在本地的存储地址,如bionic则是存储在本地的 ./repo/projects/bionic 下面,而name属性是远程版本库中的路径,与remote的fetch的地址结合起来即可得到该项目的版本库地址,如bionic的版本库是在 git://android.git.kernel.org/platform/bionic
而有的project定义中有import节点,该import节点中定义的一般都是该项目所依赖的第三方的独立项目,这些项目是没有历史版本信息的,因此只是一个tar.gz的包。repo在同步的过程中会将其下载下来,解压、加入到该项目的版本库中,并打上一个tag标记。
通过这个清单文件,repo可以实现整个源码库的随时更新和同步,这也是基于git的版本控制的特性所带来的独特的优势。
如果我们想拿某个分支版本的代码,而不是主线代码,需要使用-b参数指定branch的名字,比如:
repo init –u git://android.git.kernel.org/platform/manifest.git –b cupcake
如果我们只是想获取某一个project的代码,比如kernel/common,就不需要repo脚本了,直接使用Git工具即可,如果仔细研究repo脚本会发现,repo脚本其实就是组织Git工具去获取各个Project并把它们组织到同一个项目Android内。
git clone git://android.git.kernel.org/kernel/common.git
我们上面使用repo脚本获取了各个项目,那么接下来就需要把整个Android代码树同步到本地,如下:
repo sync
这样就获得了我们所需要的Android源码
================================================================
一、 下载Android源码
1、主机环境 Fedora10,完全安装版(已包含 git 工具包)
如果没有git按照下面安装
下载git-1.6.1.3.tar.bz2
tar vxfj git-1.6.1.3.tar.bz2
cd git-1.6.1.3
./configure
make; make install
2、安装repo工具
curl http://android.git.kernel.org/repo >repo
chmod a+x repo
move repo /usr/local/bin
3、初始化版本库
mkdir android-platform-eclair
cd android-platform-eclair
repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair
使用"-b eclari",表示将下载 eclair 分支源码,具体的分支列表可在android的git网站查询
4、下载文件
repo sync
以后更新代码可直接执行此命令
5,按照工具链
下载arm-eabi-4.2.1.tgz ,arm-iwmmxt-linux-gnueabi-4.1.1-gpl-lgpl.tgz 和arm-eabi-4.4.0.tgz解压到
/usr/local/目录
arm-eabi-4.2.1
arm-eabi-4.4.0
arm-linux-4.1.1
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
二、编译Android
1、安装 jdk 包
fedora 默认安装的1.6的jdk,编译eclair需要1.5版本的jdk,首先从sun网站下载jdk-1_5_0_19-linux-i586.bin(http://java.sun.com/javase/downloads/5u22/jdk)
mkdir /usr/java
cp jdk-1_5_0_19-linux-i586.bin /usr/java/
cd /usr/java
chmod 777 jdk-1_5_0_19-linux-i586.bin
./jdk-1_5_0_19-linux-i586.bin
完成后会在当前目录创建jdk1.5.0_19目录
2、安装gperf工具包
从网上下载 gperf-3.0.3.tar.gz
tar vxzf gperf-3.0.3.tar.gz
cd gperf-3.0.3
./configure
make; make install
3、导出编译环境变量
用vi编辑配置文件: vi /etc/profile
在前面增加下面内容
JAVA_HOME=/usr/java/jdk1.5.0_19
CLASSPATH=$JAVA_HOME/jre/lib:.
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
保存退出按Esc然后输入:wq
使配置生效 source /etc/profile如果配置错误会有提示
3.1.测试是否成功
shell终端输入 java -version
如果出现下面提示说明成功:
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02)
Java HotSpot(TM) Client VM (build 1.5.0_19-b02, mixed mode, sharing)
否则继续修改,直到正确为止
4、编译
source build/setenv
choosecombo 1 1 4 3
make -j4
等待两个小时左右,可编译完成
5、启动模拟器
cd out/host/linux-x86/bin
./emulator -debug-kernel -debug-init
5 SVN的安装
下载subversion-1.5.1.tar.bz2 和 subversion-deps-1.5.1.tar.bz2
安装方法
tar xjf subversion-1.5.1.tar.bz2
tar xjf subversion-deps-1.5.1.tar.bz2
cd subversion-1.5.1
./configure
make
make install
svn --version
cd /usr/local/
ls
svn
svn help
exit
svn –version
用vi编辑配置文件: vi /etc/profile
在后面增加下面内容
alias vi=vim
export SVN_EDITOR=vi
alias cp='cp -a'
保存退出按Esc然后输入:wq
- android source code download notes
- Android download source code
- download android-4.0 source code
- download android 4 source code
- Download Android Source Code in Windows
- The steps for download android source code
- download android source code and build
- android source code download from tsinghua
- .net source code download
- [download] yaffs2 source code
- uboot source code download
- Download android source code occur "server certificate verification failed "
- [openflow] openflow source code download
- Download Linux Kernel source code
- Download the Android Source
- Android source download
- Download android 5.0 source
- Android Download status code
- siteMesh入门简介
- TreeView的递归分析
- UIViewAnimation动画与CATransition类动画
- Eclipse:Eclipse中集成SVN环境
- sqlserver 去除空格
- android source code download notes
- WaitForSingleObject与事件、信号量、互斥、临界区的用法
- Windows 7 远程桌面控制 openSuSE 11.0 上 GNOME桌面
- 装饰模式
- jquery——双击编辑异步更新(双击内容变input框可编辑,失去焦点后修改的数据异步提交)
- NorFlash和NandFlash区别
- 根据20,80原则生成随机数据
- andorid 取到 button 背景图ID 方法
- VS2010与.NET4系列 23.Visual Studio 2010 扩展管理器(和新的 VS2010 PowerCommands 扩展)