[Android] jackeagle:
Building Rom For A Particular Device

Building Rom For A Particular Device

​

Now has we have downloaded the sources we need for our Rom Build Lets Move to the Next Step which is Actually Major Step the Building The ROM

So Lets Start The Game...:laugh::D:D

Note : I will be taking Samsung Galaxy Grand Duos - GT -I9082 has Example here.

Example Rom : CM11

Now before starting with Building guide you have to Download your Device Identity That is has follows

1) Device Tree

2) Vendor

3) Kernel

The Above files are very Vital Parameters of building they specify your device and its Characteristics.

Now you might think from where you have to download those files?:confused:

Don't be confused its simple Search in our device forum for CM Tree and Kernel and Vendor. The Dev of CM for your Device forum will specify it in his ROM thread.

Once you obtain the github for your Device Tree, Vendor and Kernel. Enter following command

cd cm11/.repo

Here in .repo folder you have to create file called local_manifests.xml

1) Enter The Following Command in Terminal

nano local_manifest.xml

Structure of Local_manifest.xml is Has follows.

[COLOR=#000000][COLOR=#0000BB]<?xml version[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"1.0" [/COLOR][COLOR=#0000BB]encoding[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"UTF-8"[/COLOR][COLOR=#0000BB]?>
[/COLOR]<manifest>
[/COLOR]<project path=" directory in work tree" name="name of the repository in remote" remote="name of remote defined earlier" revision="branch of the repository" />
[COLOR=#000000]</manifest>[/COLOR]

2) Add your Device , Kernel , Vendor Source

Taking my Ex here of GT-I9082

After Adding device tree , Vendor , kernel my Local_manifest.xml will look like has follows

[COLOR=#000000][COLOR=#0000BB]<?xml version[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"1.0" [/COLOR][COLOR=#0000BB]encoding[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"UTF-8"[/COLOR][COLOR=#0000BB]?>
[/COLOR]<manifest>
<project path="device/samsung/i9082" name="pawitp/android_device_samsung_i9082" remote="github" revision="cm-11.0" />
<project path="vendor/samsung/i9082" name="k2wl/android_vendor_samsung_i9082" remote="github" revision="master" />
<project path="kernel/samsung/i9082" name="pawitp/android_kernel_samsung_i9082" remote="github" revision="cm-11.0" />
</manifest>[/COLOR]

3) Press ctrl+O and Enter

4) Press Ctrl+X to exit.

After Adding Device Tree,Vendor,Kernel sources just repo sync again so that the files are downloaded. you can also add which files you want to download or you dont want to download. More about manifest and local_manifest will be explained by [MENTION=5565132]Kishan14[/MENTION] in his guide:D

Once that is done now you have your device Identity with you:laugh::laugh::highfive:

Now follow the Instruction Given by [MENTION=4924398]rutvikrvr[/MENTION] in POST 9 to make the your CM Device Tree Compatible with your ROM Source.

Once your CM Device tree is successfully made compatible with your ROM its Time for Building :D:cool:

Now Building Command Various with Rom which you want to compile its different for different ROM you have to see the Manifest of The Rom for it has instruction for building will be given there. Since i m Taking example of CM11 and Device has GT-I9082 the steps goes has follows

1) Enter the Following command in Terminal

cd cm11

Just Replace CM11 by your working directory of Rom . Ex : AOGP,AICP etc

2)Now enter following Command To Terminal

[COLOR=#000000][COLOR=#007700]. [/COLOR][COLOR=#0000BB]build[/COLOR][COLOR=#007700]/[/COLOR][COLOR=#0000BB]envsetup[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]sh[/COLOR][/COLOR]

3) Build Instruction Varies from Rom to Rom so check manifest of ROM for the Same. General instuction is

[COLOR=#262626]time brunch <codename>[/COLOR] [COLOR=#000000][COLOR=#007700]-[/COLOR][COLOR=#0000BB]j[/COLOR][COLOR=#FF8000]#[/COLOR][/COLOR]

<Codename> CodeName of your Device

# is the No of CPU cores you have.

Building will take time depending on your system configuration.

Once building is Done.

Its Time to apply patches which will be given in our CM Rom thread if any.

Follow the guide by [MENTION=4924398]rutvikrvr[/MENTION] in Post 10 for applying patches.

Once Done rebuild again using command above (This time building will be fast)

Now go to your working directory and go to OUT/target/your device/ you will get the Zip of the Rom.

Always make a backup of your current Rom.

Flash it via recovery and check.:laugh::laugh:

:cool::cool:Hurrrrrray You Just Developed A Rom from Source:cowboy::cowboy:
​