In the first chapter, the Android porting is primarily the Linux kernel porting, and the Linux kernel porting is primarily a Linux-driven migration, so in order to develop and test Linux drivers, it is necessary to learn about the Ubuntu How to build two sets of development environments under Linux: Android Application development environment and Linux kernel development environment. The construction of the Linux kernel development environment is the focus of the focus. The following steps are written according to the contents of the book and the information on the Internet:
1 Configure Android source code download environment:
# mkdir ~/bin
# path=~/bin: $PATH \ \ Create a directory to hold script files
# Curl Http://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~bin/repo
# chmod a+x ~/bin/repo \ \ download Repo script file
# mkdir Android_source
#cd android_source \ \ Create a directory to hold the Android source code
# repo init-u https://android.googlesource.com/platform/mainfest \ \ Initialize
# repo sync \ \ Start downloading Android source code
(2) The Android source code directory contains different sub-projects of the Android source code, respectively
(3) Download part of the Android source code in two ways:
1. # repo sync platform/bootable/recovery \ Repo Sync command
2. #git clone http://android.googlesource.com/<project name> \\git clone command
(4) Compiling Android source code
# source build/envsetup.sh \ \ Initialize the compilation environment
# lunch Full-eng \ \ Select target
# make
# MAKE-J4 \ \ Compile Android source code
(5) Out directory structure analysis
(6) Publish your apk as an Android built-in program
(7) Test system.img file with simulator
2. Download and compile the Linux kernel source code
1. Download the Linux kernel source code
# git clone https://android.googlesource.com/kernel/common.git
# git Branch-a
# git checkout-b android-3.0 remotes/origin/android-3.0
# git clone https://android.googlesource.com/kernel/goldfish.git
# git checkout-b android-goldfish-2.6.29 remotes/origin/android-goldfish-2.6.29
2, the Linux kernel source code directory structure
3, install the Android kernel compilation environment
Installing the Cross Compiler
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
# tar ZXVF arm-linux-gcc-4.3.2.tgz-c/
# tar jxvf arm-none-linux-gnueabi-arm-2008q3-72-for-linux.tar.bz2-c/\ \ Unzip the compiler:
# ls/usr/local/arm–l \ Verify that the cross-compiler was successfully installed:
# apt-get install libncurses5–dev \ \ installation Libncurses5
#export path=/root/comppilers/arm-none-linux-gnueabi/bin: $PATH \ \ Configure and compile the Linux kernel
Android Deep Explore fourth Chapter