Android Deep Exploration (Vol. 1) Hal and Driver Development fourth Chapter reading experience

Source: Internet
Author: User

To configure the Android source code download environment:

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

#mkdir ~/bin

#PATH =~/bin: $PATH

Step two: Download the repo script file (for downloading Android source code)

#curl Https://dl-ssl.google.com/dl/googlesource/git-repo/repo >~bin/repo

#chmod A+x~/bin/repo

Step three: Create a directory to hold the Android source code (can be placed in other directories)

#mkdir Android_source

#cd Android_source

Fourth Step: Initialize

#repo Init–u Https://android.googlesource.com/platform/manifest

#repo init–u https://android.googlesource.com/mainfest-b Android-4.0.1_r1

    1. Start downloading Android source code

#repo Sync

How to download a subproject in the source code

Method One: Use the repo aync command

#repo Sync Platform/bootable/recovery

#repo Sync Platform/packages/apps/camera

Method Two: Use the git clone command

git clone https://android.googlesource.com/<projext name>

git clone https://android.goolesource.com/platform/bootable/recovery

Cf:repo Sync will generate a hidden directory in the current directory. Repo,repo sync Download the source code for the specified project is stored in the actual path

• Steps to compile the Android source code

1. Initializing the compilation environment

#source build/envsetup.sh

or #.build/envsetup.sh.

2. Select target

#lunch Full-eng

3. Compiling Android Source code

#make

#make –J4 4 threads at the same time, the speed will be a bit faster

Download and compile the Linux kernel source code step

1. Download the Linux kernel source code

#git Clone Https://android.googlesource.com/kernek/commomn.git

#git Branch–a

#git Clone Https://android.googlesource.com/kernel/goldfish.git

#git checkout–b andoid-2.6.29 remotes/origin/android/android-goldfish-2.6.29

2, install the Android kernel compilation environment

Configure the Linux kernel source root directory to makefile files, find arch, cross_compile, and assign them to

ARCH =arm.

Cross_compile?-arm-none-linux-guneabi

Steps to install the cross compiler:

A. Preparatory work

Copy the Arm-linux-gcc-4.3.2.tgz file and the arm-none-linux-gnueabi-arm-2008q3-72-for-linux.tar.bz2 file to the working directory

B. Unzip the compiler

#tar SXVF Arm-linux-gcc-4.3.2.tgz–c

#tar JXVF Arm-none-linux-gnueabi-arm-2008q3-72-fr-linux.tar.bz2–c

C. Verify that the cross-compiler is successfully installed

#ls/usr/local/arm–l

D. Installing Libncurses5-dev

Configuring and compiling the Linux kernel

#export Path=/root/cmpilers/arm-none-linux-qnuabi/bin: $PATH

#cd ~/linux_kernel

#make Clean

#make

My Blog Park address is: http://www.cnblogs.com/zzp036/p/5449784.html

Android Deep Exploration (Volume 1) HAL and Driver Development fourth Chapter reading experience

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.