Fourth: Download and compile the source code of the study notes

Source: Internet
Author: User
Tags using git

The fourth chapter: download and compile the source code

This chapter is about using Git to download two sets of source code to learn how to download and compile Android source code and Linux kernel source code.

Download, compile, and test Android source code

(1) Configure the Android source code download environment:

1. Create a directory to hold the download script file (repo) (you can put the script file in any directory, use ~/bin here).

2. Download repo script file (for download Android source code)

3. Create a directory to hold the Android source code (can be placed in other directories)

# mkdir Android-source

# CD Android-source

4. Initialization

5. Start downloading Android source code

(2) Android source code directory structure analysis

(3) Download part of the Android source code:

1. Using Repo Sync command

2. Using the git clone command

(4) Compiling Android source code

1. Initializing the compilation environment # source build/envsetup.sh

2. Select target

3. Compiling Android Source code

(5) Out directory structure analysis

(6) Publish your apk as an Android built-in program

(7) test system with simulator. IMG File

Second, the Android Source code directory analysis (see P43)

Third, download part of the Android source code

There are two ways of doing this:

1. Using Repo Sync command

2. Using the git clone command

Iv. download and compile the Linux kernel source code

(1) Download the Linux kernel source code

# git clone http://android. googlesource.com/kernel/common.git

(2) directory structure of Linux kernel source code

(3) Install the Android kernel's compilation environment

1. Preparation: Copy the arm-linux-gcc-4.3.2.tgz file and the arm-none-linux-gnueabi-arm-2008q3-72for-linux.tar.bz.2 file to the working directory.

2. Unzip the compiler

3. Verify that the cross compiler is successfully installed

4, Installation Libnctrses5

(4) Configuring and compiling the Linux kernel

Summarize:

Android porting is a Linux kernel transplant, and Linux kernel porting is a Linux-powered migration. So in order to develop and test Linux drivers. Two sets of development environments need to be built under Ubuntu Linux: the Android application development environment and the Linux kernel development environment, where the Linux development environment is the focus of this chapter.

Fourth: Download and compile the source code of the study notes

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.