How to Build Custom Cyanogenmod Rom



Build Custom Cyanogenmod Rom? So are you ready to take on Rom Development? That’s okay if you’re not, because I’ll help walk you through it. In this tutorial, I’m going to show you how to build your own Cyanogenmod Rom right from source. This sounds a lot more complicated than it actually is though. However, keep in mind that you will need a lot of patience when doing this. For this tutorial, I’m going to assume that you have Linux up and running and you’re familiar with basic Linux and Android operations.

Depending on your computer and internet speeds this could take anywhere from 5 hours (no less than that) to 5 days to complete. You’re going to be downloading over 15 GB in source code. In addition, your computer hardware will determine how fast your compiling process will take.  I have a Core i7 3770k along with 16GB of ram and it took 45min-1 hour. So just be aware that this isn’t a ten minute process. One final note, I compiled this tutorial with the help of several references found here, here and here; so if you don’t like the way I do things feel free to pull information from any of those other guides.

What You Will Need:

  • An already built CyanogenMod Zip for your device (Doesn’t matter if it’s a nightly or stable).
  • A Computer running Linux or OSX (Virtualbox is acceptable too).
  • At least 35GB of free space on your Hard Drive
  • Patience!

Step 1: Setting up Bashrc

Hit save once your done and close it.  Now in terminal type in

~/.bashrc

This will re-load your bashrc. (Rebooting would do the same thing, but that’s no fun).

Step 2: Preparing Your Build Environment

Step 3:Directories

Alright, time to make some directories. In your home folder, let’s create a directory called bin. That will hold the repo stuff.  For the actual source files let’s create a directory called CM10.2(You don’t have to call it cm10.2, you can name it to whatever you want, just note that I’m always going to refer to it as cm10.2 in this tutorial).  You can create these directories easily by typing the following in terminal:

 Step 4: Installing Repo

Step 5: Iniinitialize CM Source and Downloading the Source Code

Now it’s time to prepare the device specific code. In terminal type the following:

The device specific code will download.

Step 8: Extract Proprietary Blobs

Great! You’re almost done.  According to the CyanongenMod wiki we can also turn on cache building to speed up subsequent builds after this one.  Type in:

export USE_CCACHE=1

 Step 9: Starting the Build

Hopefully your build completed without errors. If you have any errors refer to here if you have any trouble. Now the last thing to do is grab your newly built cyanogenmod zip.  Simply go into the out/target/product/m7spr folder and you should see your cyanogenmod zip.  From here you can flash it in recovery on your phone.  Hope you enjoyed and have fun!