Android Deep Exploration (Vol. 1) HAL and Driver Development--reading notes (fourth)

Source: Internet
Author: User

Configuring the Android source code download Environment step

    1. Create a directory to hold the download script file (repo)

#mkdir ~/bin

#PATH =~/bin/repo

    1. Download Repo script file

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

#chmod A+x~/bin/repo

    1. Create a directory for Android source code

#mkdir Android_source

#cd Android_source

    1. Initialization

#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

L How to download a subproject in the source code

    1. Using the Repo aync command

#repo Sync Platform/bootable/recovery

#repo Sync Platform/packages/apps/camera

    1. Using 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

L Compile Android source code

    1. Initializing the compilation environment

#source build/envsetup.sh

or #.build/envsetup.sh.

    1. Select target

#lunch Full-eng

    1. Compiling Android source code

#make

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

l download and compile the Linux kernel source code

    1. Download 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

    1. Install the Android kernel's build environment

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

ARCH =arm.

Cross_compile?-arm-none-linux-guneabi

Steps:

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

    1. Configuring and compiling the Linux kernel

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

#cd ~/linux_kernel

#make Clean

#make

Android porting is primarily the porting of the Linux kernel, and the Linux kernel porting is primarily a Linux-powered migration, so in order to develop and test Linux drivers, two sets of development environments are required under Ubuntu Linux, Android application development environment and Linux kernel development environment, respectively

Android Deep Exploration (Vol. 1) HAL and Driver Development--reading notes (fourth)

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.