• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE][COMPLETE] Android ROM Development From Source To End

Search This thread

adinechin

Senior Member
Sep 19, 2012
662
395
Lyon
Hi everyone, I would like to know what is the best way to sign a build with our own keys ?
I already generated my own keys with :
Code:
subject='/C=US/ST=California/L=Mountain View/O=Android/OU=Android/CN=Android/[email protected]'
mkdir ~/.android-certs
for x in releasekey platform shared media; do \
    ./development/tools/make_key ~/.android-certs/$x "$subject"; \
done
Now I want to use it directly in my build. I tried different things but nothing worked...
Ok so I answer to myself, the successful way I found is to add this line in BoardConfig.mk (in device tree)
Code:
PRODUCT_DEFAULT_DEV_CERTIFICATE := /<your_path>/.android-certs/releasekey
And then do a full clean and full build

Code:
make clobber && make clean
brunch ...
 

Jespert

Member
Dec 28, 2020
41
5
Hello all, I get the following error when trying to build CM10.1 on Ubuntu 20.04. Does anyone know how to fix?

Code:
/home/jesper/android/cm-10.1/out/host/linux-x86/obj/STATIC_LIBRARIES/libcts_audio_quality_intermediates/libcts_audio_quality.a(ClientSocket.o): In function `ClientSocket::readData(char*, int, int)':
/home/jesper/android/cm-10.1/cts/suite/audio_quality/lib/src/ClientSocket.cpp:83: undefined reference to `fcntl64'
/home/jesper/android/cm-10.1/cts/suite/audio_quality/lib/src/ClientSocket.cpp:88: undefined reference to `fcntl64'
/home/jesper/android/cm-10.1/cts/suite/audio_quality/lib/src/ClientSocket.cpp:134: undefined reference to `fcntl64'
collect2: ld returned 1 exit status
make: *** [build/core/host_executable.mk:19: /home/jesper/android/cm-10.1/out/host/linux-x86/obj/EXECUTABLES/cts_audio_quality_test_intermediates/cts_audio_quality_test] Error 1
 
Last edited:

DiamondJohn

Recognized Contributor
Aug 31, 2013
5,540
5,282
Sydney
Platform:msm8916
Stock: galaxy grand prime g530h los 13
Port: galaxy j5 15 android 6.0.1 tw-mm
Issue:
Trying to boot, but stuck at splash logo. Looked through the log and see that it cant find some files that are already there
SInce it dioesnt boot, I am assuming you do mean last_kmsg.

By "splash logo", as opposed to bootanimation, that implies something deeper than the rom.ie the bootloader.

As for not finding files, have you also checked the permissions on these files that exist? And maybe they "exist" AFTER the ROM is actually looking for them. Are you certain they exist when the boot looks for them? and not just when
 
SInce it dioesnt boot, I am assuming you do mean last_kmsg.

By "splash logo", as opposed to bootanimation, that implies something deeper than the rom.ie the bootloader.

As for not finding files, have you also checked the permissions on these files that exist? And maybe they "exist" AFTER the ROM is actually looking for them. Are you certain they exist when the boot looks for them? and not just when
Xda didnt upload my log, so here it is, sorry
 

zappigan

Member
Apr 28, 2020
8
0
It's my understanding that the device tree is supposed to produce the original file structure from the stock rom. So it copies stuff to vendor to make it look like the original vendor partition, is this right?

My device also has a product partition. I extracted from super.img the following: system.img, vendor.img and product.img. A & B sides, although B side was mostly empty. Android 10.

The question is, does it make sense to copy files to - and use - the product partition in my device tree or should I just merge product and vendor so that I only use the vendor partition? :unsure:
 

adinechin

Senior Member
Sep 19, 2012
662
395
Lyon
Hi, could anyone help me ? I've already built several ROMs from source for my device (Lenovo Vibe K5 Plus / A6020), and I'm trying to build CalyxOS : https://gitlab.com/CalyxOS

The build is successful, as I only manage to generate *.img files, I flashed them directly via fastboot (boot.img and system.img), but I have the attached logcat at boot, and I don't see the boot animation.

Thanks !
 

Attachments

  • calyx_boot.log
    835.4 KB · Views: 9

DiamondJohn

Recognized Contributor
Aug 31, 2013
5,540
5,282
Sydney
Hi, could anyone help me ? I've already built several ROMs from source for my device (Lenovo Vibe K5 Plus / A6020), and I'm trying to build CalyxOS : https://gitlab.com/CalyxOS

The build is successful, as I only manage to generate *.img files, I flashed them directly via fastboot (boot.img and system.img), but I have the attached logcat at boot, and I don't see the boot animation.

Thanks !
I did not read your log, but, I would only flash he ROM using a custom recovery such as TWRP. And thyat would be a CLEAN flash, which fastboot wont do.
 

MPK99

Senior Member
Jun 25, 2017
492
304
Mexico
gitlab.com
Redmi Note 10
So Lets say u wanna begin with AOGP, So here's the steps you got to follow :

Code:
mkdir  roms/aogp &&cd roms/aogp
Code:
repo init --reference=~/roms/cm11 -u git://github.com/AOGP/android.git -b cm-11.0
You should notice a big time difference, from hours for a full repo sync, down to minutes using this trick!
Hello sir. Reference command seems won't work for now.

Here's the output :
~/lineage $ cd ~/pixelext && repo init --reference=~/lineage --depth=1 -u https://github. com/PixelExtended/manifest -b eleven Downloading manifest from https://github.com/PixelExtended/manifest error: Could not read 3b3bee1952b8f8a14521cd605336fdce5085f0e6 remote: Enumerating objects: 8, done. remote: Counting objects: 100% (8/8), done. remote: Compressing objects: 100% (8/8), done. remote: Total 8 (delta 0), reused 2 (delta 0), pack-reused 0 error: Could not read 3b3bee1952b8f8a14521cd605336fdce5085f0e6 fatal: Failed to traverse parents of commit 582a7d3c9012e63b03a611a04a86d7925776071a error: remote did not send all necessary objects manifests: sleeping 4.0 seconds before retrying error: Could not read 3b3bee1952b8f8a14521cd605336fdce5085f0e6 remote: Enumerating objects: 8, done. remote: Counting objects: 100% (8/8), done. remote: Compressing objects: 100% (8/8), done. remote: Total 8 (delta 0), reused 2 (delta 0), pack-reused 0 error: Could not read 3b3bee1952b8f8a14521cd605336fdce5085f0e6 fatal: Failed to traverse parents of commit 582a7d3c9012e63b03a611a04a86d7925776071a error: remote did not send all necessary objects fatal: cannot obtain manifest https://github.com/PixelExtended/manifest ~/pixelext $
 

Dhanush.15

New member
May 29, 2020
4
0
Samsung Galaxy J5
Xiaomi Mi A3
Code:
[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]
can anyone explain me this part
 

aliabadi97

Member
Feb 17, 2021
6
0
Hi
I'm new to porting android and working with lineageOS.

There is a file in device tree named <proprietary-files.txt>

I searched everywhere but can't find how to create it.

Also I know there are some blobs that we need, but blobs in vendor partition of stock rom in all devices are so bigger than these files in device trees. How to find which of them are useful?

notice: I'm familiar with TheMuppets or some other repos. I want to extract them manually from stock rom.
 
Last edited:

MPK99

Senior Member
Jun 25, 2017
492
304
Mexico
gitlab.com
Redmi Note 10
Hi
I'm new to porting android and working with lineageOS.

There is a file in device tree named <proprietary-files.txt>

I searched everywhere but can't find how to create it.

Also I know there are some blobs that we need, but blobs in vendor partition of stock rom in all devices are so bigger than these files in device trees. How to find which of them are useful?

notice: I'm familiar with TheMuppets or some other repos. I want to extract them manually from stock rom.
Use Android Tools 8th tool.
 

Tech180

Senior Member
Does anybody have any idea how to solve this error?
Selection_001.png
 

Top Liked Posts

  • There are no posts matching your filters.
  • 443
    Hello Everyone....:D:D

    Today I will present you all the ultimate guide for ROM development starting from Source to End.
    This guide will be applicable to all devices.
    So lets Start :D



    What is Android? :rolleyes:

    Android is the open-source operating system used for smartphones. Full Freedom for people using it :D


    What is Android Source Code?

    Android is an open-source software stack created for a wide array of devices with different form factors. The primary purposes of Android are to create an open software platform available for carriers, OEMs, and developers to make their innovative ideas a reality and to introduce a successful, real-world product that improves the mobile experience for users.The result is a full, production-quality consumer product with source code open for customization and porting.
    So basically Android Allows to customize the things you like and make new things without any Restrictions. Cool isn’t it? :cool:

    What is Android ROM ?
    The Android ROM is the Android operating system. This is the User interface (Sense UI in HTC phones) and the file system for maintaining contacts etc. It is composed of a Linux kernel and various add-ons to achieve specific functionality.

    What does a Android Rom Contain ?
    Basically a Android Rom Contains following main things :
    · Kernel
    · Bootloader
    · Recovery
    · Radio
    · Framework
    · Apps
    · core
    · android-runtime,Etc


    Some Basics About Above Terms

    Kernel :
    A kernel is critical component of the Android and all operating systems. It can be seen as a sort of bridge between the applications and the actual hardware of a device. Android devices use the Linux kernel, but it's not the exact same kernel other Linux-based operating systems use. There's a lot of Android specific code built in, and Google's Android kernel maintainers have their work cut out for them. OEMs have to contribute as well, because they need to develop hardware drivers for the parts they're using for the kernel version they're using. This is why it takes a while for independent Android developers and hackers to port new versions to older devices and get everything working. Drivers written to work with the Gingerbread kernel on a phone won't necessarily work with the Ice Cream Sandwich kernel. And that's important, because one of the kernel's main functions is to control the hardware. It's a whole lot of source code, with more options while building it than you can imagine, but in the end it's just the intermediary between the hardware and the software. So basically if any instruction is given to mobile it first gives the command to kernel for the particular task execution.

    Bootloader :

    The bootloader is code that is executed before any Operating System starts to run. Bootloaders basically package the instructions to boot operating system kernel and most of them also have their own debugging or modification environment. Think of the bootloader as a security checkpoint for all those partitions. Because if you’re able to swap out what’s on those partitions, you’re able to break things if you don’t know what you’re doing. So basically it commands the kernel of your device to Boot the Device properly without any issues. So careful with bootloader since it can mess things very badly.

    Recovery :

    [FONT=&quot]Recovery is defined in simple terms as a source of backup. Whenever your phone firmware is corrupted, the recovery does the job in helping you to restore or repair your faulty or buggy firmware into working condition. It is also used for flashing the Rom’s , kernel and many more things.

    [/FONT]
    Radio[FONT=&quot]
    [/FONT]

    The lowest part of software layer is the radio: this is the very first thing that runs, just before the bootloader. It control all wireless communication like GSM Antenna, GPS etc.


    These are main parts of Android Operating System.

    [FONT=&quot]Now has we know what is Android and What it contains lets move to the Next major step. That is Android Rom Development from Source. But before starting this we need some Initial Setup and development Enviroment .[/FONT]

    Android Rom Development

    Setting Up Linux Enviroment




    Pre – Requirements for Android Rom Development.
    1) Linux Operating System ( I will take Ubuntu 13.10 has Example and also recommend you all)
    2) Java Development Kit (JDK)
    3) Some Tools.

    Once you Download Ubuntu 13.10 you can Install it in 2 ways :
    1) Installing has primary OS
    2) Installing Inside the Windows ( Using VM or VB)
    3) Dual booting Linux alongside Windows. ( Using different Partitions )


    Here I will explain how to Install Linux inside Windows. You can use VirtualBox (Free) or VM Workstation/Player (Paid) Softwares. In this guide I will take example of Virtual Box.

    Pre-requirements

    1) Windows 7 64 bit
    2) Download Virtual Box.
    3) Install the VirtualBox
    4) See that JDK is installed before installing VirtualBox
    5) Ubuntu 13.10 ISO file ( Download it)

    Installing Ubuntu 13.10 In VirtualBox
    I will be using 2 words.
    Guest : Operating System in Virtual Box 64 bit
    Host : Windows 7 .


    Note : Since we need to Install Ubuntu 64bit version Intel VT-x should be enabled else you will not be able to install 64bit. Your processor should support that feature.
    Enabling VT-x.
    1) ShutDown PC.
    2) Boot into SetUp Menu (Bios Settings)
    3) Go to Advanced --> Advanced Processor Options --> Intel(R) Virtualization Technology.
    4) Enable it.
    5) Save the settings.
    6) Reboot

    Installation of Ubuntu 13.10 64bit


    1) Open VirtualBox.

    2) Click on New button



    M3QKn8t.png


    ·3) [FONT=&quot]Type the Name you want to give to this OS which will displayed everytime you open VirtualBox.

    qw7keQx.png


    b6ACrTD.png


    [/FONT] 4) Now you have to set the amount of RAM you want to allocate for your Guest OS. Now this is tricky and Dangerous part. Hey don’t worry !! Its simple :D I will explain this with a simple Example : Think that your PC has 10GB of RAM installed and you have Windows 7 64bit OS (Which u need off course :p ) Now out of 10GB of RAM 4Gb will be needed for your Host to work smoothly. The remaining 6GB can be allotted to work for Virtual Box Guest OS. Now you may have a question in your mind why so much RAM is needed while VB can run in 1 GB too?
    The Answer for this simple that has the RAM for Guest Increases your ROM compiling/building speed too increases drastically. That is the reason RAM is needed a bit more here.
    Now In VirtualBox you can see that green dotted line ending with red dotted line showing how much RAM you are allocating NEVER EVER CROSS GREEN LINE TO RED DOING SO CAN CRASH YOUR PC HAS IT IS THE SAME LIMIT FOR THE WINDOWS TO WORK. SO CAREFULL. It is the Max Amount of Ram you can allocate to VB. But always keep pointer 2 dotes below the RED to Be on safer side. After setting click Next.

    FRx9MXi.png


    5) Now here you have to create virtual drive for you Linux OS and its Files. It’s same has Hard Disk for your Windows PC.Were Linux is installed and RUN.Now click on Create New Virtual Hard Drive Now and click Create button.
    · You will get various formats of Virtual Drives. Always select VMDK Since it is supported by other Softwares like VM Workstation (Paid) . Click Next.


    ED0PEO1.png


    jLe0HkX.png


    · 6) Now you will get a option to select Dynamically Allocated or Fixed Size. Select Dynamically Allocated and don’t tick Split into files option has it will mess everything.


    EtrNQrT.png


    7) Enter the Amount of HDD Space you want to allocate to Virtual Hard Disk. Remember the same amount of space should be there in our Physical hard disk of PC too. (Example : If you select 200GB than your physical drive should have atleast 220GB free storage) . Minimum storage for Virtual Drive for the Android Building is 100GB but I recommend you to keep above 150GB. You will come to know why later. Select the folder/drive in your physical drive were you want to store Virtual hard drive (VMDK) in your physical hard disk of PC.

    YJci8mw.png


    Q183qwt.png


    8) Now click on Settings and Go To System a Processor Now in Processor Drag the Pointer to End of green line That it specifies the no of Cores you want to allocate to Guest OS. It doesn’t effect to host…:D:D In my case its 2.:eek:

    RIODIn7.png


    ·9) Now go to Acceleration tab next to Processor Tab and Tick Both.


    KAbCX0n.png



    10) Now go to the Settings à Storage à Click on Controller: IDE à next to Click on small CD with + icon mark.

    d9Yddtw.png


    · 11) Navigate to Ubuntu 13.10 64 Bit ISO and select it.


    5thCPCd.png


    S4bxR0b.png




    12) Now go to settings --> System --> boot order --> change it CD/DVD First. ( Or you can directly start the system and press F12 select CD/DVD either will work fine)

    SZldi0e.png


    13) Now Click Start Button to start VirtualBox Guest .
    14) Once Ubuntu Starts you can see following screen with 2 option here you can either test or Install just click Install button to start Installation Process.


    AFgMcaI.png


    · 15)Here It will show what things Ubuntu Requires is available or not and some updates and third party installs if you want you can select ( I never selected it) click continue Here It will show what things Ubuntu Requires is available or not and some updates and third party installs if you want you can select.

    85WlRAQ.png


    16) Here it will show how you want to install the Ubuntu let it be default has shown below since this is under VirtualBox. ( In Windows Dual Boot Different Procedure will be there which will be discussed in next part

    7gaHrqW.png


    17) Select Time Zone , keyboard layout .
    18) Enter the details required.


    VkZavut.png


    ufrVr8I.png



    19) Enter the details required.


    ynfGFTB.png


    20) It will ask to log in to Ubuntu one with Email Id just skip it and continue

    UCnqdks.png



    20) Installation Begins wait until it completes

    msCeMV7.png


    Hurrrray your Linux System is Ready


    271
    Setting Up Build Enviroment For Compiling ROM's

    Installation of Necessary Tools and packages for ROM Development

    1)Installing Java Development Kit (JDK)

    For Kitkat

    Installation of Java V6

    Open The Terminal and Paste following Command

    a) This will Remove the wrong Java JDK from Ubuntu 13.10
    Code:
    [COLOR=#000000]sudo apt-get purge openjdk-\* icedtea-\* icedtea6[COLOR=#007700][COLOR=black]-\*[/COLOR] [/COLOR][/COLOR]


    b) Enter the Following Command and This will Install JDK

    Code:
    wget https://launchpad.net/~webupd8team/+archive/ubuntu/java/+files/oracle-java6-installer_6u45-0%7Ewebupd8%7E8_all.deb sudo dpkg -i oracle-java6-installer_6u45-0~webupd8~8_all.deb wget https://launchpad.net/~webupd8team/+archive/ubuntu/java/+files/oracle-java6-set-default_6u45-0%7Ewebupd8%7E8_all.deb sudo dpkg -i oracle-java6-set-default_6u45-0~webupd8~8_all.deb

    c) Check The Java Version Installed
    Code:
    [COLOR=#000000]java -[COLOR=#0000BB][COLOR=black]version [/COLOR] [/COLOR][/COLOR]

    For Lollipop Required Java Version is 7

    To Install Java V7


    Code:
     sudo apt-get update && sudo apt-get install openjdk-7-jdk

    :DJava Installation Completes:D

    2)
    Installation Of Required Tools
    Enter The Following Command
    Code:
    sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python
    Note : If you get error like broken dependencies then use the following command and then use above command.:D

    Code:
    sudo apt-get update
    Code:
    sudo apt-get upgrade
    After Installation Completes Enter The Following Command
    Code:
    sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
    So The Above Are The Packages

    Now comes the binary called Repo.


    What Is Repo?:rolleyes:

    Repo is a repository management tool that we built on top of Git. Repo unifies the many Git repositories when necessary, does the uploads to our revision control system and automates parts of the Android development workflow.

    Enter The Following Command
    Code:
    mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
    Using Text Editor Open ~/.bashrc for that use following command
    Code:
    sudo nano ~/.bashrc
    At The Very Bottom Line Add following Line
    Code:
    export PATH=~/bin:$PATH
    Save it. Here To save Press Ctrl+O and Enter and Ctrl+X to exit:)
    Now Enter Following Command
    Code:
    source ~/.bashrc

    :cool::cool:Now Your System Is Ready For ROM Building:D:D
    236
    Downloading Sources

    To build a Rom from Source first we need to download the sources from git.
    Note : Sources will be very huge approx 13GB to 14GB hence lot of patience is required since it will take some time depending on your Internet connection speed.

    So lets start..

    Here i will take the example of cm11.
    The steps goes has follows

    1) Create a directory were your sources will be downloaded. Enter the following command to terminal to create a directory

    Code:
    mkdir cm11
    Now in your Home directory you will see folder called cm11.

    1zEeVvZ.png


    2) The next step is you have to Initiate the repo. meaning of the repo is given above. It will communicate with the git and download the source were it is stored.
    Enter The Following Command to Terminal
    Code:
    cd cm11
    This will take you to the directory you created in Step 1.

    8zCZANO.png

    Now Enter The Following Command Which Will Initiate The Repo :laugh:
    Code:
    [FONT=Arial][SIZE=4]repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0[/SIZE][/FONT]


    AH3P62H.png


    MesK53W.png

    Since i m taking example of cm11 above repo initiate command is used you can find this here for CM11
    Note : All the details for Repo Initiate and Building will be given in respective Source Github. Various Github source links will be given in discription and the end.

    This will initialize your local repository using the CyanogenMod trees.:p:D:D
    now got to cm11 folder and press Ctrl+H this will show the hidden folder .repo were sources will be downloaded.

    WSkXUQr.png


    Buqbjst.png

    Now it might give a small error at the end stating for Email id.
    So just create a github account here
    Then Run following in Terminal
    Code:
    [FONT=Arial][SIZE=4]git config --global user.email "[email protected]"
    git config --global user.name "Your Name"[/SIZE][/FONT]


    replace
    "[email protected]" with your github email Id
    replace
    "Your Name" with github Username

    3) Now To control the files that should be downloaded while sync and for adding device tree we use local_manifest.xml. Reagrding this @Kishan14 will explain in detail with Tips and Tricks.

    4) Now it is the time to download the sources. for that run the following Command

    Code:
    repo sync -j#

    #
    is number of jobs you want to give for your downloading source. I use 2 to 4.

    hEbrLC4.png


    dE5oydZ.png

    Now it will download the Sources needed to build the Rom..Download will be huge 13GB to 14GB so be patient since it depends on your Internet Speed.

    The Above was for CM11 same procedure for other provided you have to replace cm11 with one you want to sync/build like AOSP,AOKP,AICP etc and Repo Initialize command varies with the source you want to download.

    Some Git Links :

    CM11 : https://github.com/CyanogenMod/android
    AOKP : https://github.com/AOKP/platform_manifest
    Carbon Rom : https://github.com/CarbonDev/android
    SlimRom : https://github.com/SlimRoms/platform_manifest
    181
    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
    Code:
    cd cm11/.repo
    Y6KmJsy.png

    Here in .repo folder you have to create file called local_manifests.xml
    1) Enter The Following Command in Terminal
    Code:
    nano local_manifest.xml
    mOFUkXi.png

    Structure of Local_manifest.xml is Has follows.
    Code:
    [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
    gHq689W.png


    Taking my Ex here of GT-I9082
    After Adding device tree , Vendor , kernel my Local_manifest.xml will look like has follows
    Code:
    [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]
    ABoaVKn.png

    3) Press ctrl+O and Enter
    DpbtNWp.png


    ZNqRufc.png

    4) Press Ctrl+X to exit.
    Sx5Onvn.png

    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 @Kishan14 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 @rutvikrvr 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
    Code:
    cd cm11
    Just Replace CM11 by your working directory of Rom . Ex : AOGP,AICP etc
    2)Now enter following Command To Terminal
    Code:
    [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
    Code:
    [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 @rutvikrvr 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:
    139
    Uploading Device Tree To Github

    So Guys till now we learnt lot of stuffs and finally we build a Rom :highfive: During building the Rom we may have edited lot of stuffs in device tree :D:D To avoid those being repeated in case you delete the Tree or If your ROM is Unofficial then you have to upload the Device Source Tree to Github. There are lot of uses if you upload the device tree.

    Lets Start with guide Now :D:D

    1) Create a account in Github.

    2) Generate a new SSH key
    Enter Following command to Terminal
    Code:
    ssh-keygen -t rsa -C "[email protected]"
    "[email protected]" = your github Email ID

    After pressing Enter you will Observe the following output
    Code:
    # Creates a new ssh key, using the provided email as a label
    # Generating public/private rsa key pair.
    # Enter file in which to save the key (/home/you/.ssh/id_rsa):
    Press Enter.

    Now you need to enter the passphrase
    Code:
    # Enter passphrase (empty for no passphrase): [Type a passphrase] # Enter same passphrase again: [Type passphrase again]
    Once all done you will see the following in your Terminal.

    Code:
    Your identification has been saved in /home/you/.ssh/id_rsa.
    # Your public key has been saved in /home/you/.ssh/id_rsa.pub.
    # The key fingerprint is:
    # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db [email protected]
    Now go to ~/.ssh folder and copy your id_rsa.pub content into account administration on github.com.
    That is go to github account settings and SSH
    copy paste id_rsa.pub content there and save it done.:D:cowboy:

    Now Its Time To Check If Everything Works.:highfive:


    • Enter The Following Command To Terminal
      Code:
    • It should display has follows
      Code:
      The authenticity of host 'github.com (207.97.227.239)' can't be established.
      # RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
      # Are you sure you want to continue connecting (yes/no)?
    • type yes and press enter
      Code:
      Hi username! You've successfully authenticated, but GitHub does not
      # provide shell access.
    Now All Done Its Time To Upload The Device Tree To Github :cowboy:

    Example Device and Rom : GT-I9082 and AOGP Rom.
    In the following steps i take my example device and Rom just replace the device with your device and Rom with your Rom:cool:

    Steps :


    • In Terminal
      Code:
      cd aogp/device/samsung/i9082
    IYwxiGJ.png


    MywR13m.png


    • Then Type Following
      Code:
      git init
    VX7TpL2.png


    ovdAnqa.png


    • Setting up of the git files required to push the files to the github account will be done by following command
      Code:
      git add .
    QA1GZTL.png

    • Now we need to comment on the files we are pushing to github hence enter following command
      Code:
       git commit -m "first commit"
    m6TUgMc.png

    • Now Go to your Github account click on add button on top next to your username and Select New repository
    o9hykDa.png

    • enter the Name of your repository in my case you can see the ScreenShot below
    MJrg5oy.png

    • now you can see some commands displayed enter the git link displayed in your repository created the terminal in my case
      Code:
      git remote add origin https://github.com/username/aogp_device_samsung_i9082.git
    q7GtUIv.png


    1mHEHlS.png


    • Last Step is To Push The Source to Github. Enter The Following Command in Terminal
      Code:
      git push origin master
    lxMlsq0.png


    The Passphrase is the same you entered while creating SSH key.

    06SbxM4.png


    • Finally your source is in Github now add Readme.md File and mention This is <ROM NAME> Device Tree For <Your Device>
    :D:cool:You Have Successfully Uploaded your Device Tree To Github :cowboy::cowboy:

    Credits
    @rutvikrvr
    @Kishan14
    @k2wl (My Mentor and Inspiration for Android)


    If You want to learn more about Github and Stuffs you can visit Following Guide by XDA Senior Moderator @eagleeyetom (Thanks a lot Sir)

    Guide Link : http://forum.xda-developers.com/showthread.php?t=1877040