Donate
Dear Members,
If you would like to see our site and development grow, please consider a small donation to our efforts. More donations means more devices supported which means more ROMs! Any and all donations go towards the site, development and much more! Thank you for your contributions!
-BDH
=======================
=======================
Top posters
BDH (171) | ||||
jl90x (137) | ||||
johnthehillbilly (95) | ||||
usmcamgrimm (70) | ||||
Nosnhoj (54) | ||||
CharmPeddler (29) | ||||
lazer (23) | ||||
JaeKar99 (23) | ||||
BDAZZG1 (17) | ||||
tomsgt123 (11) |
Control Panel
Your profile |
Social |
Private messages |
Other |
Search
Statistics
We have 885 registered usersThe newest registered user is Madhatter75
Our users have posted a total of 711 messages in 116 subjects
[How-To] Build / Port ROMs using source code (Various Devices)
2 posters
[How-To] Build / Port ROMs using source code (Various Devices)
First of all, let me just say a huge thanks to DDX and pcarenza for walking me through all these steps and also another huge thanks to pcarenza for letting me use his repos for this. Also a HUGE thanks to dhacker and hashcode0f for doing pretty much all the hard work on this stuff, for everyone else to enjoy!
So as you all know, I have been working with pcarenza to get some more knowledge on how to port ROMs. While I'm doing this for the Galaxy S4, it can easily be done with other devices.
My learning is still a work in progress but I wanted to share what I have so far.
This guide will assume that you are already running Ubuntu, or already have a Virtual Machine setup. This is NOT a guide for how to do that.
First thing we want to do is to get you a build environment going. For that, you're going to open a terminal in Ubuntu and enter the following lines, pressing "Enter" after each command:
First, you're going to get rid of OpenJava, it will not build Android.
In Terminal again, enter this line, then press the "Enter" key:
Once that part is done, head over to [You must be registered and logged in to see this link.]
Now you're going to need to poke around the CM source on github and find the necessary device, vendor and kernel repos for your device. This can easily be done by searching their github for repos with your device codename in them. (Example the VZW Galaxy S4's codename is jfltevzw)
Remember this guide is following with porting ROMs to the Galaxy S4. Knowing this, the following repos are the ones I would need to take note of:
After noting all the repos you need, now it's time to sync some source! First thing you need to do is go to the github page of the ROM you want to build/port. Look for a repo they have which is usually named "platform_maniest." Some of them are named differently and can be "android," "android_build," or even just "build."
What you're looking for is a "README" file. This file will give you the proper "repo init" code to sync their source.
In the next chapter, we will pick up on syncing source and making manifest edits.
So as you all know, I have been working with pcarenza to get some more knowledge on how to port ROMs. While I'm doing this for the Galaxy S4, it can easily be done with other devices.
My learning is still a work in progress but I wanted to share what I have so far.
This guide will assume that you are already running Ubuntu, or already have a Virtual Machine setup. This is NOT a guide for how to do that.
First thing we want to do is to get you a build environment going. For that, you're going to open a terminal in Ubuntu and enter the following lines, pressing "Enter" after each command:
First, you're going to get rid of OpenJava, it will not build Android.
- Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
sudo aptitude remove '~Pjava-runtime' '~Pjava-compiler'
- Code:
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy main multiverse"
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse"
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
In Terminal again, enter this line, then press the "Enter" key:
- Code:
sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
- Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
- Code:
mkdir ~/bin
PATH=~/bin:$PATH
- Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
Once that part is done, head over to [You must be registered and logged in to see this link.]
Now you're going to need to poke around the CM source on github and find the necessary device, vendor and kernel repos for your device. This can easily be done by searching their github for repos with your device codename in them. (Example the VZW Galaxy S4's codename is jfltevzw)
Remember this guide is following with porting ROMs to the Galaxy S4. Knowing this, the following repos are the ones I would need to take note of:
- Code:
android_device_samsung_qcom-common
android_device_samsung_msm8960-common
android_device_samsung_jf-common
android_kernel_samsung_jf
android_hardware_samsung
After noting all the repos you need, now it's time to sync some source! First thing you need to do is go to the github page of the ROM you want to build/port. Look for a repo they have which is usually named "platform_maniest." Some of them are named differently and can be "android," "android_build," or even just "build."
What you're looking for is a "README" file. This file will give you the proper "repo init" code to sync their source.
In the next chapter, we will pick up on syncing source and making manifest edits.
Last edited by BDH on Sun Aug 18, 2013 10:10 am; edited 7 times in total
Re: [How-To] Build / Port ROMs using source code (Various Devices)
Ok so now you have the proper "repo init" line and you're about to sync their source. (Tip: Your build folder should be named similar to the source ROM you're trying to build. Example, my Carbon ROM build folder is named "carbon," in all lower case to save time on typing it).
***For the rest of this tutorial, we will base everything on Carbon. If you're not building Carbon, then just replace "carbon" with the name of the ROM you're building.***
So now you're going to go into your build folder by typing in this:
The line above will automatically sync the repo as well. If yours does not, wait until you see in the command prompt that "repo has been initialized in xxxxx/xxxxxx/xxxx."
After that type the following:
Once your repo is done syncing (you'll know when it's done). Now it's time to edit some files. In the next section we will discuss editing the manifest.xml
***For the rest of this tutorial, we will base everything on Carbon. If you're not building Carbon, then just replace "carbon" with the name of the ROM you're building.***
So now you're going to go into your build folder by typing in this:
- Code:
mkdir carbon
cd carbon
- Code:
repo init -u https://github.com/CarbonDev/android.git -b jb3 && repo sync -f
The line above will automatically sync the repo as well. If yours does not, wait until you see in the command prompt that "repo has been initialized in xxxxx/xxxxxx/xxxx."
After that type the following:
- Code:
repo sync
Once your repo is done syncing (you'll know when it's done). Now it's time to edit some files. In the next section we will discuss editing the manifest.xml
Last edited by BDH on Sat Sep 14, 2013 7:42 am; edited 2 times in total
Re: [How-To] Build / Port ROMs using source code (Various Devices)
Alright so you got all your source synced and you're ready to edit. What you're going to do now is go to your build folder and navigate to /.repo/manifests/default.xml
Open this file in a text editor or XML editor. This is where the fun begins.
With your default.xml open, you're going to input YOUR device repos into this manifest. How are you going to do that? Easy. For an easy explanation, go to this [You must be registered and logged in to see this link.] and skip to the section titled "Overriding the default Manifest: Local Manifest." The only part of this section you need is where it starts describing the syntax for making an XML file.
Ok so now that you've got your default.xml and all your repos for your device added. Go back to your command prompt and make sure you're in the root of the build folder by typing:
Still in your command prompt, type the following:
Now back in your command prompt again, type the following:
And that's it!!! Now you just wait for your build to complete!!
NOTE: If you got build errors and your build stopped. Google is your friend. Please do not post build errors here because I will not answer them. If I answered them, then there is no reason for you to learn anything.
Have fun and enjoy building some ROMs!!!!!
Open this file in a text editor or XML editor. This is where the fun begins.
With your default.xml open, you're going to input YOUR device repos into this manifest. How are you going to do that? Easy. For an easy explanation, go to this [You must be registered and logged in to see this link.] and skip to the section titled "Overriding the default Manifest: Local Manifest." The only part of this section you need is where it starts describing the syntax for making an XML file.
Ok so now that you've got your default.xml and all your repos for your device added. Go back to your command prompt and make sure you're in the root of the build folder by typing:
- Code:
cd ~/carbon
- Code:
repo sync
Still in your command prompt, type the following:
- Code:
. build/envsetup.sh
Now back in your command prompt again, type the following:
- Code:
lunch
- Code:
make -j4 bacon
And that's it!!! Now you just wait for your build to complete!!
NOTE: If you got build errors and your build stopped. Google is your friend. Please do not post build errors here because I will not answer them. If I answered them, then there is no reason for you to learn anything.
Have fun and enjoy building some ROMs!!!!!
Last edited by BDH on Sun Aug 18, 2013 8:52 am; edited 3 times in total
Re: [How-To] Build / Port ROMs using source code (Various Devices)
Thanks for the updated guide! Expect some good stuff soon!
usmcamgrimm- Admin
- Posts : 70
Join date : 2013-06-03
Age : 47
Location : Massillon, OH
Similar topics
» [How-To] Build your own CM10.1 from source!
» [ROM][PORT] Beanstalk 1.300
» Galaxy S4 ROMs *RULES*
» Droid 4 ROMs *RULES*
» Galaxy S3 ROMs *RULES*
» [ROM][PORT] Beanstalk 1.300
» Galaxy S4 ROMs *RULES*
» Droid 4 ROMs *RULES*
» Galaxy S3 ROMs *RULES*
Permissions in this forum:
You cannot reply to topics in this forum