[Android Software Development] Sahil_Sonar:
Syncing Sources ​

Now look for your favorite ROM sources like for me its lineage so source are here

After you are done with your sources just clone the source but before that let's make a directory where we will store our source like for me I am using android/lineage for your ROM you can change as per your wish! Well if you still didn’t get your ROM sources then I will drop down link below of my top 5 favorite ROM sources!

Now let's make our directory

mkdir android/lineage && cd android/lineage

Now let’s initialize our ROM repo like for me its lineage, but for you change it as per your ROM. Here for your info after “-b” is your branch you will have to look for your ROM and change accordingly.

repo init -u git://github.com/LineageOS/android.git -b lineage-16.0

Well, now you will encounter a small error to fix it up just copy below code.

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

Replace you@example.com & “Your Name with your GitHub account email and username respectively. After that re-initize source.

Wow, it’s for Pie hehehe but it’s not yet done. We have just initialized source we are yet let to sync it. but before that please note source size is about 60-80gb so make sure you have enough bandwidth with high speed …

Now let’s sync our source

repo sync -f –-no-tags –-no-clone-bundle

Well, now you can do only one thing that is wait ...:cool: as repo is long (60g-80gb)

Done? Then why to wait just start with syncing device related sources.

Now you must be wondering what are they and why we need those… So, device related sources are of the device tree, kernel source, vendor blobs. You can find those by searching your device codename like for me I will search k5fpr device tree, k5fpr kernel source, k5fpr vendor tree (Here k5fpr is my device codename you change as per your device.) Now I got these links

DT : https://github.com/SahilSonar/android_device_lenovo_k5fpr

Kernel Source : https://github.com/SahilSonar/android_kernel_lenovo_k5fpr

Vendor Blobs/Tree : https://github.com/SahilSonar/android_vendor_lenovo_k5fpr

Well, now you don’t use these until and unless you want to build for k5fpr. You look for your device and now let’s clone them to our working dir. Again as dir. may change please edit the code as per your ROM

git clone https://github.com/SahilSonar/android_device_lenovo_k5fpr.git -b lineage-15.1 ~/android/lineage/device /lenovo/k5fpr

git clone https://github.com/SahilSonar/android_kernel _lenovo_k5fpr.git -b lineage-15.1 ~/android/lineage/kernel /lenovo/k5fpr

git clone https://github.com/SahilSonar/android_vendor _lenovo_k5fpr.git -b lineage-15.1 ~/android/lineage/vendor /lenovo/k5fpr

Now after -b is our branch just look one there in your source, which one you want to use just change it now most of the people must have thought hey man there is another way for this … We can use manifest… yes, those are 100000% but cloning is an easy way instead of manifest but still for those who want to clone using manifest then simply follow below steps instead of above … No issue you can use anyone.

First, let’s move to the dir where we are supposed to add manifest like for me its android/lineage/.repo You will have to change as per your dir.

cd android/lineage/.repo && mkdir local_manifests && cd local_manifests && nano roomservice.xml

After pasting above code you will see a text editor in that we are supposed to paste our manifest okay I am giving manifest of k5fpr you change source as per your device.

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/lenovo/k5fpr" name="mohancm/android_device_lenovo_A7010a48" remote="github" revision="oreo" />
<project path="vendor/lenovo/k5fpr" name="mohancm/android_vendor_lenovo_k5fpr" remote="github" revision="oreo" />
<project path="kernel/lenovo/k5fpr" name="mohancm/android_kernel_lenovo_A7010a48" remote="github" revision="oreo" />
</manifest>

Okay, so you must be wondering what to do for my device… Well don’t worry as we have used -b here its revision so after revision what comes is our branch and after “name” it's our source link and after “path” it's our destination like we have used ~/android/lineage/device/lenovo/k5fpr. That’s all for manifest just save it and exit after that just sync sources again … Whoa man, I don’t have 60-80gb left. Well, don’t worry its just loads the repo which is downloaded also it only fetches device specific sources.

repo sync -f –-no-tags –-no-clone-bundle