[GUIDE] How to build crDroid 4.4 KitKat Rom

Search This thread

elia222

Senior Member
Feb 17, 2012
1,155
2,627
Samsung Galaxy S23
Since I sold my Galaxy Nexus and I won't continue to build crDroid rom for it, I made this step by step guide to build 4.4 KitKat crDroid rom running on this device from Cristiano Matos and cm's github.

This guide is meant for Ubuntu 13.10 64 bit. 32 Bit won't work.
If you want to use another ubuntu version, some things might be a little different. Just search on xda and you will find all the instructions that you need to complete the setup.

DISCLAMER
Although the procedures in this guide were tested on my pc/phone and produced a working build for my Galaxy Nexus, I take no responsibility for any consequences derived from their use.


1) SET UP THE BUILD ENVIRONMENT

Remove openJDK and install Java 6 jdk. Open a terminal and type:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
This will uninstall openJDK.

Code:
sudo add-apt-repository ppa:webupd8team/java
Adds a PPA to your system, needed to download java.

Code:
sudo apt-get update && sudo apt-get install oracle-java6-installer
Download and installs java!

To make sure the correct version of Java is activated, run the following at the Terminal prompt:
Code:
java -version
You should see something like that:

java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

Now type:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python lzop
This will install the needed packages.

When done, do this:
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so


Now, install the repo binary:
Code:
mkdir ~/bin && curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo && chmod a+x ~/bin/repo

Edit .bashrc:
Code:
sudo nano ~/.bashrc
At the bottom of the file, add the following line:
Code:
export PATH=~/bin:$PATH
Save it (In nano type Ctrl-O and then Enter, then Ctrl-X to exit back to a prompt).
Restart bash:
Code:
source ~/.bashrc

2) DOWNLOAD THE SOURCES:

Code:
mkdir ~/cyanogenmod
cd ~/cyanogenmod
This creates a folder named "cyanogenmod" and opens it.

Initialize the repo:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0

Open cyanogenmod folder, press ctrl+H to show hidden files, open .repo, open local_manifests and edit roomservice.xml (If it isn't present create it) to be like this one:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote fetch="http://github.com/" name="gh" revision="master" />
  <remote fetch="https://github.com/TheMuppets/" name="TheMuppets" revision="cm-11.0" />
  <project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="gh" revision="cm-11.0" />
  <project name="TheMuppets/proprietary_vendor_imgtec" path="vendor/imgtec" remote="gh" revision="cm-11.0" />
  <project name="TheMuppets/proprietary_vendor_broadcom" path="vendor/broadcom" remote="gh" revision="cm-11.0" />
  <project name="TheMuppets/proprietary_vendor_invensense" path="vendor/invensense" remote="gh" revision="cm-11.0" />
  <project name="TheMuppets/proprietary_vendor_widevine" path="vendor/widevine" remote="gh" revision="cm-11.0" />
  <project name="TheMuppets/proprietary_vendor_nxp" path="vendor/nxp" remote="gh" revision="cm-11.0" />
  <project name="CyanogenMod/android_device_samsung_maguro" path="device/samsung/maguro" remote="github" revision="cm-11.0" />
  <project name="CyanogenMod/android_device_samsung_toroplus" path="device/samsung/toroplus" remote="github" revision="cm-11.0" />
  <project name="CyanogenMod/android_device_samsung_toro" path="device/samsung/toro" remote="github" revision="cm-11.0" />
  <project name="CyanogenMod/android_kernel_samsung_tuna" path="kernel/samsung/tuna" remote="github" revision="cm-11.0" />
  <project name="CyanogenMod/android_device_samsung_tuna" path="device/samsung/tuna" remote="github" revision="cm-11.0" />
  <remove-project name="CyanogenMod/android_packages_apps_Dialer" />
  <project name="cristianomatos/android_packages_apps_Dialer" path="packages/apps/Dialer" remote="github" revision="cm-11" />
  <remove-project name="CyanogenMod/android_packages_apps_InCallUI" />
  <project name="cristianomatos/android_packages_apps_InCallUI" path="packages/apps/InCallUI" remote="github" revision="cm-11" />
  <remove-project name="CyanogenMod/android_packages_services_Telephony" />
  <project name="cristianomatos/android_packages_services_Telephony" path="packages/services/Telephony" remote="github" revision="cm-11" />
  <remove-project name="CyanogenMod/android_frameworks_base" />
  <project name="cristianomatos/android_frameworks_base" path="frameworks/base" remote="github" revision="cm-11" />
  <remove-project name="CyanogenMod/android_packages_apps_Settings" />
  <project name="cristianomatos/android_packages_apps_Settings" path="packages/apps/Settings" remote="github" revision="cm-11" />
</manifest>

Download time!
Code:
repo sync
It will download about 10gb of data, so be patient!

Download the prebuilts:
Code:
~/cyanogenmod/vendor/cm/get-prebuilts


3) BUILD THE ROM:

Code:
. build/envsetup.sh && brunch name_of_device
Where "name_of_device" is maguro, toro or toroplus, depending for which ersion you want to build.
It will take some time (on my pc with 3GHz dual core and 4gb of ram about 2h30min)

If everything goes right the flashable zip of the rom will be in cyanogenmod/out/target/product/name_of_device/cm-11-XXXXXXXXX-UNOFFICIAL-name_of_device.zip :D

4) Install the rom on your phone!
-------------------------------------------------------------------------------------------------------------

Some other tips:

When you want to download latest crdroid/cm changes open a new terminal and type:
Code:
cd cyanogenmod
repo sync

When you want to delete the build products (because something has gone wrong or you want to make a new build):
Code:
make clean
Then:
Code:
. build/envsetup.sh && brunch name_of_device
To start building again.
 
V

voidz777

Guest
Thanks for this useful tutorial.
I can make other unofficial builds in your favor.
 

linezero

Senior Member
Sep 3, 2010
821
146
Male'
@elia222 any idea why I get this when I do a repo sync:

Code:
Fetching project platform/external/scrypt
Fetching project CyanogenMod/android_external_elfutils
Fetching project CyanogenMod/android_external_svox
Fetching projects:  66% (307/465)  Fetching project CyanogenMod/android_external_grub
Fetching project platform/external/sfntly
error: Cannot fetch cristianomatos/android_frameworks_base
Fetching project platform/prebuilts/runtime
error: Cannot fetch cristianomatos/android_packages_apps_Settings

error: Exited sync due to fetch errors
 
Last edited:

elia222

Senior Member
Feb 17, 2012
1,155
2,627
Samsung Galaxy S23
@elia222 any idea why I get this when I do a repo sync:

Code:
Fetching project platform/external/scrypt
Fetching project CyanogenMod/android_external_elfutils
Fetching project CyanogenMod/android_external_svox
Fetching projects:  66% (307/465)  Fetching project CyanogenMod/android_external_grub
Fetching project platform/external/sfntly
error: Cannot fetch cristianomatos/android_frameworks_base
Fetching project platform/prebuilts/runtime
error: Cannot fetch cristianomatos/android_packages_apps_Settings

error: Exited sync due to fetch errors

Probably Cristiano Matos has changed/removed something on his github repositories. I didn't followed the project recently, so your best bet would be to contact him to solve the issue.
 

masruri3

Member
Feb 11, 2013
7
0
Gresik
Could i just download resource for specify device only ?
Not download reaource for all device

Is this guide also work on non nexus device ?
 

smartAgent47

Senior Member
Jan 1, 2013
550
552
Mumbai
It depends from which rom are you building. You will see from build errors what needs to be edited

I am building PA 5.0 and currently my device is running slimkat.
So if i flash PA 4.4 and extract the proprietary blobs from device or download the kitkat maguro device trees via local manifest so will it give me build errors ?? and okay ill know by the build errors what changes should i make ....
Thnk You
 

elia222

Senior Member
Feb 17, 2012
1,155
2,627
Samsung Galaxy S23
I am building PA 5.0 and currently my device is running slimkat.
So if i flash PA 4.4 and extract the proprietary blobs from device or download the kitkat maguro device trees via local manifest so will it give me build errors ?? and okay ill know by the build errors what changes should i make ....
Thnk You
I haven't followed maguro since a long time. There aren't 5.0 blobs available?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Since I sold my Galaxy Nexus and I won't continue to build crDroid rom for it, I made this step by step guide to build 4.4 KitKat crDroid rom running on this device from Cristiano Matos and cm's github.

    This guide is meant for Ubuntu 13.10 64 bit. 32 Bit won't work.
    If you want to use another ubuntu version, some things might be a little different. Just search on xda and you will find all the instructions that you need to complete the setup.

    DISCLAMER
    Although the procedures in this guide were tested on my pc/phone and produced a working build for my Galaxy Nexus, I take no responsibility for any consequences derived from their use.


    1) SET UP THE BUILD ENVIRONMENT

    Remove openJDK and install Java 6 jdk. Open a terminal and type:
    Code:
    sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
    This will uninstall openJDK.

    Code:
    sudo add-apt-repository ppa:webupd8team/java
    Adds a PPA to your system, needed to download java.

    Code:
    sudo apt-get update && sudo apt-get install oracle-java6-installer
    Download and installs java!

    To make sure the correct version of Java is activated, run the following at the Terminal prompt:
    Code:
    java -version
    You should see something like that:

    java version "1.6.0_45"
    Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

    Now type:
    Code:
    sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python lzop
    This will install the needed packages.

    When done, do this:
    Code:
    sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so


    Now, install the repo binary:
    Code:
    mkdir ~/bin && curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo && chmod a+x ~/bin/repo

    Edit .bashrc:
    Code:
    sudo nano ~/.bashrc
    At the bottom of the file, add the following line:
    Code:
    export PATH=~/bin:$PATH
    Save it (In nano type Ctrl-O and then Enter, then Ctrl-X to exit back to a prompt).
    Restart bash:
    Code:
    source ~/.bashrc

    2) DOWNLOAD THE SOURCES:

    Code:
    mkdir ~/cyanogenmod
    cd ~/cyanogenmod
    This creates a folder named "cyanogenmod" and opens it.

    Initialize the repo:
    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0

    Open cyanogenmod folder, press ctrl+H to show hidden files, open .repo, open local_manifests and edit roomservice.xml (If it isn't present create it) to be like this one:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
      <remote fetch="http://github.com/" name="gh" revision="master" />
      <remote fetch="https://github.com/TheMuppets/" name="TheMuppets" revision="cm-11.0" />
      <project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="gh" revision="cm-11.0" />
      <project name="TheMuppets/proprietary_vendor_imgtec" path="vendor/imgtec" remote="gh" revision="cm-11.0" />
      <project name="TheMuppets/proprietary_vendor_broadcom" path="vendor/broadcom" remote="gh" revision="cm-11.0" />
      <project name="TheMuppets/proprietary_vendor_invensense" path="vendor/invensense" remote="gh" revision="cm-11.0" />
      <project name="TheMuppets/proprietary_vendor_widevine" path="vendor/widevine" remote="gh" revision="cm-11.0" />
      <project name="TheMuppets/proprietary_vendor_nxp" path="vendor/nxp" remote="gh" revision="cm-11.0" />
      <project name="CyanogenMod/android_device_samsung_maguro" path="device/samsung/maguro" remote="github" revision="cm-11.0" />
      <project name="CyanogenMod/android_device_samsung_toroplus" path="device/samsung/toroplus" remote="github" revision="cm-11.0" />
      <project name="CyanogenMod/android_device_samsung_toro" path="device/samsung/toro" remote="github" revision="cm-11.0" />
      <project name="CyanogenMod/android_kernel_samsung_tuna" path="kernel/samsung/tuna" remote="github" revision="cm-11.0" />
      <project name="CyanogenMod/android_device_samsung_tuna" path="device/samsung/tuna" remote="github" revision="cm-11.0" />
      <remove-project name="CyanogenMod/android_packages_apps_Dialer" />
      <project name="cristianomatos/android_packages_apps_Dialer" path="packages/apps/Dialer" remote="github" revision="cm-11" />
      <remove-project name="CyanogenMod/android_packages_apps_InCallUI" />
      <project name="cristianomatos/android_packages_apps_InCallUI" path="packages/apps/InCallUI" remote="github" revision="cm-11" />
      <remove-project name="CyanogenMod/android_packages_services_Telephony" />
      <project name="cristianomatos/android_packages_services_Telephony" path="packages/services/Telephony" remote="github" revision="cm-11" />
      <remove-project name="CyanogenMod/android_frameworks_base" />
      <project name="cristianomatos/android_frameworks_base" path="frameworks/base" remote="github" revision="cm-11" />
      <remove-project name="CyanogenMod/android_packages_apps_Settings" />
      <project name="cristianomatos/android_packages_apps_Settings" path="packages/apps/Settings" remote="github" revision="cm-11" />
    </manifest>

    Download time!
    Code:
    repo sync
    It will download about 10gb of data, so be patient!

    Download the prebuilts:
    Code:
    ~/cyanogenmod/vendor/cm/get-prebuilts


    3) BUILD THE ROM:

    Code:
    . build/envsetup.sh && brunch name_of_device
    Where "name_of_device" is maguro, toro or toroplus, depending for which ersion you want to build.
    It will take some time (on my pc with 3GHz dual core and 4gb of ram about 2h30min)

    If everything goes right the flashable zip of the rom will be in cyanogenmod/out/target/product/name_of_device/cm-11-XXXXXXXXX-UNOFFICIAL-name_of_device.zip :D

    4) Install the rom on your phone!
    -------------------------------------------------------------------------------------------------------------

    Some other tips:

    When you want to download latest crdroid/cm changes open a new terminal and type:
    Code:
    cd cyanogenmod
    repo sync

    When you want to delete the build products (because something has gone wrong or you want to make a new build):
    Code:
    make clean
    Then:
    Code:
    . build/envsetup.sh && brunch name_of_device
    To start building again.