Jump to content


[How-To] Build your own CM10.1 from source!


  • Please log in to reply
39 replies to this topic

#1 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 27 May 2013 - 05:11 PM

cid.png

 

 

 

 

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.

 

 

sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
sudo aptitude remove '~Pjava-runtime' '~Pjava-compiler'

Now you're going to install SunJava6

 

 

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:

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

Now this line:

sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

If you run into issues with Java just let me know. There is a trick to getting it installed but that should work.

 

Now that this section is all done, jump down to the next one as we start:

 

DOWNLOADING SOURCE


Edited by BigDaddyHicks, 30 May 2013 - 01:38 AM.
edited thread title

  • usmcamgrimm, johnthehillbilly, livinginkaos and 4 others like this

#2 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 27 May 2013 - 05:11 PM

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:

mkdir ~/bin
PATH=~/bin:$PATH

Now we're going to download the repo tool and make sure it's executable:

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:

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.

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:

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:

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


  • johnthehillbilly likes this

#3 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 27 May 2013 - 05:11 PM

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:

. 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:

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:

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. 

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!!!!!!!


  • johnthehillbilly likes this

#4 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 27 May 2013 - 05:12 PM

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.


  • johnthehillbilly likes this

#5 timpohladthomas

timpohladthomas

    OSE DEVELOPER

  • Developer
  • 1,428 posts
  • Twitter:@timpohladthomas
  • Current Device(s):MOTO X

Posted 27 May 2013 - 05:15 PM

NICE!

Very well written... Thank you for this. I look forward to what will come from it. Bring it on devs and soon to be devs!
  • usmcamgrimm likes this

PDbEXCr.png

Thank Zoo/Owain for my Awesome Sig! If you want to support the Build Server that helps keep OSE going, Click HERE!


#6 Guest_DirtyDroidX_*

Guest_DirtyDroidX_*
  • Guests

Posted 27 May 2013 - 07:16 PM

Good work bro ! I was way to lazy to write this up. Now you will be pumping out new roms like a boss!

Sent from my SAMSUNG-SGH-I317 using Tapatalk 4 Beta

#7 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 27 May 2013 - 07:17 PM

Good work bro ! I was way to lazy to write this up. Now you will be pumping out new roms like a boss!

Sent from my SAMSUNG-SGH-I317 using Tapatalk 4 Beta

 

All thanks to you man!! I know it's probably been annoying helping me ALLLLLLLLLLLL day but thank you! lol



#8 usmcamgrimm

usmcamgrimm

    Berserker

  • Developer
  • 958 posts
  • Twitter:@usmcamgrimm
  • LocationMassillon, OH
  • Current Device(s):VZW G3

Posted 27 May 2013 - 08:24 PM

This is going to be fun...thanks Hicks!

Tapatalking from the pits of hell with my Slaytanic Rage machine!

  Exodus-Sig%204.png


#9 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 27 May 2013 - 09:35 PM

Very welcome man! Also so everyone knows, what this will build is everything from CyanogenMod, not some 3rd party! What does that mean? That means sync the repo and build for any device you want WITHOUT worrying about something saying something about it!


  • johnthehillbilly and timpohladthomas like this

#10 xlightwaverx

xlightwaverx

    CrackFlasher

  • Superuser
  • 409 posts
  • Twitter:xlightwaverx
  • LocationEast Coast
  • Current Device(s):XT912, Kindle Fire HD

Posted 28 May 2013 - 01:12 AM

Nice. We can never have enough of these.

X

GTalk/Email: xlightwaverx[@]gmail.com | Android Development | CrackFlasher Downloads
x4_logo.png.pagespeed.ic.voMTetxHpH.png


#11 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 28 May 2013 - 01:16 AM

Nice. We can never have enough of these.

X

 

This is the only one posted on how to sync with ALL of CM's source. It's also up-to-date and simpler. It's also the only one posted in the right section.


  • usmcamgrimm likes this

#12 livinginkaos

livinginkaos

    I don't know what I'm doing anymore.....

  • Administrator
  • 15,282 posts
  • Google+:Hangouts - livinginkaos@gmail.com
  • LocationOregon
  • Current Device(s):Samsung S8+ / Pixel XL 128gb / iPhone 7+ 256gb / iPad Pro 12.9" / Samsung Chromrbook Plus / Pixel C / Nexus 6p 128gb / Nexus 6 / Nexus 6 on Fi / Nexus 9 / Moto 360^2 / Nvidia Shield TV Pro / Nvidia Shield Tablet / HTC EVODesign on FreedomPop / Chromecast / Surface Pro 3 i7 / Samsung Tab Pro 12.2 / Lenovo Win8 Tab / Eee Slate / '13 Nexus 7

Posted 28 May 2013 - 03:29 AM

Truly awesome! The How To stuff is just icing on the cake here! Keep 'em coming! Love it !

b2wvCBn.png

Sig by livinginkaos
Samsung S8+ / Pixel XL 128gb / iPhone 7+ 256gb / iPad Pro 12.9" / Samsung Chromrbook Plus / Pixel C / Nexus 6p 128gb / Nexus 6 / Nexus 6 on Fi / Nexus 9 / Moto 360^2 / Nvidia Shield TV Pro / Nvidia Shield Tablet / HTC EVODesign on FreedomPop / Chromecast / Surface Pro 3 i7 / Samsung Tab Pro 12.2 / Lenovo Win8 Tab / Eee Slate / '13 Nexus 7


#13 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 28 May 2013 - 03:32 AM

Truly awesome! The How To stuff is just icing on the cake here! Keep 'em coming! Love it !

 

I figured instead of the same ol people pushing out ROMs, why not get some of these young whiper snappers started :)

 

Let them see what they can do with a little encouragement. I love being able to teach people how to do things so if this helps, then by all means have it!


  • jl90 likes this

#14 livinginkaos

livinginkaos

    I don't know what I'm doing anymore.....

  • Administrator
  • 15,282 posts
  • Google+:Hangouts - livinginkaos@gmail.com
  • LocationOregon
  • Current Device(s):Samsung S8+ / Pixel XL 128gb / iPhone 7+ 256gb / iPad Pro 12.9" / Samsung Chromrbook Plus / Pixel C / Nexus 6p 128gb / Nexus 6 / Nexus 6 on Fi / Nexus 9 / Moto 360^2 / Nvidia Shield TV Pro / Nvidia Shield Tablet / HTC EVODesign on FreedomPop / Chromecast / Surface Pro 3 i7 / Samsung Tab Pro 12.2 / Lenovo Win8 Tab / Eee Slate / '13 Nexus 7

Posted 28 May 2013 - 03:58 AM

Agreed! No better way to build a community then to build its resources. Also helps to provide a new perspective.
  • usmcamgrimm likes this

b2wvCBn.png

Sig by livinginkaos
Samsung S8+ / Pixel XL 128gb / iPhone 7+ 256gb / iPad Pro 12.9" / Samsung Chromrbook Plus / Pixel C / Nexus 6p 128gb / Nexus 6 / Nexus 6 on Fi / Nexus 9 / Moto 360^2 / Nvidia Shield TV Pro / Nvidia Shield Tablet / HTC EVODesign on FreedomPop / Chromecast / Surface Pro 3 i7 / Samsung Tab Pro 12.2 / Lenovo Win8 Tab / Eee Slate / '13 Nexus 7


#15 s.dubs

s.dubs

    Team Rage Developer

  • Developer
  • 83 posts
  • Twitter:@sdubs317
  • Locationcuse
  • Current Device(s):RAZR M

Posted 28 May 2013 - 04:35 AM

Thanks Hicks, great writeup man!

Help Support & Donate!

 


#16 jl90

jl90

    \m/

  • Developer
  • 1,642 posts
  • LocationPhoenix, Az.
  • Current Device(s):Nexus 6 64GB, RAZR HD Maxx

Posted 29 May 2013 - 08:14 PM

I'm doing this this weekend!!! Thanks bdh! Very very cool ;)

#17 johnthehillbilly

johnthehillbilly

    Gear jammin' S-Mod

  • Smod
  • 6,470 posts
  • Twitter:@johnhillbilly
  • Google+:http://goo.gl/ColUJ .. johnthehillbilly@gmail.com
  • LocationSomewhere between here, and there...
  • Current Device(s):unlocked RAZR HD (xt926)... RAZR (xt912)

Posted 29 May 2013 - 08:28 PM

So.... basically after you have the flashable zip..... before flashing that's when you can "rip it apart " and start editing, modifying, and making it "pretty" .... or is that done during the [5 hour] build and sync process?

tapadriving.....hillbilly style

Feeding my android addiction......... one phone at a time.....

jhf.png

If you are feeling generous and would like to buy me a drink.... coffee :)


#18 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 29 May 2013 - 08:33 PM

So.... basically after you have the flashable zip..... before flashing that's when you can "rip it apart " and start editing, modifying, and making it "pretty" .... or is that done during the [5 hour] build and sync process?

tapadriving.....hillbilly style


Either one sir. :)

Sent from my Raged Out HD using Tapatalk (VIP)

#19 johnthehillbilly

johnthehillbilly

    Gear jammin' S-Mod

  • Smod
  • 6,470 posts
  • Twitter:@johnhillbilly
  • Google+:http://goo.gl/ColUJ .. johnthehillbilly@gmail.com
  • LocationSomewhere between here, and there...
  • Current Device(s):unlocked RAZR HD (xt926)... RAZR (xt912)

Posted 29 May 2013 - 08:43 PM

So.... basically after you have the flashable zip..... before flashing that's when you can "rip it apart " and start editing, modifying, and making it "pretty" .... or is that done during the [5 hour] build and sync process?

tapadriving.....hillbilly style


Either one sir. :)

Sent from my Raged Out HD using Tapatalk (VIP)


Nice..... I will be at home this weekend so I do believe I will have to build me one..... or two. LOL .....
Based on your ram and connection speed it takes you 5 hours per..... hmmmm at home I have a quarter the RAM but triple the internet soooooo..... I will still assume 5 for mine as well :) thanx sir :) this is going to be fun

tapadriving.....hillbilly style

Feeding my android addiction......... one phone at a time.....

jhf.png

If you are feeling generous and would like to buy me a drink.... coffee :)


#20 jl90

jl90

    \m/

  • Developer
  • 1,642 posts
  • LocationPhoenix, Az.
  • Current Device(s):Nexus 6 64GB, RAZR HD Maxx

Posted 29 May 2013 - 08:59 PM

So bdh I hope I can pick your brain on this as I am "semi retarded" lol! Man I'm glad I found this thread!! :) thanks dude!!
  • timpohladthomas likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users