Jump to content


[How-To] Build CM10.1 for Galaxy S3 (VZW)


  • Please log in to reply
1 reply to this topic

#1 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 15 June 2013 - 03:09 AM

cid.png

 

 

So you own a S3, unlocked the bootloader, rooted, 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 Verizon Galaxy S3.

 

WHAT YOU WILL NEED

 

 

  • A Verizon Galaxy S3 (SCH-i535)
  • 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 d2vzw

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 S3 is connected to your computer via the USB cable and that you are in the ~/android/system/device/samsung/d2vzw directory (you can cd ~/android/system/device/samsung/d2vzw 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 d2vzw

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

 

~/android/system/out/target/product/d2vzw

 

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

cm-10-20120718-UNOFFICIAL-d2vzw.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!

 

 

 



#2 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 15 June 2013 - 03:34 AM

Your end result will be similar to this!

 

 

jzd755.png






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users