FORUMS
Remove All Ads from XDA

[COMPLETE][NOOB-FRIENDLY] TWRP COMPILE GUIDE - MSM/MTK. {CyanogenMod}

256 posts
Thanks Meter: 180
 
By HostZero, Senior Member on 5th June 2016, 08:49 AM
Post Reply Email Thread
Lets go straight into topic.

Requirements.
Ubuntu 14.04 or + required.
[B]Official CM 13 support.

1: Setting up Environment.

1.1 Build Essentials
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
  zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
  lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
  libgl1-mesa-dev libxml2-utils xsltproc unzip
1.2 Settingup Java
Code:
sudo apt-get update
sudo apt-get install openjdk-8-jdk
Code:
2. Download Repo.
Code:
mkdir WORKING-DIR && cd WORKING-DIR
repo init -u https://github.com/lj50036/platform_manifest_twrp_cm -b twrp-13.0
repo sync -j# --force-sync (replace '#' with Number of Cores + '1' )
3.Cloning
you can find your device tree @ github.com/CyanogenMod

Mine: Sprout! Android One so https://github.com/CyanogenMod/andro...t/tree/cm-13.0
mkdir -p device/<your-brand>/<codename>

example:
Code:
mkdir -p device/google/sprout4
git clone https://github.com/CyanogenMod/android_device_google_sprout.git -b cm-13.0 device/google/sprout4
open cm.dependencies file you will find the additional repository required: for me sprout-common
you will find it on github.com/CyanogenMod

you can clone it anywhere.

4.Merging Common and Device Tree

open cm.dependencies in device tree. empty all the text in it!.
go to common tree if MTK Device: common/rootdir/
if MSM Device: common/rootdir/etc/
copy and if-needed replace all rootdir files from common to device tree.

Open BoardConfig.mk in Device Tree
Open BoardConfigCommon.mk in Common Tree

Add All the missing text in device tree from common tree.

if vendorsetup.sh file is not there in device tree then make a file named vendorsetup.sh
open vendorsetup.sh, add this lines in same format with your device requirements.

add_lunch_combo cm_<your-codename>-eng
add_lunch_combo cm_<your-codename>-userdebug

5. Deleting Unwanted lines which will cause errors while compiling!
open cm.mk, device.mk, <your-codename>.mk, if-exist full_<your-codename>.mk any other .mk files.

delete all the lines which are calling vendor, kernel and any other bull crap!.

6. Adding Prebuilt-kernel Instead of Source
Download Latest cm-nightly-<your-codename>.zip
extract boot.img from zip
unpack the boot.img using carlivkitchen

open extracted dir, copy <recovery-file-name>-kernel to devicetree/rootdir/
rename <recovery-file-name>-kernel to kernel

open BoardConfig.mk in device tree

go to #kernel
you will find TARGET_KERNEL_SOURCE := <make this line empty>
you will find TARGET_KERNEL_CONFIG := <make this line empty>
add line TARGET_PREBUILT_KERNEL := device/<your-brand>/<your-codename>/rootdir/kernel

save and exit

7.Compiling
cd WORKING-DIR
. build/envsetup.sh
you can run any command:
lunch cm_<your-codename>-eng
(or)
lunch cm_<your-codename>-userdebug

Once lunching is successfull.

make -j# recoveryimage (replace # with number of cores + 1)

8. OUT/target/product/<your-codename>/recovery.img
The Following 2 Users Say Thank You to HostZero For This Useful Post: [ View ] Gift HostZero Ad-Free
 
 
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes