Jump to content


[How-To] Build CyanogenMod for XT912 (Droid RAZR CDMA)


  • Please log in to reply
14 replies to this topic

#1 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 24 June 2013 - 12:48 AM

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.

 

So you own a RAZR and now you want to get into development? Well you came to the right thread. This thread will walk you through step-by-step on how to build CM10.1 for your Motorola XT912.

 

WHAT YOU WILL NEED

 

 

  • A Verizon Droid RAZR (XT912)
  • A relatively recent computer (Linux, OS X, or Windows) w/a reasonable amount of RAM and storage. The less RAM you have, the longer the build will take. Using SSDs results in faster builds than traditional hard drives.
  • A micro USB cable
  • A decent Internet connection & reliable electricity   :)
  • Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with what a recovery image such as ClockworkMod is, for example. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.

NOTE:

You want to use a 64-bit version of Linux. According to Google, 32-bit Linux environment will only work if you are building older versions prior to Gingerbread (2.3.x)/CyanogenMod 7.

 

This guide will assume you're already running Ubuntu 12.04 either as your main OS, dual boot or with a virtual machine.

 

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

 

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

Next we're going to add the bin directory to your PATH:

export PATH=${PATH}:~/bin

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.

cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1

Next is a step that will take quite a while. We're going to sync the repo. This will download the source that you are about to compile:

repo sync

Next you're going to download all the prebuilt apps:

cd ~/android/system/vendor/cm

Then:

./get-prebuilts

After the source downloads, ensure you are in the root of the source code (cd ~/android/system) then enter:

source build/envsetup.sh
breakfast spyder

This will download the device specific configuration and kernel source for your device.

 

Next you need to extract the proprietary blobs

 

Now ensure that your RAZR is connected to your computer via the USB cable and that you are in the ~/android/system/device/motorola/spyder directory (you can cd ~/android/system/device/motorola/spyder if necessary). Then run the extract-files.sh script:

 ./extract-files.sh

You should see the proprietary files (aka “blobs”) get pulled from the device and moved to the right place in the vendor directory. If you see errors about adb being unable to pull the files, adb may not be in the path of execution. If this is the case, see the adb page for suggestions for dealing with "command not found" errors.

 

NOTE:

Your device should already be running the branch of CyanogenMod you wish to build your own version of for the extract-files.sh script to function properly. If you are savvy enough to pull the files yourself off the device by examining the script, you may do that as well without flashing CyanogenMod first.

 

Now we're going to start our build, we'll use the following commands to get it going:

cd ~/android/system

Then:

brunch spyder

Now we wait! When the build finishes "it will be obvious when it finishes," you can now navigate to

~/android/system/out/target/product/spyder

and find your zip file  :) It will look something like this:

cm-10-20120718-UNOFFICIAL-spyder.zip

Now get to flashing  :)

 

NOTE:

If your build does not boot, you will need to learn how to run a logcat and how to read it. Resources for that can be found HERE and HERE.

 

 

Grab the latest gapps package from Goo.im and see if your build boots and runs!

 

If you think I did a good job on this tutorial, please click the "like" button!!! If you have suggestions to add to this thread, please comment and let me know. Thank you for reading and I hope you learn something from this!


  • androidlearner, bfederspill, johnthehillbilly and 2 others like this

#2 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 24 June 2013 - 02:35 AM

Great write up sir :) just like your other one..... I'll be trying this one when I get home :)

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


#3 jl90

jl90

    \m/

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

Posted 24 June 2013 - 10:50 AM

Hey bdh I know I need android SDK but there are a bunch of options I am running Ubuntu 64bit do I need just the tool for 64bit Ubuntu or the "bundle" offered? Sorry if this is a dumb question just don't want to screw this up. P.s. I finished zoos make your own Apollo theme write up successfully! :) ( he gave me some extra help lol!) gonna do a couple more and move on to other apks. :)

Edit Grimm got me straightened out on this question! :)

#4 usmcamgrimm

usmcamgrimm

    Berserker

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

Posted 24 June 2013 - 10:51 AM

Going to make the switch to Mint and give this a go....hopefully with better results this time!

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


  • jl90 likes this

  Exodus-Sig%204.png


#5 ZKK007

ZKK007

    That Kiwi Guy

  • Developer
  • 1,687 posts
  • LocationDallas, TX, USA.
  • Current Device(s):XT912, XT907

Posted 25 June 2013 - 05:41 PM

I just wanted to add to this, when I was building CM10.1 source on Ubuntu 12.04LTS, the coding

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

removed some of my required driver files. Upon rebooting I would get a black screen. It took me awhile to figure out what was removed and to get it fixed again, but if anyone else gets this, then:

 

  • Reboot into Ubuntu recovery with networking abilities and log in.
  • Run the following code.
     
sudo apt-get update
sudo apt-get install linux-generic-lts-quantal xserver-xorg-lts-quantal
  • Wait for it to finish installing and reboot.

Hopefully that fixed it for you too! If you want to know the files that were removed, then let me know, but you probably don't want too :p


bWyLE9l.jpg

 

Donate? Click on signature :)


#6 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 25 June 2013 - 09:32 PM

I just wanted to add to this, when I was building CM10.1 source on Ubuntu 12.04LTS, the coding

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

removed some of my required driver files. Upon rebooting I would get a black screen. It took me awhile to figure out what was removed and to get it fixed again, but if anyone else gets this, then:

 

  • Reboot into Ubuntu recovery with networking abilities and log in.
  • Run the following code.
     
sudo apt-get update
sudo apt-get install linux-generic-lts-quantal xserver-xorg-lts-quantal
  • Wait for it to finish installing and reboot.

Hopefully that fixed it for you too! If you want to know the files that were removed, then let me know, but you probably don't want too :p

 

Those commands are straight from the CM website and I have never heard of them wiping any files. The command to "install" will not remove files.



#7 ZKK007

ZKK007

    That Kiwi Guy

  • Developer
  • 1,687 posts
  • LocationDallas, TX, USA.
  • Current Device(s):XT912, XT907

Posted 26 June 2013 - 03:23 AM

Those commands are straight from the CM website and I have never heard of them wiping any files. The command to "install" will not remove files.


I know it's straight from CM because I followed their page a few weeks ago. It could've been a combination of my hardware and Ubuntu, but I just wanted to mention it here just in case anyone had a similar case :)

Install can remove conflicting files if you OK it. I've installed packages that have resulted in gaining computer space :p Being a Ubuntu noob, I pressed enter when Java asked to install required packages. I'm sure it said something in there :p

But like I said, I just wanted to mention it just in case it happened to someone else :)
  • johnthehillbilly likes this

bWyLE9l.jpg

 

Donate? Click on signature :)


#8 usmcamgrimm

usmcamgrimm

    Berserker

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

Posted 28 June 2013 - 08:04 PM

So I got it built but it doesn't boot. I'm going to a dB log at tonight, but I'm wondering if it might be my phone...sometimes cm ROMs don't boot and I have to try a few times before I get one going.

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


  Exodus-Sig%204.png


#9 AscensionX

AscensionX

    Code Breaker

  • Developer
  • 363 posts
  • Current Device(s):Motorola Droid Razr Maxx, Droid Razr Maxx HD, Nexus 7, Samsung Galaxy SIII

Posted 28 June 2013 - 11:28 PM

Have you tried running logcat to see what the problem is?

Sent from my XT926 using Tapatalk 2



#10 usmcamgrimm

usmcamgrimm

    Berserker

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

Posted 29 June 2013 - 01:43 AM

I tried to, but wasn't able to get adb logcat to work while it booted to see why it wouldn't boot Tapatalking from the pits of hell with my Slaytanic Rage machine!

  Exodus-Sig%204.png


#11 ZKK007

ZKK007

    That Kiwi Guy

  • Developer
  • 1,687 posts
  • LocationDallas, TX, USA.
  • Current Device(s):XT912, XT907

Posted 29 June 2013 - 04:41 AM

I tried to, but wasn't able to get adb logcat to work while it booted to see why it wouldn't bootTapatalking from the pits of hell with my Slaytanic Rage machine!


Have you compared it to the prebuilt CM10.1 spyder download on their website? (I think its the same as the CM10.1 under the ROM section here) I found I was missing a few files and when I put them in, I got mine to boot.

bWyLE9l.jpg

 

Donate? Click on signature :)


#12 usmcamgrimm

usmcamgrimm

    Berserker

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

Posted 29 June 2013 - 09:33 AM

Have you compared it to the prebuilt CM10.1 spyder download on their website? (I think its the same as the CM10.1 under the ROM section here) I found I was missing a few files and when I put them in, I got mine to boot.

 

That might be it then.  I started comparing both and there are a bunch of files in the official build that aren't in mine.


  Exodus-Sig%204.png


#13 twister250

twister250

    Member

  • Members
  • PipPip
  • 50 posts

Posted 13 July 2013 - 01:35 PM

Trying to get this set up. Everything is good until I get to pulling proprietary files from phone. Extract-files.sh doesn't exit in spyder folder. If it just pulls files in device-proprietary-files.txt, I can do it manually. Just not sure exactly where they go. If someone has a extract-files.sh for spyder, that probably would be the best option. Ideas?



#14 StealthFox13

StealthFox13

    Gen. Member (Subject to change)

  • Members
  • PipPip
  • 125 posts
  • LocationMinnesota
  • Current Device(s):Droid Razr Maxx (Refurb), Galaxy Note 10.1

Posted 15 December 2013 - 05:48 PM

Is this up to date? cause I'm getting errors right off the bat. Now I am for the most part brand new to linux and ubuntu so if anyone would be willing to help me through this process, I'd really love to learn how to become a developer. Thanks all


Posted Image

#15 ZKK007

ZKK007

    That Kiwi Guy

  • Developer
  • 1,687 posts
  • LocationDallas, TX, USA.
  • Current Device(s):XT912, XT907

Posted 23 December 2013 - 05:32 PM

Is this up to date? cause I'm getting errors right off the bat. Now I am for the most part brand new to linux and ubuntu so if anyone would be willing to help me through this process, I'd really love to learn how to become a developer. Thanks all


Just saw this. For the most part this is correct, but I believe setting up java has changed slightly. Newer packages, etc. What issues are you having?

Sent from my XT907 using Tapatalk 4


bWyLE9l.jpg

 

Donate? Click on signature :)





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users