Use git to download two sets of source code, one set is the Android source code, one set is the Linux kernel source code. Since Android porting is primarily a migration of the Linux kernel, and the Linux kernel porting is primarily a Linux-driven migration, in order to develop and test Linux drivers, the Ubuntu Linux Build two sets of development environments: Android application development environment and Linux kernel development environment.
First, download, pre-compile, and test the Android source code core steps:
1. Configure the Android source code download environment
(1) Create a directory to hold the download script file (repo)
(2) Download repo script file
(3) Create a directory to hold the Android source code
(4) initialization
(5) Start downloading Android source code
2.Android Source code directory structure parsing
3. Download part of the Android source code
(1) Method 1: Use the Repo Sync command
(2) Method 2: Use the git clone command
4. Compiling Android source code
(1) Initializing the compilation environment
(2) Select Directory
(3) Compiling Android source code
5.OUT Directory Structure Analysis
6. Publish your apk as an Android built-in program
7. Test the System.img file with the simulator
Second, download and compile the Linux kernel source code
1. Download the Linux kernel source code
Directory structure of 2.Linux kernel source code
3. Install the Android kernel's build environment
(1) Preparation: 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.
(2) Unzip the compiler using the following code to extract the above two compressed files
# tar ZXVF arm-linux-gcc-4.3.2.tgz-c/
# tar JXVF arm-none-linux-gnueabi-arm-2008q3-72-for-linux.tar.bz2-c/
(3) Verify that the cross-compiler is successfully installed
# ls/usr/local/arm–l
(4) Installation libncurses5
# Apt-get Install Libncurses5–dev
4. Configuring and compiling the Linux kernel
#export Path=/root/comppilers/arm-none-linux-gnueabi/bin: $PATH
Android Deep Exploration-Volume 1 the fourth chapter