Rehber Building Rom From Device Source [GUIDE]

Hoşgeldiniz <3

DevOtağ is a developer platform with a number of enhancements shared for various Android devices. Become a member and benefit from the contents!

DevOtağ, çeşitli Android cihazlar için birtakım geliştirmeler paylaşılan bir geliştirici platformudur. Üye olun ve içeriklerden faydalanın!

Şimdi, Bir Dakikada Kayıt Olun!
Hi friends today I will tell you how to compile custom rom from the source code
This guide is available in Ubuntu 16.04 and later.

Firstly install needed packages from this guide;
$ mkdir -p ~/bin
$ curl > ~/bin/repo
$ chmod a+x ~/bin/repo
Give these commands on terminal ;
Then create new folder in home directory for compiling rom
To open this folder and access the folder,
$ mkdir "the name you want to put"
$ cd "your folders name"
Apply these commands ;
Then we'll compile the repo of the rom to pull (I will continue with ArrowOS) (You can find your roms repo in roms GitHub account)
$ repo init -u -b arrow-10.0
$ repo sync  -f --force-sync --no-clone-bundle -j$(nproc --all)
The part needs to be changed while pulling repositories of other roms is the part after "repo init -u". Links like are the link of the ROM's manifest. We can find manifest of the certain roms under their Github organization page. Name of the manifest repository can be one of the "android_manifest, manifest, android or platform_manifest". After finding the right manifest repository, copy link of it and paste it after "repo init -u". You can add -b to end of the command to fetch specific branch (-b branchname).

After repo sync you need clone your device's "device tree,vendor,kernel"
For device tree;
$ git clone <your device tree link> -b <your branch> device/<your device brand>/<your devices codename>
For example;
$ git clone git clone -b aosp device/google/seed

For kernel source;
$ git clone <your kernel source link> -b <your branch> <Kernel location specified in devicetree>
For example;
$ git clone -b master kernel/cyanogen/msm8916

For vendor tree;
$ git clone <your vendor tree link> -b <your branch> vendor/<your device brand>
For example;
$ git clone -b aosp vendor/google

If you have a common device for your device;
$ git clone <common device tree link> -b <your branch> device/<your device brand>/<chipset>
For example;
$ git clone -b lineage-16.0 device/cyanogen/msm8916

Finally, before compiling, enter your device tree in the directory where you clone with the "cd device/<your device brand>/<device code name>".

"nano" and the bottoms will be a line with "". Edit according to rom where you will compile the name of the rom that says there.
The example is "" ""and in order to press "ctrl+o, enter, ctrl+x keys"

For example compiling Arrow rom you must be on device tree's directory then;
"" is the arrow to compile rename "" with mv command "mv " and then, in turn, we press "ctrl+o, enter, ctrl+x".​

Then we need write "nano" for example "nano" in same directory
after the file is opened;

In the line that begins with the device code name will compile the name of the rom that comes before the name of the rome, for example;

PRODUCT_NAME := aosp_seed to PRODUCT_NAME := arrow_seed

Then press
"ctrl+o, enter, ctrl+x keys"

Then write "nano" in main directory of device tree
And the resulting nanopage add this lines ""add_lunch_combo <rom name >_<device codename>-userdebug"​

Then "ctrl+o, enter, ctrl+x"

Then we need be in the main directory of rom.
Then write this commands​
$ source build/
$ lunch <rom name>_<device codename>-userdebug
$ mka bacon -j$(nproc --all)

Then here we go compile started :)
That thread translated from @Celexa 's thread
Main thread ;
Thanks for @MacTavishAO for translating <3
Last edited by a moderator: