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!
Messages
18
Likes
62
Location
Ankara
#1
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;
Then;
Code:
$ mkdir -p ~/bin
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/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,
Code:
$ 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)
Code:
$ repo init -u https://github.com/ArrowOS/android_manifest.git -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 https://github.com/ArrowOS/android_manifest.git 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"
Code:
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 https://github.com/Kanger-Team/android_device_google_seed -b aosp device/google/seed

For kernel source;
$ git clone <your kernel source link> -b <your branch> <Kernel location specified in devicetree BoardConfig.mk>
For example;
$ git clone https://github.com/Kanger-Team/kernel_google_seed -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 https://github.com/Kanger-Team/android_vendor_google -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 https://github.com/LineageOS/android_device_cyanogen_msm8916-common -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 AndroidProducts.mk" and the bottoms will be a line with "anyromname_devicecodename.mk". Edit according to rom where you will compile the name of the rom that says there.
The example is "aosp_seed.mk" "arrow_seed.mk"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;
"aosp_seed.mk" is the arrow to compile rename "arrow_seed.mk" with mv command "mv aosp_seed.mk arrow_seed.mk " and then, in turn, we press "ctrl+o, enter, ctrl+x".​

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


PRODUCT_NAME :=
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 vendorsetup.sh" 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​
Code:
$ source build/envsetup.sh
$ 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 ; https://devotag.com/threads/kaynak-koddan-rom-derleme-rehberi.483/
Thanks for @MacTavishAO for translating <3
 
Last edited by a moderator:
Top