Environment construction
1. Install the 64-bit Ubuntu system (physical installation, virtual machine installation can be)
Note: require the machine at least 4G of memory (virtual machine allocated at least 4G memory), hard disk at least 100G space (source 20g+, compiled after the entire directory about 60~70g)
Installation method please Baidu ~
2. Update the system to the latest version and enter it under terminal
- sudo apt-get update
- sudo apt-get upgrade
3. Install and compile required packages
- sudo apt-get install Bison build-essential Curl Flex git gnupg gperf libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk2.8 -dev libxml2 libxml2-utils lzop openjdk-7-jdk openjdk-7-jre pngcrush schedtool squashfs-tools xsltproc zip Zlib1g-dev g++- Multilib gcc-multilib Lib32ncurses5-dev Lib32readline-gplv2-dev Lib32z1-dev
4. Establishing the Repo command
- Mkdir-p ~/bin
- Curl Https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
- chmod a+x ~/bin/repo
- echo "Export path=~/bin: $PATH" >> ~/.BASHRC
Note that the second line to download from Google Repo applet, the domestic network you know, you can hang an agent on the browser to download the following address, copy to ~/bin/repo, and then execute the third and fourth lines of the command
- Https://storage.googleapis.com/git-repo-downloads/repo
Synchronous source
1. Create a new folder to store the source code, here take ~/android/cm as an example
- mkdir ~/android/cm
- CD ~/android/cm
2. Initializing the source directory
- Repo Init-u git://github.com/cyanogenmod/android.git-b cm-12.1
3. Add Red Meter 3 dedicated file directory
- mkdir ~/android/cm/.repo/local_manifests
- Gedit ~/android/cm/.repo/local_manifests/ido.xml
Copy the following contents into the
<?xml version="1.0"encoding="Utf-8"?><manifest> <project name="Ido-dev/android_device_xiaomi_ido"Path="Device/xiaomi/ido"revision="cm-12.1"Remote="GitHub"/> <project name="Ido-dev/proprietary_vendor_xiaomi"Path="Vendor/xiaomi"revision="cm-12.1"Remote="GitHub"/> <!--<project name="Ido-dev/android_kernel_xiaomi_ido"Path="Kernel/xiaomi/ido"revision="cm-12.1"Remote="GitHub"/>--<project name="Cyanogenmod/android_device_qcom_common"Path="Device/qcom/common"Remote="GitHub"/> <project name="Cyanogenmod/android_external_sony_boringssl-compat"Path="External/sony/boringssl-compat"Remote="GitHub"/> <project name="Cyanogenmod/android_external_stlport"Path="External/stlport"Remote="GitHub"/></manifest>
4. For the Domestic network environment processing (slightly own use VPN or SS, tutorial please Baidu)
5. Pull the replacement code (need to download about more than 10 g of content, take the time to refer to the respective speed)
- Repo Sync--no-clone-bundle
If the intermittent network, or error, re-repo sync a bit can continue ~
6. Get precompiled parts of the file
- CD ~/android/cm/vendor/cm
- ./get-prebuilts
Compile ROM
1. Initializing the compilation environment
- CD ~/android/cm
- . build/envsetup.sh
- Lunch Cm_ido-userdebug
2. Compile ROM (the virtual machine under My notebook takes about 2 hours, depending on PC performance)
- Mka Ido
Note: At the beginning of the compilation of the first appearance of the following lines is normal phenomenon, does not affect the ~
- Find: ' src ': No such file or directory
- Find: ' Phone/java ': No such file or directory
- Find: ' dummy ': No such file or directory
Compile again
1. It is recommended that each compilation will be the last compilation of the content purged, or there may be inexplicable problems
- Make clobber
2. Synchronize the source to the latest version again
- Repo Sync
3. Initializing the compilation environment
- . build/envsetup.sh
- Lunch Cm_ido-userdebug
4. Compiling ROM
- Mka Ido
A little bit of tips
Turn on CCache to speed up the compilation process
- Export use_ccache=1
Red Rice 3 (ido) CyanogenMod12.1 compilation tutorial