Some time ago, because Android betrayed GNU and the idea of freedom and open source pursued by Linux, it kicked out the main line of Linux source code. In addition to the recent adjustments made by kernel.org to black and Google for Android, there are various reasons. The method for downloading the android source code is invalid. The original source code address for downloading Android is:Repo init-u git: // android.git.kernel.org/platform/manifest.gitThe address has expired, and kernel.org has abandoned android.
The following is the latest Android source code download method, including the source code for downloading android4.0. When compiling the android source code, you need to install multiple packages. For Ubuntu systems, it is simple! First open the terminal:
After installing these packages, We need to install the download tool Repo. repo is an easy-to-use tool for managing Android source code. It can be used to download, synchronize, and upload Android projects.Source code. Installation steps:
(Note: The original address: curl https://android.git.kernel.org/repo> ~ /Bin/repo has expired, new address is: curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo> ~ /Bin/Repo)
Initialize repo and create an empty directory to store the android source code:
(Note: The original address: repo init-u git: // android.git.kernel.org/platform/manifest.githas been ineffective, the new address: repo init-u https://android.googlesource.com/platform/manifest. You can add-B to download the android source code of the specified version, for example, android4.0.1 _ R1.)
After repo init is completed, it requires you to enter your real name and email address to configure the repo.
After initialization and configuration are complete, execute the last step:Repo sync-J4
Because repo sync mainly obtains the source from the serverCodeSo the execution time will be relatively long, depending on the network speed, but you can add-J4 after repo sync to accelerate in parallel. 4 is the number of parallel threads, it can be determined based on your actual situation.