Download Android source code and kernel from Ubuntu

Source: Internet
Author: User
First, you have to install Ubuntu on your computer, and then perform the following work. you only need to copy and paste it. 1. install the Git tool. Android source code is managed using Git tools. compared with SVN, this is a distributed source code management tool, while SVN is a centralized source...
 
First, you have to install Ubuntu on your computer, and then perform the following work. you only need to copy and paste it.
 
1. install the Git tool. Android source code is managed using Git tools. compared with SVN, SVN is a distributed source code management tool, while SVN is a centralized source code management tool. To install the Git tool, run the following command on Ubuntu:
 
USER-NAME @ MACHINE-NAME :~ $ Sudo apt-get install git-core gnupg
 
2. install the Java SDK. Run the following command on Ubuntu:
 
USER-NAME @ MACHINE-NAME :~ $ Sudo add-apt-repository ppa: ferramrobert to/java
 
USER-NAME @ MACHINE-NAME :~ $ Sudo apt-get update
 
USER-NAME @ MACHINE-NAME :~ $ Sudo apt-get install sun-java6-jre sun-java6-plugin
 
USER-NAME @ MACHINE-NAME :~ $ Sudo apt-get install sun-java6-jdk
 
By the way, in the above third step sudo apt-get install sun-java6-jre sun-java6-plugin, a dialog box will pop up, then press the Tab key to switch the focus, then press Enter on the line.
 
3. other dependent packages. Run the following command on Ubuntu:
 
USER-NAME @ MACHINE-NAME :~ $ Sudo apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl
 
A lot of software is installed here. copy and paste the command directly.
 
4. debugging tools. Run the following command on Ubuntu:
 
USER-NAME @ MACHINE-NAME :~ $ Sudo apt-get install valgrind
 
II. Source Code Download
 
Many websites provide source code downloading, but some images are unavailable. the official reference website is provided here. if the local content cannot be used, refer to the official website:
 
Http://source.android.com/source/downloading.html
 
Obtain the Android source code
 
1. create a new directory under the current directory to store our Android directory,
 
Mkdir Android
 
Cd Android
 
Mkdir bin
 
Cd bin
 
Curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo> repo
 
2. create a directory for storing Android source code and initialize the version.
 
Sudo chmod a + x repo
 
Cd ..
 
Mkdir source
 
Cd source
 
../Bin/repo init-u https://android.googlesource.com/platform/manifest
 
To download the branch of android4.0, run the following command:
 
../Bin/repo init-u https://android.googlesource.com/platform/manifest-B android-4.0.1_r1
 
The-B parameter is used for the conversion branch. At the same time, note that the bin and source are both located in the Android directory and are in a parallel structure.
 
3. enter the user name and address. you can enter the user name or address randomly.
 
4. synchronize code
 
../Bin/repo sync
 
Note: The synchronization code is very slow at this time and may take several days. The connection request may fail during synchronization. you can execute this command here. this project file supports resumable data transfer.
 
3. download the Android kernel
 
The Anroid kernel is not downloaded together when the command ../bin/repo sync is used. If you do not need to modify or transplant the Android kernel, you can extract the image from the Android simulator.
 
Create a new kernel directory in the Android directory and run the following command:
 
$ Git clone https://android.googlesource.com/kernel/common.git
 
$ Git clone https://android.googlesource.com/kernel/goldfish.git
 
$ Git clone https://android.googlesource.com/kernel/msm.git
 
$ Git clone https://android.googlesource.com/kernel/omap.git
 
$ Git clone https://android.googlesource.com/kernel/samsung.git
 
$ Git clone https://android.googlesource.com/kernel/tegra.git
 
Note that the kernel does not support resumable data transfer, and the download speed is much faster than that of source code.
 
Compilation is being attempted. after compilation is successful, relevant methods will be published.

From the column zqiang_55
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.