[Miscellaneous Android Development] Albe96:
Building Rom For A Particular Device!

For Example I'm Taking Samsung Galaxy Star GT-S5282,CodeName-->"Mint2g" And Taking CM13 To Build.

Extracting The Rom Source That You Had Downloaded-->>

•First Of All Download The Rom Compressed Source Which Rom You Want To Build For Your Device.

•After Download Cd To Where You Downloaded The File.For Me Its In Home/CM13.

•So For Me I Type-->>

Cd /home/CM13

•Now Type This Command To Extract The Downloaded Source-->>

▪If Your File Is In "tar.xz" Format Then Type This Command In Terminal-->>

tar -xvJf [Your File Name].tar.xz

Example:My Downloaded CM13 Compressed Source Name Is "CM-cm.13.0-no-repo-20160727.tar.xz".

So You Need To Type Like This-->>

tar -xvJf CM-cm-13.0-no-repo-20160727.tar.xz

▪If Your File Is In "tar.gz" Format Then Type This Command In Terminal-->>

tar -xvzf [Your File Name].tar.gz

Now The Source Will Be Extract!This Process Will Take Some Time.

Building Rom

•Go To The "Extracted Folder/device".

•And Then Create A Folder "samsung".[I'm Doing For Samsung Device So I'm Ceeated Folder Named "samsung".If U Making For Other Device.Then Create A Folder With Your Device's Company Name]

•Now Open The Folder[Extracted Folder/device/samsung].Then Right Click And Open The Terminal Here.

•You Have To Clone Your Device Tree.To Do It Type This Following Command-->>

git clone device_tree_URL -b branch_name

Explaination-->> Change "device_tree_device" With You Device Tree URL And "branch name" With The Rom You're Building.

For Me It Look Like This-->>

git clone https://github.com/TeamButter/android_device_samsung_mint.git -b cm-13.0

•Now Go To "Extracted Folder/vendor".

•Create A Folder Named "samsung".

•Open The Folder[Extracted Folder/vendor/samsung]

•You Have To Clone Your Vendor Tree Here.To Do That Right Click In The Folder And Open Terminal.

•Type This Following Command-->>

git clone device_vendor_tree_URL -b branch_name

Explaination-->> Change "device_vendor_tree_URL" With You Vendor Tree URL And "branch name" With The Rom You're Building.

For Me It Looks Like This-->>

git clone https://github.com/TeamButter/android_vendor_samsung_mint.git -b cm-13.0

•Now Go To Extracted Folder.

•Create A Folder Named "Kernel" Then Open This Kernel Folder And Create One More Folder Named "samsung".

•Open This Folder[Extracted Folder/Kernel/samsung]

•Right Click And Open Terminal.

•You Have To Clone Kernel Tree Here.Do To It,Type This Command-->>

git clone device_kernel_tree_URL -b branch_name

Explaination-->> Change "device_kernel_tree_URL" With You Kernel Tree URL And "branch name" With The Rom Branch You're Building.

For Me It Looks Like This-->>

git clone https://github.com/TeamButter/android_kernel_samsung_mint.git -b cm-13.0

All Done!

•Now Go To Extracted Folder.

•Right Click And Open Terminal.

•Type This Following Command-->>

source build/envsetup.sh

•Then Type This Command-->>

lunch

•And Then Type-->>

cm_codename_of_your_device_userdebug

Explanation-->>Change "codename_of_your_device" with your device codename.

•Now Type This Command-->>

mka clobber

•Finally Type This Command-->>

mka bacon

Yahhooo!You Built CM13 For Your Device.You Can Found The Flashable Zip In Home/Extracted Folder/OUT/target/product/yourdevicecodename.

Don't Forget To Hit The Thanks Button If I Helped You!