Configure Android source code Download Environment
(1) Create a directory to hold the download script file (repo) (you can put the script file in any directory, use ~/binhere). #mkdir ~/bin #PATH =~/bin: ¥PATH
(2) Download the script file (to download the Android source code). #curl HTTPS://dl-ssl. google.com/dl/googlesource/git-repo/repo>~/bin/repo #chmod a+x ~/bin/repo
(3) Create a directory to hold the Android source code (which can be placed in another directory). #mkdir android-source #cd android-source
(4) Initialize the #rcpo init-u https://android.googlesource.com/platform/manifeet #repo init-u https:// Android.googlesource.com/platform/manifest -B android-4.0.1-rl
(5) Start download Android Source code #repo Sync
Compiling Android Source code
Apt-get commands typically require root access, so follow the sudo command generally.
sudo apt-get install Git-core curl
This command installs Git-core and Curlfrom the internet's software repository.
where Curl is a File Transfer tool that works with URL syntax in command-line mode, and it supports many protocols, including FTP,FTPS ,HTTP,HTTPS,telent , etc., we need to install it from the network to get Repo script file.
Curl Http://android.git.kernel.org/repo >~/bin/repo
This command downloads the repo script file to the current home directory under the /bin directory and saves it in the file repo .
Finally, we need to Execute permissions on the repo file.
chmod a+x ~/bin/repo
To Be continued ...
Download and compile the Linux kernel source code
1. Using the Git tool to download, execute the following command:
[email protected]:~/android$ mkdir Kernel
[Email protected]:~/android$ CD kernel
[Email protected]:~/android/kernel$ git clone git://android.git.kernel.org/kernel/common.git
Also after a long wait, in the kernel directory there is a common directory, the Linux kernel code is here.
2. After the download is complete, you can view the downloaded kernel code version:
[Email protected]:~/android/kernel$ CD Common
[Email protected]:~/android/kernel/common$ git branch
android-2.6.36
3. After downloading the Linux kernel code for Android, you will find that there is no hardware profile for the emulator to use under Arch/arm/configs goldfish_defconfig
After the download is complete, you can see the Goldfish_defconfig file under Arch/arm/configs.
Android Deep Exploration (Volume 1) HAL and Driver Development chapter fourth