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 your own CM10.1 from source!
[How-To] Build your own CM10.1 from source!
First I want to thank DirtyDroidX for helping me out with all of this! It's greatly appreciated bro, you have no idea how much!
Thanks to Tucstwo for giving me the build commands and environment setup commands a while ago! This helped so much!
This is going to take a while to write up but wanted to let everyone that I'm going to post a how-to, that way maybe we can get more people into development. Thanks to Mattlgroff for the commands to purge OpenJava!
LET'S GET STARTED!!
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
That will get you Java6 installed, Java6 is needed to build for Gingerbread and higher. Next we're going to install the required packages.
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
Now that this section is all done, jump down to the next one as we start:
DOWNLOADING SOURCE
Last edited by BDH on Sun Aug 18, 2013 10:06 am; edited 2 times in total
Re: [How-To] Build your own CM10.1 from source!
DOWNLOADING SOURCE
Ok so here we are! You've gotten Java installed, you got your build environment all setup, now it's time to setup your directories and get to downloading source! First thing you're going to want to do is setup your working directory. For this we are going to enter these lines in Terminal:
Now we're going to download the repo tool and make sure it's executable:
Now you're going to make a directory for your repo to sync to. This is essentially your build folder and can be named whatever you want it to be. Just make sure you remember what you named it! For example, my build folder is named CM so my commands would look like this:
Now you're going to repo init, to bring down the latest version of the repo with all the bug fixes and such. You must specify a URL for the manifest, which specifies where the various repos included in the Android source will be placed within your building directory.
When prompted, configure Repo with your real name and real email address. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.
A successful initialization will end with a message stating that Repo is initialized in your building directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.
Now you'll need to click on the following link to download FILE
After downloading this file, you're going to copy it to /home/yourbuildfolder/.repo/local_manifests/
If you don't have a folder named "local_manifests" then make it.
Now you're going to enter this line of code:
The final command in this section is one of the most fun! Now we're going to sync the repo. This is going to take a long time (depending on your RAM and internet connection, took me about 5 hours). So after entering this command, go get something to eat, get a drink, go do something! If you sit and watch it, it will take forever lol. Enter this command into the Terminal:
That is it for now! Go do something outside while you wait! Next we're going to build our source ROMs in:
Ok so here we are! You've gotten Java installed, you got your build environment all setup, now it's time to setup your directories and get to downloading source! First thing you're going to want to do is setup your working directory. For this we are going to enter these lines in Terminal:
- Code:
mkdir ~/bin
PATH=~/bin:$PATH
Now we're going to download the repo tool and make sure it's executable:
- Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
Now you're going to make a directory for your repo to sync to. This is essentially your build folder and can be named whatever you want it to be. Just make sure you remember what you named it! For example, my build folder is named CM so my commands would look like this:
- Code:
mkdir whateveryouwant
cd whateveryounamedit
Now you're going to repo init, to bring down the latest version of the repo with all the bug fixes and such. You must specify a URL for the manifest, which specifies where the various repos included in the Android source will be placed within your building directory.
- Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
When prompted, configure Repo with your real name and real email address. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.
A successful initialization will end with a message stating that Repo is initialized in your building directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.
Now you'll need to click on the following link to download FILE
After downloading this file, you're going to copy it to /home/yourbuildfolder/.repo/local_manifests/
If you don't have a folder named "local_manifests" then make it.
Now you're going to enter this line of code:
- Code:
curl -L -o .repo/local_manifests/razrqcom.xml -O -L https://raw.github.com/razrqcom-dev-team/android_local_razrqcom/cm-10.1/razrqcom.xml
The final command in this section is one of the most fun! Now we're going to sync the repo. This is going to take a long time (depending on your RAM and internet connection, took me about 5 hours). So after entering this command, go get something to eat, get a drink, go do something! If you sit and watch it, it will take forever lol. Enter this command into the Terminal:
- Code:
repo sync
That is it for now! Go do something outside while you wait! Next we're going to build our source ROMs in:
BUILDING THE SYSTEM
Last edited by BDH on Fri Jun 07, 2013 9:00 am; edited 2 times in total
Re: [How-To] Build your own CM10.1 from source!
BUILDING THE SYSTEM
Ok. So we've got everything setup, the repo is synced and we're ready to build!! This is going to be time consuming, but fairly easy to do.
What we're going to do right now is initialize the build environment using the envsetup.sh script. For this, we're going to use this command:
- Code:
. build/envsetup.sh
Make sure that little period there at the beginning is there lol. That little period will save you a lot of headaches
So now that the build environment is initialized, we're going to see what all devices we can build for To do this, we're going to use the "lunch" command:
- Code:
lunch
This should show you about 110 different devices that you can now build for, from CyanogenMod source! All of these devices listed are the officially supported builds!
Now choose the device you want to build for, and get ready to build the ROM! For example, let's say you want to build pure AOSP (not CM) for the RAZR HD (XT926) for that you would use the following command:
- Code:
full_xt926-userdebug
Next you would enter the following command. This command is what actually builds the flashable zip file. With this command, the letter "x" represents the number of cores your machine has, plus 1.
- Code:
make -jx otapackage
THAT'S IT!!! Now just let the build go until it's finished! Once it's done, you'll have a flashable zip ready to be installed on your device!!
The next section will be an FAQ section that will be completed at a later date
NOW GO OUT THERE AND BUILD!!!!!!!
Last edited by BDH on Fri Jun 07, 2013 9:03 am; edited 1 time in total
Re: [How-To] Build your own CM10.1 from source!
FAQ
Q: How do I dual boot Ubuntu if I'm already on Windows 8/7/xp ?
A: Watch this video HERE it will take you step by step through the process.
Q: Why install Ubuntu 12.04 as opposed to newer version?
A: The 12.04 version is known as an LTS version which stands for Long Term Support. The LTS builds will continue to be supported for up to 5 years, other builds only 18 months.
Q: How long will all this take?
A: Depends on your internet connection and your RAM. I have 12GB of RAM and an 11mb/s internet connection and it takes me about 5 hours to sync the repo and 5 hours to build.
Q: When can I make my edits to this build?
A: If you know what you're looking for, you can either make your edits BEFORE you create the zip, or after.
More will be added to this as questions are asked and answered.
Q: How do I dual boot Ubuntu if I'm already on Windows 8/7/xp ?
A: Watch this video HERE it will take you step by step through the process.
Q: Why install Ubuntu 12.04 as opposed to newer version?
A: The 12.04 version is known as an LTS version which stands for Long Term Support. The LTS builds will continue to be supported for up to 5 years, other builds only 18 months.
Q: How long will all this take?
A: Depends on your internet connection and your RAM. I have 12GB of RAM and an 11mb/s internet connection and it takes me about 5 hours to sync the repo and 5 hours to build.
Q: When can I make my edits to this build?
A: If you know what you're looking for, you can either make your edits BEFORE you create the zip, or after.
More will be added to this as questions are asked and answered.
Similar topics
» [How-To] Build / Port ROMs using source code (Various Devices)
» [ROM][UNOFFICIAL][jfltevzw] CM10.1 Nightlies
» [ROM][UNOFFICIAL][jfltevzw] CM10.1 Nightlies
Permissions in this forum:
You cannot reply to topics in this forum