Jump to content


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


  • Please log in to reply
4 replies to this topic

#1 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 18 June 2013 - 09:37 PM

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 S4 (SCH-i545)
  • 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 cm
cd cm

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.

mkdir system
cd ~/cm/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 ~/cm/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 jfltevzw

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

Then:

brunch jfltevzw

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

~/cm/system/out/target/product/jfltevzw

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

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


  • T3T3droid, jayrod and zooyork0721 like this

#2 T3T3droid

T3T3droid

    D3v3lop3r/Th3m3r/Machin3

  • Developer
  • 1,115 posts
  • Google+:t3t3droid@gmail.com
  • LocationConnecticut
  • Current Device(s):Droid Bionic, Droid Razr M, SGS4

Posted 20 June 2013 - 06:26 AM

I may have to ask you about the java trick Lol good job man!
Posted Image
Sig by Bama
If you like our work please consider
Donating towards
Phones and Site costs :D Thanks!!

#3 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 20 June 2013 - 08:39 AM

I may have to ask you about the java trick Lol good job man!

 

Thanks man! I'm getting my S4 Saturday and would really like to see development for it take off here.

 

It's not really a trick I guess lol, just adding a 3rd party repo and installing from there. I know some people don't like messing with 3rd party installs so I just posted the method in there that most say works.



#4 T3T3droid

T3T3droid

    D3v3lop3r/Th3m3r/Machin3

  • Developer
  • 1,115 posts
  • Google+:t3t3droid@gmail.com
  • LocationConnecticut
  • Current Device(s):Droid Bionic, Droid Razr M, SGS4

Posted 20 June 2013 - 03:40 PM

It was a pita problem I was having and why I never ended up getting into source.... No one was able to fix the issue so if it works you'll be a miracle worker Lol
Posted Image
Sig by Bama
If you like our work please consider
Donating towards
Phones and Site costs :D Thanks!!

#5 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 20 June 2013 - 05:14 PM

It was a pita problem I was having and why I never ended up getting into source.... No one was able to fix the issue so if it works you'll be a miracle worker Lol


Oh this method is definitely fool proof. I'm ready to build for it right now but I have to wait till I get my S4 on Saturday to get the proprietary files.

Sent from my SCH-I535 using Tapatalk 4 Beta






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users