Configuring the Android source code download Environment step
- Create a directory to hold the download script file (repo)
#mkdir ~/bin
#PATH =~/bin/repo
- Download Repo script file
#curl Https://dl-ssl.google.com/dl/googlesource/git-repo/repo >~bin/repo
#chmod A+x~/bin/repo
- Create a directory for Android source code
#mkdir Android_source
#cd Android_source
- Initialization
#repo Init–u Https://android.googlesource.com/platform/manifest
#repo init–u https://android.googlesource.com/mainfest-b Android-4.0.1_r1
- Start downloading Android source code
#repo Sync
L How to download a subproject in the source code
- Using the Repo aync command
#repo Sync Platform/bootable/recovery
#repo Sync Platform/packages/apps/camera
- 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
- Initializing the compilation environment
#source build/envsetup.sh
or #.build/envsetup.sh.
- Select target
#lunch Full-eng
- 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
- 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
- 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
- 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)