1. Configure the Android source code download environment
A. Create a directory to hold the download script file
mkdir ~/bin
Path=~/bin: $PATH
B. Download the repo script file
Curl Https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
C. Create a directory to hold the Android source code
mkdir Android_source
CD Android_source
D. Initialization
Repo Init-u https://android.googlesource.com/platform/manifest
E. Download
Repo Sync
2. Compiling Android source code
A. Initializing the compilation environment
SOURCE build/envsetup.sh
B. Selecting a target
Lunch Full-eng
C. compiling Android source code
MAKE-J4 (sets the number of cores to use at compile time)
3. Download the Linux kernel source code
A. git clone https://android.googlesource.com/kernel/goldfish.git (download kernel)
b. Git checkout-b android-goldfish-2.6.29 remotes/origin/android-goldfish-2.6.29
4. Install the Android kernel compilation environment
A. Modify the makefile file in the root directory of the Linux kernel source code, arch?= arm and cross_compile?=arm-none-linux-gnueabi-
5. Configure and compile the Linux kernel (assuming the Linux kernel source code directory is/root/linux_kernel)
Export Path=/root/compilers/arm-none-linux-gnueabi/bin: $PATH
CD ~/linux_kernel
Make clean
Make
Android, Linux kernel source code download and compilation