This article is mainly about the compilation of onePlus mobile phone (OnePlus/Bacon) Rom after repo Sync has completed all cm12 source code.
Other versions can be drawn by analogy.
1.Nexus 7 (” grouper “) Build for reference
The following link is a method for compiling the Nexus 7 (” grouper “) under Linux for reference.
http://wiki.cyanogenmod.org/w/Build_for_grouper
2. Download the respective Device and Kernel
After repo Sync has all the source code for CM12, you also need to download the device related files and the kernel source code.
from cm’s official https://github.com/CyanogenMod search equipment making page code, one plus is oneplus, has two results: android_device_oneplus_bacon, android_kernel_oneplus_msm8974, then search android_device_qcom_common, point in the three projects git clone & lt; ssh url> Go down, or click Download ZIP to Download and unzip.
using breakfast bacon automatically pulls everything you need from github, so you only need to download the device part of oneplus.
3. Configure device and kernel
After downloading the device and kernel above, it is necessary to put them in the correct place. Here is a good specification that the file name of the download indicates the corresponding directory
(Android stands for root). Go to the root directory of the source.
Mkdir -p device/oneplus/bacon
mkdir -p kernel/oneplus/msm8974
Mkdir -p device/qcom/common
unzip the device and kernel you just downloaded and put them in the three new directories above.
4. Configuration vendor
Sh
first connect the oneplus phone via USB, make sure the system version is consistent with the source version, then go to the source /device/oneplus/bacon/ directory and execute the above instructions.
the main function of this script is to pull out the driver so library in the mobile phone, and then create /vendor/oneplus/bacon/ directory.
Then put the appropriate library files in it.
Method 2: The above method requires the phone to have the system installed, and a method called github search for proprietary_vendor_oneplus to download
Into the source/vendor/directory, execute the git clone https://github.com/withyou/proprietary_vendor_oneplus.git
After downloading the proprietary_vendor_oneplus, the proprietary_vendor_oneplus was renamed to oneplus, and then git branch-av looked at the branch. If it was not in the corresponding source branch such as 6.0, it should checkout to cm-13.0.
Configure the USB please refer to this article: http://blog.csdn.net/lechengyuyuan/article/details/21091245
5. Compile
The source build/envsetup. Sh
Breakfast bacon
Brunch selects Cm-Kon-userdebug enter (which is lunch & AMP; & Make)
The whole compilation process can take several hours depending on the PC configuration, and the compilation can also be based on CPU performance plus -j4 parameter (4 for core number) brunch Cm-Cock-Userdebug-j4. If you see the Package Complete:… The out/target/product/bacon/cm – 12.1-20151102 – UNOFFICIAL – bacon. Zip, compile all finished.
6. Compilation may be a problem
1.
Make: * * * No rule to make target `/out/host/Linux x86/bin/dtbToolCM ‘, men by ‘/ out/target/product/bacon/dt. Img’. Stop
Solution: from cm’s official making page https://github.com/CyanogenMod search android_device_qcom_common, Download the ZIP.
The mkdir -p device/end/common
Unzip the downloaded android_device_qcom_common.zip and put it in the newly created directory.
Similarly, if a file under /device/oppo/common/ is not found, download android_device_oppo_common.zip and unzip it into the corresponding directory.
2.
The system/vold/cryptfs. C: In the function ‘load_crypto_mapping_table’ :
System/vold/cryptfs. C: 1031:3: error: implicit declaration of the function ‘is_ice_enabled [- Werror = implicit function – declaration]
if (is_ice_enabled ())
^
Means in the system/vold/cryptfs. C is not found in the is_ice_enabled method, and this method is in the source root directory/device/end/common/cryptfs_hw/statement under the defined, but in CM making download device/end/common (that is, the problem 1 download folder) and repo sync up code out of sync.
Solution to download http://download.csdn.net/download/lechengyuyuan/9237537, download directly after the/device/end/common/cryptfs_hw/directory three files to replace it.
3.
The out/target/product/bacon/obj/KERNEL_OBJ /… Stop.
Do not manually compile the kernel with make or make uImage in the kernel directory, it will interfere with compiling the entire code tree and cause an error. If you have done this before, you can by removing the out/target/product/bacon/obj/KERNEL_OBJ entire folders, hand in hand to the kernel (kernel) directory inside make mrproper down to clean off the kernel source directory. It is also recommended to make mrproper before brunch in the kernel’s source directory.
Original articles, reprint must indicate the source: http://blog.csdn.net/lechengyuyuan/article/details/49514319
Other versions can be drawn by analogy.
1.Nexus 7 (” grouper “) Build for reference
The following link is a method for compiling the Nexus 7 (” grouper “) under Linux for reference.
http://wiki.cyanogenmod.org/w/Build_for_grouper
2. Download the respective Device and Kernel
After repo Sync has all the source code for CM12, you also need to download the device related files and the kernel source code.
from cm’s official https://github.com/CyanogenMod search equipment making page code, one plus is oneplus, has two results: android_device_oneplus_bacon, android_kernel_oneplus_msm8974, then search android_device_qcom_common, point in the three projects git clone & lt; ssh url> Go down, or click Download ZIP to Download and unzip.
using breakfast bacon automatically pulls everything you need from github, so you only need to download the device part of oneplus.
3. Configure device and kernel
After downloading the device and kernel above, it is necessary to put them in the correct place. Here is a good specification that the file name of the download indicates the corresponding directory
(Android stands for root). Go to the root directory of the source.
Mkdir -p device/oneplus/bacon
mkdir -p kernel/oneplus/msm8974
Mkdir -p device/qcom/common
unzip the device and kernel you just downloaded and put them in the three new directories above.
4. Configuration vendor
Sh
first connect the oneplus phone via USB, make sure the system version is consistent with the source version, then go to the source /device/oneplus/bacon/ directory and execute the above instructions.
the main function of this script is to pull out the driver so library in the mobile phone, and then create /vendor/oneplus/bacon/ directory.
Then put the appropriate library files in it.
Method 2: The above method requires the phone to have the system installed, and a method called github search for proprietary_vendor_oneplus to download
Into the source/vendor/directory, execute the git clone https://github.com/withyou/proprietary_vendor_oneplus.git
After downloading the proprietary_vendor_oneplus, the proprietary_vendor_oneplus was renamed to oneplus, and then git branch-av looked at the branch. If it was not in the corresponding source branch such as 6.0, it should checkout to cm-13.0.
Configure the USB please refer to this article: http://blog.csdn.net/lechengyuyuan/article/details/21091245
5. Compile
The source build/envsetup. Sh
Breakfast bacon
Brunch selects Cm-Kon-userdebug enter (which is lunch & AMP; & Make)
The whole compilation process can take several hours depending on the PC configuration, and the compilation can also be based on CPU performance plus -j4 parameter (4 for core number) brunch Cm-Cock-Userdebug-j4. If you see the Package Complete:… The out/target/product/bacon/cm – 12.1-20151102 – UNOFFICIAL – bacon. Zip, compile all finished.
6. Compilation may be a problem
1.
Make: * * * No rule to make target `/out/host/Linux x86/bin/dtbToolCM ‘, men by ‘/ out/target/product/bacon/dt. Img’. Stop
Solution: from cm’s official making page https://github.com/CyanogenMod search android_device_qcom_common, Download the ZIP.
The mkdir -p device/end/common
Unzip the downloaded android_device_qcom_common.zip and put it in the newly created directory.
Similarly, if a file under /device/oppo/common/ is not found, download android_device_oppo_common.zip and unzip it into the corresponding directory.
2.
The system/vold/cryptfs. C: In the function ‘load_crypto_mapping_table’ :
System/vold/cryptfs. C: 1031:3: error: implicit declaration of the function ‘is_ice_enabled [- Werror = implicit function – declaration]
if (is_ice_enabled ())
^
Means in the system/vold/cryptfs. C is not found in the is_ice_enabled method, and this method is in the source root directory/device/end/common/cryptfs_hw/statement under the defined, but in CM making download device/end/common (that is, the problem 1 download folder) and repo sync up code out of sync.
Solution to download http://download.csdn.net/download/lechengyuyuan/9237537, download directly after the/device/end/common/cryptfs_hw/directory three files to replace it.
3.
The out/target/product/bacon/obj/KERNEL_OBJ /… Stop.
Do not manually compile the kernel with make or make uImage in the kernel directory, it will interfere with compiling the entire code tree and cause an error. If you have done this before, you can by removing the out/target/product/bacon/obj/KERNEL_OBJ entire folders, hand in hand to the kernel (kernel) directory inside make mrproper down to clean off the kernel source directory. It is also recommended to make mrproper before brunch in the kernel’s source directory.
Original articles, reprint must indicate the source: http://blog.csdn.net/lechengyuyuan/article/details/49514319