Odin Software

Odin

Odin is an official flasher for many Samsung devices, runs only on Windows.

To flash your phone with it you will need .pit file containing information about all partitions, you can find one online or download it from the device e.g using Heimdall.

Using Odin

For Samsung phones only. Only available on Windows. The Knox switch (if present) will trip.

  1. Get the root file ready.
  2. Download Odin (there are many different versions, which mainly differ in the names used).
  3. Launch the phone in Download mode: hold the Volume Down+Power+Home buttons together when the phone is off. Accept the disclaimer.
  4. Select the root file in the appropriate catetory in Odin (the file should tell you which one).
  5. Click Start. Make sure that the phone is detected (a yellow box like COM x should appear).
  6. The phone will restart and the phone should now be rooted. Look for a SuperSu app or similar to confirm the presence of a root.

Logs

1. Odin failed during rooting. The writing to the phone memory never started on a Galaxy S6. The USB plug was pulled off after waiting for a noticiable amount of time with no progress sign either on the phone or Odin. Rebooting the phone led to stock, as expected (as nothing actually happened). Here’s the log from Odin3 v3.09:

<ID:0/004> Added!! 
<ID:0/004> Removed!! 
<ID:0/012> Added!! 
<ID:0/012> Odin v.3 engine (ID:12).. 
<ID:0/012> File analysis.. 
<ID:0/012> SetupConnection.. 
<ID:0/012> Initialzation.. 
<ID:0/012> Get PIT for mapping.. 
<ID:0/012> Firmware update start.. 
<ID:0/012> SingleDownload. 
<ID:0/012> recovery.img 
<ID:0/012> NAND Write Start!!  
<ID:0/012> Complete(Write) operation failed. 
<OSM> All threads completed. (succeed 0 / failed 1) 
<ID:0/012> Removed!! 
<ID:0/004> Added!!

So I tried to change the USB port on the computer and then downloaded the latest version of Odin3. And it worked! What I’m not sure is which of the two (or both?) helped; but do keep it in mind if you do the same.

 

Content of this page is based on informations from wikibooks.org and postmarketos.org, under CC BY-SA 3.0 licence.

Sony Ericsson Xperia Play (CDMA) (zeusc)

Sony Ericsson Xperia Play (CDMA) ("zeusc") Cyanogenmod

Cyanogenmod ROM Sony Ericsson Xperia Play (CDMA) (zeusc)

Quick Info

Download CyanogenMod

It looks like we don’t have any roms for download for this device. 🙁

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the ics branch of CyanogenMod.

Notes

The Sony Ericsson Xperia Play (CDMA) (aka zeusc) is a touchscreen smartphone manufactured by Sony Ericsson. Official CyanogenMod support for the Sony Ericsson Xperia Play (CDMA) was added in CyanogenMod 7.2.

Special boot modes

  • Fastboot:
    1. Power down device
    2. Plug data cable into PC
    3. While holding down the Search button, plug the data cable into the device

    If successful, the LED will turn blue to indicate the device is in fastboot mode.

Source code

Device http://www.github.com/cyanogenmod/android_device_semc_zeusc
Kernel http://www.github.com/cyanogenmod/semc-kernel-msm7x30
Xperia Play (CDMA) Specifications
Codename: zeusc
Vendor: Sony Ericsson
Release date: 2011 May 1 (UK)
Type: phone (slider)
CDMA freq: CDMA 800 1900 MHz GPRS/EDGE
1xEV-DO 2000 MHz
Platform: Qualcomm MSM8255
CPU: 1 GHz single-core Qualcomm Snapdragon S2
GPU: Qualcomm Adreno 205
RAM: 512MB
Weight: 175 g (6.2 oz)
Dimensions: 119 mm (4.7 in) (h)
62 mm (2.44 in) (w)
16 mm (0.63 in) (d)
Screen size: 102 mm (4.0 in)
Resolution: 854×480 (FWVGA)
Screen type: TFT LED-LCD
Internal storage: 400MB
SD Card: up to 32GB
Bluetooth: Bluetooth 2.1+EDR w/A2DP
Wi-Fi: 802.11b/g/n
Main camera: 5.1 megapixel with LED flash
Secondary camera: 0.3 megapixel
Power: 1500 mAh internal rechargeable removable lithium-ion polymer battery
Peripherals: microUSB, A-GPS, DNLA, microHDMI, capacitive touchscreen, proximity & ambient light sensors, volume controls, 3-axis accelerometer, digital compass, touchpad, PSP-esq buttons
CM supported: 7, 9
Latest CM version: ics

How to Install CyanogenMod on the Sony Ericsson Xperia Play (CDMA) (zeusc)

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Important Notes

The Sony Ericsson Xperia Play (CDMA) (aka zeusc) is a touchscreen smartphone manufactured by Sony Ericsson. Official CyanogenMod support for the Sony Ericsson Xperia Play (CDMA) was added in CyanogenMod 7.2.

Unlock your Xperia Play (CDMA)

What does “unlocking” mean?

The first step in putting any custom operating system on your Xperia Play (CDMA) is to unlock the bootloader. A bootloader is the very first program that runs when you turn on your device. The bootloader initializes some hardware and then loads the kernel and ramdisk, and gets the boot process going. If the bootloader is in locked mode, it will ensure that only the stock operating system can run. Since you will be installing your own operating system (CyanogenMod), you need to turn this off.

To unlock your bootloader, you’ll first need a program on your computer called adb. One way to get adb is to download and install the Android SDK (Software Developer Kit) from Google. The SDK is used by app developers when they’re writing programs for Android, and who knows, you may want to write apps someday.

Install the Android SDK

Download the SDK, per the steps on Google’s web page. Then install it by following the specific instructions for your computer.

Obtaining the Bootloader Unlock Code

Note:

Unlocking the bootloader on a Sony device may automatically wipe internal storage; a backup of the sdcard is suggested. It will also irreversibly erase the DRM keys stored in the TA partition of some devices, which will result in the loss of certain proprietary features that may have been included. Check your specific device forum on XDA to learn more.

In order to unlock the bootloader on your Xperia Play (CDMA) you will need to obtain a code from Sony. The following process will help you acquire this code so that you can flash a custom recovery.

  1. Open the Phone application on the Xperia Play (CDMA) and enter *#06# to obtain the device’s IMEI, IDID or MEID. Save this for later use.
    • Optional: if you do not have a phone app, the IMEI, IDID or MEID can be found on the box or on the device in Settings -> About Device -> Status.
  2. Put the device into fastboot mode:
      1. Power down device
      2. Plug data cable into PC
      3. While holding down the Search button, plug the data cable into the device

      If successful, the LED will turn blue to indicate the device is in fastboot mode.

  3. Open a terminal on the PC and enter fastboot getvar version
    • If you receive the message <waiting for device> fastboot is not configured properly, please see fastboot for more details.
  4. Navigate a browser here
    • Select your device and click the ‘continue’ button at the bottom of the page.
    • Enter your email address, agree to the terms and select ‘Submit’
    • Click the link from your email, enter your IMEI, IDID or MEID and continue
    • The unlock code should now appear, write this down for the next step.
  5. In the PC’s terminal, enter the following command: fastboot oem unlock 0xKEY
    • KEY corresponds to the unlock code you were given.

The Xperia Play (CDMA)’s bootloader should now be unlocked.

Installing CyanogenMod on Sony Devices

  1. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  2. Extract boot.img from the zip to your computer, you will need this file for fastboot.
  3. Put the phone into fastboot mode:
    1. Power down device
    2. Plug data cable into PC
    3. While holding down the Search button, plug the data cable into the device

    If successful, the LED will turn blue to indicate the device is in fastboot mode.

  4. Open a terminal on the PC with admin rights, access your platform-tools directory of the Android SDK, and enter the following:
    • fastboot flash boot boot.img
    • fastboot reboot
    While the device reboots, press the Volume rockers a few times to load recovery.
Note: Make the selection below based on the recovery version you see on your screen. If you’re installing CyanogenMod 11, you will have CWM Recovery. If installing CyanogenMod 12.0 or newer, you will have CyanogenMod Recovery.
Click here to continue instructions using CyanogenMod Recovery
Note: Once the device boots into CyanogenMod Recovery, use the physical volume buttons to move up and down. The home button is used to confirm your selection. The recovery is also touch screen friendly, so you can swipe up or down to scroll and tap the item you wish to select.
  1. Optional (Recommended): Using adb you can create a backup on your PC of your apps and app data. Boot the device into android and open a command prompt (or terminal on Mac and Linux) and enter the following:
    • adb backup -apk -all -f backup20161224.ab
    When the backup is complete return to recovery mode.
  2. On the device, select wipe data/factory reset.
  3. You have two options for installing the installation zip packages. (Note: The sideload method requires a recent version of adb to be working in recovery (adb bundled with ubuntu may have protocol errors):
    • Sideload method: Select apply update > apply update from adb. Open a command prompt (or Terminal on Mac and Linux) and enter adb sideload update.zip, where update.zip should be replaced with the package filename. If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Install update method: If you previously placed the installation zip packages on your internal storage, select apply update > choose from internal storage. Navigate to the directory where you placed the packages and select one. If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  4. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Note:

On all 2011 model Sony devices, the kernel will not update when flashed in recovery, so the kernel must be updated via fastboot every time you flash a new build of CyanogenMod.

Click here to continue instructions using CWM Recovery
Note:Once the device boots into ClockworkMod Recovery, use the physical volume buttons to move up and down. The home button is used to confirm your selection.
  1. Optional (Recommended): Select backup and restore to create a backup of your current ROM.
  2. Select wipe data/factory reset. If you get an error formatting /data, try format /data and /data/media from the mounts and storage menu
  3. You have two options for transferring and installing the installation zip packages. Both cases require a recent version of adb to be working in recovery (adb bundled with ubuntu may have protocol errors). The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 as a mountable volume, go ahead and mount it. If you do not see this directory, then instead mount the /data directory. Take note of which volume you mounted. Now, push the package(s) to your device:
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /data, then: adb push update.zip /sdcard/0/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  4. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Note:

On all 2011 model Sony devices, the kernel will not update when flashed in recovery, so the kernel must be updated via fastboot every time you flash a new build of CyanogenMod.

Helpful Tip

See something wrong on this page? Click here: Report a Site Problem.

How To Build CyanogenMod For Sony Ericsson Xperia Play (CDMA) (zeusc)

Introduction

These instructions will hopefully assist you to start with a stock Xperia Play (CDMA), unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Xperia Play (CDMA)
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Xperia Play (CDMA) (typically micro USB, but older devices may use mini USB or have a proprietary 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 recovery. 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.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b ics

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt apps (CM11 and below)

Next,

$ cd ~/android/system/vendor/cm

then enter:

$ ./get-prebuilts

You won’t see any confirmation- just another prompt. But this should cause some prebuilt apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

Helpful Tip – Errors during breakfast

Different maintainers setup their device inheritance rules differently. Some require a vendor directory to be populated before breakfast will even succeed. If you receive an error here about vendor makefiles, then jump down to the next section Extract proprietary blobs. The first portion of breakfast should have succeeded at pulling in the device tree and the extract blobs script should be available. After completing that section, you can rerun breakfast zeusc

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

$ source build/envsetup.sh
$ breakfast zeusc

This will download the device specific configuration and kernel source for your device. An alternative to using the breakfast command is to build your own local manifest. To do this, you will need to locate your device on CyanogenMod’s GitHub and list all of the repositories defined in cm.dependencies in your local manifest.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Xperia Play (CDMA) is connected to your computer via the USB cable and that you are in the ~/android/system/device/semc/zeusc directory (you can cd ~/android/system/device/semc/zeusc 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 ~/android/system/vendor/semc 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 a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/semc directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilts/misc/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch zeusc

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make zeusc should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/zeusc/cm_zeusc-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-9-20161224-UNOFFICIAL-zeusc.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-9-20161224-UNOFFICIAL-zeusc.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Sony Ericsson Xperia Play (GSM) (zeus)

Sony Ericsson Xperia Play (GSM) ("zeus") Cyanogenmod

Cyanogenmod ROM Sony Ericsson Xperia Play (GSM) (zeus)

Quick Info

Download CyanogenMod

It looks like we don’t have any roms for download for this device. 🙁

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the ics branch of CyanogenMod.

Notes

The Sony Ericsson Xperia Play (GSM) (aka zeus) is a touchscreen smartphone manufactured by Sony Ericsson. Official CyanogenMod support for the Sony Ericsson Xperia Play (GSM) was added in CyanogenMod 7.1.

Special boot modes

  • Fastboot:
    1. Power down device
    2. Plug data cable into PC
    3. While holding down the Search button, plug the data cable into the device

    If successful, the LED will turn blue to indicate the device is in fastboot mode.

Source code

Device http://www.github.com/cyanogenmod/android_device_semc_zeus
Kernel http://www.github.com/cyanogenmod/semc-kernel-msm7x30
Xperia Play (GSM) Specifications
Codename: zeus
Vendor: Sony Ericsson
Release date: 2011 May 1 (UK)
Type: phone (slider)
GSM freq: Quad-band GSM 850 900 1800 1900 MHz GPRS/EDGE
Quad-band 800 850 1900 2100 MHz HSPA/WCDMA (Canada)
Dual-band 900 2100 MHz HSPA/WCDMA (Europe)
Platform: Qualcomm MSM8255
CPU: 1 GHz single-core Qualcomm Snapdragon S2
GPU: Qualcomm Adreno 205
RAM: 512MB
Weight: 175 g (6.2 oz)
Dimensions: 119 mm (4.7 in) (h)
62 mm (2.44 in) (w)
16 mm (0.63 in) (d)
Screen size: 102 mm (4.0 in)
Resolution: 854×480 (FWVGA)
Screen type: TFT LED-LCD
Internal storage: 400MB
SD Card: up to 32GB
Bluetooth: Bluetooth 2.1+EDR w/A2DP
Wi-Fi: 802.11b/g/n
Main camera: 5.1 megapixel with LED flash
Secondary camera: 0.3 megapixel
Power: 1500 mAh internal rechargeable removable lithium-ion polymer battery
Peripherals: microUSB, A-GPS, DNLA, microHDMI, capacitive touchscreen, proximity & ambient light sensors, volume controls, 3-axis accelerometer, digital compass, touchpad, PSP-esq buttons
CM supported: 7, 9
Latest CM version: ics

How to Install CyanogenMod on the Sony Ericsson Xperia Play (GSM) (zeus)

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Important Notes

The Sony Ericsson Xperia Play (GSM) (aka zeus) is a touchscreen smartphone manufactured by Sony Ericsson. Official CyanogenMod support for the Sony Ericsson Xperia Play (GSM) was added in CyanogenMod 7.1.

Unlock your Xperia Play (GSM)

What does “unlocking” mean?

The first step in putting any custom operating system on your Xperia Play (GSM) is to unlock the bootloader. A bootloader is the very first program that runs when you turn on your device. The bootloader initializes some hardware and then loads the kernel and ramdisk, and gets the boot process going. If the bootloader is in locked mode, it will ensure that only the stock operating system can run. Since you will be installing your own operating system (CyanogenMod), you need to turn this off.

To unlock your bootloader, you’ll first need a program on your computer called adb. One way to get adb is to download and install the Android SDK (Software Developer Kit) from Google. The SDK is used by app developers when they’re writing programs for Android, and who knows, you may want to write apps someday.

Install the Android SDK

Download the SDK, per the steps on Google’s web page. Then install it by following the specific instructions for your computer.

Obtaining the Bootloader Unlock Code

Note:

Unlocking the bootloader on a Sony device may automatically wipe internal storage; a backup of the sdcard is suggested. It will also irreversibly erase the DRM keys stored in the TA partition of some devices, which will result in the loss of certain proprietary features that may have been included. Check your specific device forum on XDA to learn more.

In order to unlock the bootloader on your Xperia Play (GSM) you will need to obtain a code from Sony. The following process will help you acquire this code so that you can flash a custom recovery.

  1. Open the Phone application on the Xperia Play (GSM) and enter *#06# to obtain the device’s IMEI, IDID or MEID. Save this for later use.
    • Optional: if you do not have a phone app, the IMEI, IDID or MEID can be found on the box or on the device in Settings -> About Device -> Status.
  2. Put the device into fastboot mode:
      1. Power down device
      2. Plug data cable into PC
      3. While holding down the Search button, plug the data cable into the device

      If successful, the LED will turn blue to indicate the device is in fastboot mode.

  3. Open a terminal on the PC and enter fastboot getvar version
    • If you receive the message <waiting for device> fastboot is not configured properly, please see fastboot for more details.
  4. Navigate a browser here
    • Select your device and click the ‘continue’ button at the bottom of the page.
    • Enter your email address, agree to the terms and select ‘Submit’
    • Click the link from your email, enter your IMEI, IDID or MEID and continue
    • The unlock code should now appear, write this down for the next step.
  5. In the PC’s terminal, enter the following command: fastboot oem unlock 0xKEY
    • KEY corresponds to the unlock code you were given.

The Xperia Play (GSM)’s bootloader should now be unlocked.

Installing CyanogenMod on Sony Devices

  1. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  2. Extract boot.img from the zip to your computer, you will need this file for fastboot.
  3. Put the phone into fastboot mode:
    1. Power down device
    2. Plug data cable into PC
    3. While holding down the Search button, plug the data cable into the device

    If successful, the LED will turn blue to indicate the device is in fastboot mode.

  4. Open a terminal on the PC with admin rights, access your platform-tools directory of the Android SDK, and enter the following:
    • fastboot flash boot boot.img
    • fastboot reboot
    While the device reboots, press the Volume rockers a few times to load recovery.
Note: Make the selection below based on the recovery version you see on your screen. If you’re installing CyanogenMod 11, you will have CWM Recovery. If installing CyanogenMod 12.0 or newer, you will have CyanogenMod Recovery.
Click here to continue instructions using CyanogenMod Recovery
Note: Once the device boots into CyanogenMod Recovery, use the physical volume buttons to move up and down. The home button is used to confirm your selection. The recovery is also touch screen friendly, so you can swipe up or down to scroll and tap the item you wish to select.
  1. Optional (Recommended): Using adb you can create a backup on your PC of your apps and app data. Boot the device into android and open a command prompt (or terminal on Mac and Linux) and enter the following:
    • adb backup -apk -all -f backup20161224.ab
    When the backup is complete return to recovery mode.
  2. On the device, select wipe data/factory reset.
  3. You have two options for installing the installation zip packages. (Note: The sideload method requires a recent version of adb to be working in recovery (adb bundled with ubuntu may have protocol errors):
    • Sideload method: Select apply update > apply update from adb. Open a command prompt (or Terminal on Mac and Linux) and enter adb sideload update.zip, where update.zip should be replaced with the package filename. If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Install update method: If you previously placed the installation zip packages on your internal storage, select apply update > choose from internal storage. Navigate to the directory where you placed the packages and select one. If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  4. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Note:

On all 2011 model Sony devices, the kernel will not update when flashed in recovery, so the kernel must be updated via fastboot every time you flash a new build of CyanogenMod.

Click here to continue instructions using CWM Recovery
Note:Once the device boots into ClockworkMod Recovery, use the physical volume buttons to move up and down. The home button is used to confirm your selection.
  1. Optional (Recommended): Select backup and restore to create a backup of your current ROM.
  2. Select wipe data/factory reset. If you get an error formatting /data, try format /data and /data/media from the mounts and storage menu
  3. You have two options for transferring and installing the installation zip packages. Both cases require a recent version of adb to be working in recovery (adb bundled with ubuntu may have protocol errors). The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 as a mountable volume, go ahead and mount it. If you do not see this directory, then instead mount the /data directory. Take note of which volume you mounted. Now, push the package(s) to your device:
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /data, then: adb push update.zip /sdcard/0/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  4. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Note:

On all 2011 model Sony devices, the kernel will not update when flashed in recovery, so the kernel must be updated via fastboot every time you flash a new build of CyanogenMod.

Helpful Tip

See something wrong on this page? Click here: Report a Site Problem.

How To Build CyanogenMod For Sony Ericsson Xperia Play (GSM) (zeus)

Introduction

These instructions will hopefully assist you to start with a stock Xperia Play (GSM), unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Xperia Play (GSM)
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Xperia Play (GSM) (typically micro USB, but older devices may use mini USB or have a proprietary 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 recovery. 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.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b ics

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt apps (CM11 and below)

Next,

$ cd ~/android/system/vendor/cm

then enter:

$ ./get-prebuilts

You won’t see any confirmation- just another prompt. But this should cause some prebuilt apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

Helpful Tip – Errors during breakfast

Different maintainers setup their device inheritance rules differently. Some require a vendor directory to be populated before breakfast will even succeed. If you receive an error here about vendor makefiles, then jump down to the next section Extract proprietary blobs. The first portion of breakfast should have succeeded at pulling in the device tree and the extract blobs script should be available. After completing that section, you can rerun breakfast zeus

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

$ source build/envsetup.sh
$ breakfast zeus

This will download the device specific configuration and kernel source for your device. An alternative to using the breakfast command is to build your own local manifest. To do this, you will need to locate your device on CyanogenMod’s GitHub and list all of the repositories defined in cm.dependencies in your local manifest.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Xperia Play (GSM) is connected to your computer via the USB cable and that you are in the ~/android/system/device/semc/zeus directory (you can cd ~/android/system/device/semc/zeus 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 ~/android/system/vendor/semc 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 a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/semc directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilts/misc/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch zeus

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make zeus should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/zeus/cm_zeus-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-9-20161224-UNOFFICIAL-zeus.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-9-20161224-UNOFFICIAL-zeus.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Geeksphone Zero (zero)

Geeksphone Zero ("zero") Cyanogenmod

Cyanogenmod ROM Geeksphone Zero (zero)

Quick Info

Download CyanogenMod

It looks like we don’t have any roms for download for this device. 🙁

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the gingerbread branch of CyanogenMod.

Special boot modes

  • Recovery: Vol Up, Camera & Power
  • Fastboot: Vol Up & Power

Source code

Device http://www.github.com/cyanogenmod/android_device_geeksphone_zero
Zero Specifications
Codename: zero
Vendor: Geeksphone
Manufacturer: Geeksphone
Type: phone
GSM freq: Quad-band GSM 850 900 1800 1900 GPRS/EDGE
Single-band 2100 MHz HSPA/WCDMA
Platform: Qualcomm MSM7227
CPU: 600 MHz single-core Qualcomm
RAM: 256MB
Weight: 119 g (4.2 oz)
Dimensions: 105 mm (4.1 in) (h)
58 mm (2.28 in) (w)
13 mm (0.512 in) (d)
Screen size: 81 mm (3.2 in)
Resolution: 480×320 (HVGA)
Screen type: LED backlight
Internal storage: 512MB
SD Card: up to 32GB
Bluetooth: 2.1+EDR
Wi-Fi: 802.11 b/g
Main camera: 5MP
Power: 1150 mAh internal rechargeable removable lithium-ion battery
Peripherals: A-GPS, FM Radio, capacitive touchscreen, volume controls, 3-axis accelerometer, digital compass
CM supported: 7
Latest CM version: gingerbread

How to Install CyanogenMod on the Geeksphone Zero (zero)

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Installing a custom recovery using fastboot

See All About Recovery Images for more information about custom recoveries and their capabilities.

  1. Make sure your computer has working fastboot and adb.
  2. Download recovery — you can directly download a recovery image using the link below, or visit twrp.me to obtain the latest version of Team Win Recovery Project for your device.
    Recovery: Download
    md5: 10f7a601df18876099e8281ff0ec8e7c
  3. Connect the Zero to the computer via USB.
  4. Make sure the fastboot binary is in your PATH or that you place the recovery image in the same directory as fastboot.
  5. Open a terminal on your PC and reboot the device into fastboot mode by typing
    adb reboot bootloader
    or by using the hardware key combination for your device while it is powered off.
  6. Once the device is in fastboot mode, verify your PC sees the device by typing
    fastboot devices
    • If you don’t see your device serial number, and instead see “<waiting for device>”, fastboot is not configured properly on your machine. See fastboot documentation for more info.
    • If you see “no permissionsfastboot”, make sure your UDEV rules are setup correctly.
  7. Flash recovery onto your device by entering the following command:
    fastboot flash recovery your_recovery_image.img
    where the latter part is the filename of the recovery image.
  8. Once the flash completes successfully, reboot the device into recovery to verify the installation. Boot to recovery instructions: Vol Up, Camera & Power
    • Note: Some ROMs overwrite recovery at boot time so if you do not plan to immediately boot into recovery to install CyanogenMod, please be aware that this may overwrite your custom recovery with the stock one.

Installing CyanogenMod from recovery

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Boot to recovery mode, and connect the phone to your computer through USB.
    • Vol Up, Camera & Power
  4. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  5. Optional (Recommended): Select backup and restore to create a backup.
  6. Select wipe data/factory reset.
  7. You have two options for transferring and installing the installation packages. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  8. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip – SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user’s /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here’s the most frequent scenarios:

  1. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you’re coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

Helpful Tip

See something wrong on this page? Click here: Report a Site Problem.

How To Build CyanogenMod For Geeksphone Zero (zero)

Introduction

These instructions will hopefully assist you to start with a stock Zero, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Zero
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Zero (typically micro USB, but older devices may use mini USB or have a proprietary 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 recovery. 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.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b gingerbread

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt Rom Manager

$ cd ~/android/system/vendor/cyanogen

then enter:

$ ./get-rommanager

You won’t see any confirmation- just another prompt. But this should cause the Rom Manager apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:
$ source build/envsetup.sh
$ lunch

You should see a list of devices, including something like cm_zero-userdebug. Select it by typing its number. It is possible that lunch does not display your device. In that case try

$ lunch cm_zero-userdebug

or

$ lunch full_zero-userdebug

If all goes well, you should see that zero-specific directories are downloaded automatically.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Zero is connected to your computer via the USB cable and that you are in the ~/android/system/device/geeksphone/zero directory (you can cd ~/android/system/device/geeksphone/zero 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 ~/android/system/vendor/geeksphone 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 a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/geeksphone directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilt/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch zero

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make zero should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/zero/cm_zero-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-7-20161224-UNOFFICIAL-zero.zip, which is the CyanogenMod installation package.

Installing a custom recovery using fastboot

See All About Recovery Images for more information about custom recoveries and their capabilities.

  1. Make sure your computer has working fastboot and adb.
  1. Connect the Zero to the computer via USB.
  2. Make sure the fastboot binary is in your PATH or that you place the recovery image in the same directory as fastboot.
  3. Open a terminal on your PC and reboot the device into fastboot mode by typing
    adb reboot bootloader
    or by using the hardware key combination for your device while it is powered off.
  4. Once the device is in fastboot mode, verify your PC sees the device by typing
    fastboot devices
    • If you don’t see your device serial number, and instead see “<waiting for device>”, fastboot is not configured properly on your machine. See fastboot documentation for more info.
    • If you see “no permissionsfastboot”, make sure your UDEV rules are setup correctly.
  5. Flash recovery onto your device by entering the following command:
    fastboot flash recovery your_recovery_image.img
    where the latter part is the filename of the recovery image.
  6. Once the flash completes successfully, reboot the device into recovery to verify the installation.
    • Note: Some ROMs overwrite recovery at boot time so if you do not plan to immediately boot into recovery to install CyanogenMod, please be aware that this may overwrite your custom recovery with the stock one.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-7-20161224-UNOFFICIAL-zero.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Motorola Cliq XT (zeppelin)

Motorola Cliq XT ("zeppelin") Cyanogenmod

Cyanogenmod ROM Motorola Cliq XT (zeppelin)

Quick Info

Download CyanogenMod

It looks like we don’t have any roms for download for this device. 🙁

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the gingerbread branch of CyanogenMod.

Special boot modes

  • Recovery: Volume Down & Power

Source code

Device http://www.github.com/cyanogenmod/android_device_motorola_zeppelin
Cliq XT Specifications
Codename: zeppelin
Vendor: Motorola
Release date: 2010 March 17
Type: phone
GSM freq: GSM:850,900,1800,1900,900
UMTS1700,2100
Platform: Qualcomm MSM7201A
CPU: 528 MHz single-core
GPU: Adreno 130
RAM: 256MB
Weight: 130g (4.6 oz)
Dimensions: 117 mm (4.6 in) (h)
60 mm (2.36 in) (w)
14 mm (0.472 in) (d)
Screen size: 79 mm (3.1 in)
Resolution: 320x480px
Internal storage: 512MB
SD Card: up to 32GB
Bluetooth: 2.1+EDR
Wi-Fi: 802.11 b/g
Main camera: 5MP w/ LED flash
Power: 1420 mAh internal rechargeable
removable lithium-ion battery
Peripherals: 3-axis acceleromteter
digital compass
CM supported: 7
Latest CM version: gingerbread

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Gain Root with Framaroot

  1. Install Framaroot for one click root. http://forum.xda-developers.com/showthread.php?t=2130276 (Select Gimli.)
  2. Run adb push Framaroot_9.9.9.apk /sdcard/
  3. Open Files app, navigate to SDCard, select Framaroot, install, open, root, reboot.

Gaining Root Access with rageagainstthecage

  1. You will need ADB on the computer to root the Cliq XT.
  2. Download the following files:
    • rageagainstthecage-arm5: Download
      md5: bfa28d457b54508326ab55d11399c586
      (Note: Antivirus software may delete this because “it could be used by malware to root Android phones”. Either turn off your antivirus, or flag this as “allowed” while you are gaining root access, and un”allow” it when done.)
    • Superuser package: Download
      md5: 43d9a40b63e916635d5ad7ca32433fab
    • Windows Only: Motorola 5.5.0 device drivers: Download
  3. Windows Only: Install the Motorola device drivers.
  4. Unzip rageinthecage-arm5 & the Superuser package to the same folder as adb (the /platform-tools folder within the Android SDK folder).
  5. Connect the Cliq XT to the computer via USB.
  6. Allow “USB debug” on the device: Settings > Applications > Development and check USB debugging box.
  7. On the computer, open terminal and run the following commands:
    adb push rageagainstthecage-arm5.bin /data/local/tmp/
    adb shell
    chmod 755 /data/local/tmp/rageagainstthecage-arm5.bin
    /data/local/tmp/rageagainstthecage-arm5.bin
  8. Once the exploit finishes, in terminal, run the following commands:
    exit
    adb kill-server
    adb start-server
    adb shell

    NOTE: You should see a “#”. If you see a “$”, then the exploit didn’t work, please repeat steps 4 & 5.
    mount -o rw,remount /dev/block/mtdblock1 /system
    exit
    adb push su /system/xbin/
    adb shell chmod 4755 /system/xbin/su
    adb push Superuser.apk /system/app/
  9. The Cliq XT is now rooted, please continue to the next section.

Installing a recovery image using flash_image

Use of the flash_image binary assumes your device already has root. For more detailed instructions on using the tools in this guide, please visit ADB.

  1. Download the flash_image binary
  2. Install the binary into /data/local on your phone via adb and set permissions
    • adb push flash_image /data/local/
    • adb shell chmod 777 /data/local/flash_image
  3. Download koush’s ClockworkMod Recovery.
    • koush’s ClockworkMod Recovery: download
      md5: aab8d094fad20e31befd3c3367723f3b
  4. Push the file(s) to your device via adb.
    • adb push yourrecoveryimage.img /data/local/
    • adb shell chmod 777 /data/local/yourrecoveryimage.img

Flash the recovery:

  1. adb shell /data/local/flash_image recovery /data/local/yourrecoveryimage.img

Installing CyanogenMod from recovery

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Boot to recovery mode, and connect the phone to your computer through USB.
    • Camera & the Power button until the device indicates to stop. Then press the Volume Down
  4. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  5. Optional (Recommended): Select backup and restore to create a backup.
  6. Select wipe data/factory reset.
  7. You have two options for transferring and installing the installation packages. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  8. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip – SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user’s /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here’s the most frequent scenarios:

  1. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you’re coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

How To Build CyanogenMod For Motorola Cliq XT (zeppelin)

Introduction

These instructions will hopefully assist you to start with a stock Cliq XT, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Cliq XT
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Cliq XT (typically micro USB, but older devices may use mini USB or have a proprietary 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 recovery. 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.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b gingerbread

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt Rom Manager

$ cd ~/android/system/vendor/cyanogen

then enter:

$ ./get-rommanager

You won’t see any confirmation- just another prompt. But this should cause the Rom Manager apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:
$ source build/envsetup.sh
$ lunch

You should see a list of devices, including something like cm_zeppelin-userdebug. Select it by typing its number. It is possible that lunch does not display your device. In that case try

$ lunch cm_zeppelin-userdebug

or

$ lunch full_zeppelin-userdebug

If all goes well, you should see that zeppelin-specific directories are downloaded automatically.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Cliq XT is connected to your computer via the USB cable and that you are in the ~/android/system/device/motorola/zeppelin directory (you can cd ~/android/system/device/motorola/zeppelin 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 ~/android/system/vendor/motorola 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 a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/motorola directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilt/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch zeppelin

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make zeppelin should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/zeppelin/cm_zeppelin-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-7-20161224-UNOFFICIAL-zeppelin.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-7-20161224-UNOFFICIAL-zeppelin.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Commtiva z71 (z71)

Commtiva z71 ("z71") Cyanogenmod

Cyanogenmod ROM Commtiva z71 (z71)

Quick Info

Download CyanogenMod

It looks like we don’t have any roms for download for this device. 🙁

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the gingerbread branch of CyanogenMod.

Notes

The Commtiva Z71 is a touchscreen smartphone manufactured by Commtiva. It was released under several different names: Apanda A60, Chinavision Excalibur, Cincinnati Bell Blaze , Gigabyte Gsmart G1305, Motorola XT502, Muchtel A1, Nexian Journey, Optimus Boston, Orange Boston, Spice Mi-300 , Vibo A688 , Cherry Mobile Nova and Wellcom A88.

Source code

Device http://www.github.com/cyanogenmod/android_device_commtiva_z71
z71 Specifications
Codename: z71
Vendor: Commtiva
Manufacturer: Commtiva
Type: phone
GSM freq: Quad-band GSM 850 900 1800 1900 MHz GPRS/EDGE

Tri-band UMTS 900 1700 2100 MHz (Europe & Asia) or
Tri-band UMTS 850 1700 2100 MHz (North/Latin America, Australia & China) or
Tri-band UMTS 900 1900 2100 MHz (European Orange Boston)

Platform: Qualcomm MSM7227
CPU: 600 MHz single-core Qualcomm
RAM: 256MB
Weight: 114 g (4 oz)
Dimensions: 114.9 mm (4.5 in) (h)

56.8 mm (2.24 in) (w)

12.6 mm (0.496 in) (d)

Screen size: 81 mm (3.2 in)
Resolution: 480×320
Screen density: 180 ppi
Internal storage: 512MB
SD Card: yes
Bluetooth: Bluetooth 2.0+EDR,
Wi-Fi: (802.11b/g)
Main camera: 5MP w/ LED flash
Power: 1230 mAh internal rechargeable removable lithium-ion battery
Peripherals: micro-USB, A-GPS, capacitive touchscreen display, volume controls, ambient light sensors, 3-axis accelerometer, digital compass
CM supported: 7
Latest CM version: gingerbread

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Rooting and installing a custom recovery on the Commtiva Z71

The Commtiva Z71, or any of its clones, would need to be rooted first, and then the ClockworkMod Recovery needs to be installed on it.

Currently, there are a few methods that would work depending on which exact version of the Commtiva Z71 clone you possess. Currently, sean-feeney.com has a good guide which may or may not work, so proceed with caution. It is possible to use this method to install a custom ROM with root permissions on the device, and then proceed with installing the ClockworkMod Recovery image, followed by the CyanogenMOD ROM.

Note : If the ClockworkMod Recovery image fails to load, try installing an alternate version from within ClockworkMod (scroll down to last option inside ClockworkMod, All ClockworkMod Recoveries, and try selecting the previous version of the ClockworkMod recovery image)

Installing CyanogenMod from recovery

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Boot to recovery mode, and connect the phone to your computer through USB.
    • Vol Down & Power
  4. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  5. Optional (Recommended): Select backup and restore to create a backup.
  6. Select wipe data/factory reset.
  7. You have two options for transferring and installing the installation packages. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  8. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip – SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user’s /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here’s the most frequent scenarios:

  1. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you’re coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

How To Build CyanogenMod For Commtiva z71 (z71)

Introduction

These instructions will hopefully assist you to start with a stock z71, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A z71
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the z71 (typically micro USB, but older devices may use mini USB or have a proprietary 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 recovery. 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.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b gingerbread

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt Rom Manager

$ cd ~/android/system/vendor/cyanogen

then enter:

$ ./get-rommanager

You won’t see any confirmation- just another prompt. But this should cause the Rom Manager apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:
$ source build/envsetup.sh
$ lunch

You should see a list of devices, including something like cm_z71-userdebug. Select it by typing its number. It is possible that lunch does not display your device. In that case try

$ lunch cm_z71-userdebug

or

$ lunch full_z71-userdebug

If all goes well, you should see that z71-specific directories are downloaded automatically.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your z71 is connected to your computer via the USB cable and that you are in the ~/android/system/device/commtiva/z71 directory (you can cd ~/android/system/device/commtiva/z71 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 ~/android/system/vendor/commtiva 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 a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/commtiva directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilt/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch z71

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make z71 should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/z71/cm_z71-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-7-20161224-UNOFFICIAL-z71.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-7-20161224-UNOFFICIAL-z71.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Motorola Photon Q (CDMA) (xt897c)

Motorola Photon Q (CDMA) ("xt897c") Cyanogenmod

Cyanogenmod ROM Motorola Photon Q (CDMA) (xt897c)

Quick Info

Download CyanogenMod

It looks like we don’t have any roms for download for this device. 🙁

Notes

Note:

xt897c specific builds are obsolete!!!
Please go to Photon Q

Special boot modes

  • Recovery: Volume Down & Power.
  • Bootloader: Volume Up & Volume Down & Power. Use Volume Down to scroll and Volume Up to select.
  • Fastboot: Volume Up & Volume Down & Power. Use Volume Down to scroll and Volume Up to select.

Source code

Device http://www.github.com/cyanogenmod/android_device_motorola_xt897c
Kernel http://www.github.com/cyanogenmod/android_kernel_motorola_msm8960-common
Photon Q (CDMA) Specifications
Codename: xt897c
Also known as: asanti_c
Vendor: Motorola
Manufacturer: Motorola
Release date: 2012 August
Type: phone (slider)
GSM freq: GSM 850 / 900 / 1800 / 1900
HSDPA 900 / 1900 / 2100
CDMA freq: CDMA 800 / 1900, EV-DO Rev.A
LTE freq: LTE 1900
Platform: Qualcomm MSM8960
CPU: 1.5 GHz dual-core Cortex A9 (Krait)
GPU: Adreno 225
RAM: 1GB
Weight: 170 g (6 oz)
Dimensions: 126 x 66 x 13.7 mm (4.98 x 2.6 x 0.54 in)
Screen size: 109 mm (4.3 in)
Resolution: 540 x 960 pixels
Screen density: ~256 ppi
Screen type: TFT capacitive touchscreen
Internal storage: 8 GB (4.5 GB user available)
SD Card: microSD, up to 32 GB
Bluetooth: Yes, v4.0 with A2DP, LE, EDR
Wi-Fi: Wi-Fi 802.11 a/b/g/n, dual-band, DLNA, Wi-Fi hotspot
Main camera: 8 MP, 3264×2448 pixels, autofocus, 1080p@30fps, flash: LED flash
Secondary camera: Yes, 1.3 MP
Power: Non-removable Li-Ion 1785 mAh battery
Peripherals: Accelerometer, proximity, compass
CM supported: 10.1, 10.2, 11

How to Install CyanogenMod on the Motorola Photon Q (CDMA) (xt897c)

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Important Notes

Note:

xt897c specific builds are obsolete!!!
Please go to Photon Q

Installing a custom recovery using fastboot

See All About Recovery Images for more information about custom recoveries and their capabilities.

  1. Make sure your computer has working fastboot and adb.
  2. Download recovery — visit download.cyanogenmod.org to obtain the latest version of CyanogenMod Recovery for your device.
  3. Connect the Photon Q (CDMA) to the computer via USB.
  4. Make sure the fastboot binary is in your PATH or that you place the recovery image in the same directory as fastboot.
  5. Open a terminal on your PC and reboot the device into fastboot mode by typing
    adb reboot bootloader
    or by using the hardware key combination for your device while it is powered off.
  6. Once the device is in fastboot mode, verify your PC sees the device by typing
    fastboot devices
    • If you don’t see your device serial number, and instead see “<waiting for device>”, fastboot is not configured properly on your machine. See fastboot documentation for more info.
    • If you see “no permissionsfastboot”, make sure your UDEV rules are setup correctly.
  7. Flash recovery onto your device by entering the following command:
    fastboot flash recovery your_recovery_image.img
    where the latter part is the filename of the recovery image.
  8. Once the flash completes successfully, reboot the device into recovery to verify the installation. Boot to recovery instructions: Volume Down & Power.
    • Note: Some ROMs overwrite recovery at boot time so if you do not plan to immediately boot into recovery to install CyanogenMod, please be aware that this may overwrite your custom recovery with the stock one.

Installing CyanogenMod from recovery

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Boot to recovery mode, and connect the phone to your computer through USB.
    • Volume Down & Power.
  4. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  5. Optional (Recommended): Select backup and restore to create a backup.
  6. Select wipe data/factory reset.
  7. You have two options for transferring and installing the installation packages. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  8. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip – SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user’s /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here’s the most frequent scenarios:

  1. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you’re coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

Helpful Tip

See something wrong on this page? Click here: Report a Site Problem.

How To Build CyanogenMod For Motorola Photon Q (CDMA) (xt897c)

Introduction

These instructions will hopefully assist you to start with a stock Photon Q (CDMA), unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Photon Q (CDMA)
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Photon Q (CDMA) (typically micro USB, but older devices may use mini USB or have a proprietary 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 recovery. 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.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt apps (CM11 and below)

Next,

$ cd ~/android/system/vendor/cm

then enter:

$ ./get-prebuilts

You won’t see any confirmation- just another prompt. But this should cause some prebuilt apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

Helpful Tip – Errors during breakfast

Different maintainers setup their device inheritance rules differently. Some require a vendor directory to be populated before breakfast will even succeed. If you receive an error here about vendor makefiles, then jump down to the next section Extract proprietary blobs. The first portion of breakfast should have succeeded at pulling in the device tree and the extract blobs script should be available. After completing that section, you can rerun breakfast xt897c

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

$ source build/envsetup.sh
$ breakfast xt897c

This will download the device specific configuration and kernel source for your device. An alternative to using the breakfast command is to build your own local manifest. To do this, you will need to locate your device on CyanogenMod’s GitHub and list all of the repositories defined in cm.dependencies in your local manifest.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Photon Q (CDMA) is connected to your computer via the USB cable and that you are in the ~/android/system/device/motorola/xt897c directory (you can cd ~/android/system/device/motorola/xt897c 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 ~/android/system/vendor/motorola 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 a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/motorola directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilts/misc/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch xt897c

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make xt897c should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/xt897c/cm_xt897c-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-13.0-20161224-UNOFFICIAL-xt897c.zip, which is the CyanogenMod installation package.

Installing a custom recovery using fastboot

See All About Recovery Images for more information about custom recoveries and their capabilities.

  1. Make sure your computer has working fastboot and adb.
  1. Connect the Photon Q (CDMA) to the computer via USB.
  2. Make sure the fastboot binary is in your PATH or that you place the recovery image in the same directory as fastboot.
  3. Open a terminal on your PC and reboot the device into fastboot mode by typing
    adb reboot bootloader
    or by using the hardware key combination for your device while it is powered off.
  4. Once the device is in fastboot mode, verify your PC sees the device by typing
    fastboot devices
    • If you don’t see your device serial number, and instead see “<waiting for device>”, fastboot is not configured properly on your machine. See fastboot documentation for more info.
    • If you see “no permissionsfastboot”, make sure your UDEV rules are setup correctly.
  5. Flash recovery onto your device by entering the following command:
    fastboot flash recovery your_recovery_image.img
    where the latter part is the filename of the recovery image.
  6. Once the flash completes successfully, reboot the device into recovery to verify the installation.
    • Note: Some ROMs overwrite recovery at boot time so if you do not plan to immediately boot into recovery to install CyanogenMod, please be aware that this may overwrite your custom recovery with the stock one.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-13.0-20161224-UNOFFICIAL-xt897c.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Samsung Vibrant (vibrantmtd)

Samsung Vibrant ("vibrantmtd") Cyanogenmod

Cyanogenmod ROM Samsung Vibrant (vibrantmtd)

Quick Info

Download CyanogenMod

It looks like we don’t have any roms for download for this device. 🙁

Notes

This guide assumes the Samsung Vibrant already has Android 2.2 build UVKB5.

WARNING:

Note that until recently, an E911 bug caused the Vibrant to be removed from the list of officially supported devices. Any builds from before February 2012 have this bug and should not be used. Also, please avoid using any versions pre-CM10 stable to ensure E911 stability. (Post-February builds may still have intermittent issues.)

Special boot modes

  • Recovery: Volume Up, Volume Down, & Power
  • Download: Volume Down

Source code

Device http://www.github.com/cyanogenmod/android_device_samsung_vibrantmtd
Kernel http://www.github.com/cyanogenmod/android_kernel_samsung_aries
Vibrant Specifications
Codename: vibrantmtd
Vendor: Samsung
Manufacturer: samsung
Release date: 2010 July 15 (USA)
Type: phone
GSM freq: Quad band GSM 850 900 1800 1900 MHz GPRS/EDGE
Dual band UMTS 1700 1900 2100 MHz, and HSPA
Platform: Samsung S5PC110
CPU: 1 GHz single-core Hummingbird
GPU: PowerVR SGX540
RAM: 512MB
Weight: 118 g (4.2 oz)
Dimensions: 125 mm (4.9 in) x 64 mm (2.53 in) x 10 mm (0.39 in)
Screen size: 102 mm (4.0 in)
Resolution: 800×480
Screen density: 233 PPI
Internal storage: 2GB
SD Card: up to 32GB
Bluetooth: 3.0
Wi-Fi: 802.11 a/b/g/n
Main camera: 5MP
Power: 1500 mAh
CM supported: 7, 9, 10, 10.1

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

THIS GUIDE IS ONLY FOR T-Mobile Samsung Vibrant (SGH-T959), DO NOT USE ON ANY OTHER DEVICE!

Voodoo Lagfix

On the PC, enter the following into a terminal:
adb shell mkdir -p /sdcard/Voodoo
adb shell touch /sdcard/Voodoo/disable-lagfix

Installing a custom recovery

Samsung devices come with a unique boot mode called Download Mode which is very similar to Fastboot Mode on some devices with unlocked bootloaders. Heimdall is a cross-platform, open source tool for interfacing with Download Mode on Samsung devices. The preferred method of installing a custom recovery is through this boot mode. Rooting the stock firmware is neither recommended nor necessary.

  1. Download and install the Heimdall Suite
    • Windows: Extract the Heimdall suite and take note of the directory holding heimdall.exe. You can verify Heimdall is working by opening a command prompt in this directory and typing heimdall version. If you receive an error, be sure that you have the Microsoft Visual C++ 2012 Redistributable Package (x86/32bit) installed on your computer.
    • Linux: Pick the appropriate installation package based on your distribution. The -frontend packages are not required for this guide. After installation, heimdall should be available from the terminal; type heimdall version to verify installation succeeded.
    • Mac: Install the dmg package. After installation, heimdall should be available from the terminal; type heimdall version to verify installation succeeded.
    • Building from source: The source code for the Heimdall Suite is available on Github. For more details about how to compile the Heimdall Suite, please refer to the README file on Github under the relevant operating system directory. You can also refer to the Install and compile Heimdall instructions on this wiki.
  2. Download recovery — you can directly download a recovery image using the link below, or visit TWRP site to check for the latest version of recovery for your device (if your device can be found there). For general info about recoveries click here.
    Recovery: Download
    md5: 5a45b11f331aaaaa2c391f0c57bac8f7
  3. Power off the Vibrant and connect the USB adapter to the computer but not to the Vibrant, yet.
  4. Boot the Vibrant into download mode. Volume Down & Volume Up Accept the disclaimer on the device. Then, insert the USB cable into the device.
  5. Windows (only) driver installation – Skip this step if you are using Linux or Mac
    A more complete set of the following instructions can be found in the Zadig User Guide.
    1. Run zadig.exe from the Drivers folder of the Heimdall Suite.
    2. Choose Options » List All Devices from the menu.
    3. Select Samsung USB Composite Device or MSM8x60 or Gadget Serial or Device Name from the drop down menu. (If nothing relevant appears, try uninstalling any Samsung related Windows software, like Samsung Windows drivers and/or Kies).
    4. Click Replace Driver (having selecting “Install Driver” from the drop down list built into the button).
    5. If you are prompted with a warning that the installer is unable to verify the publisher of the driver, select Install this driver anyway. You may receive two more prompts about security. Select the options that allow you to carry on.
  6. At this point, familiarize yourself with the Flashing with heimdall notes below so that you are prepared for any strange behaviour if it occurs.
  7. On the computer, open a terminal (or Command Prompt on Windows) in the directory where the recovery image is located and type:
    heimdall flash --kernel zImage --no-reboot
    Tip: The file may not be named identically to what’s in this command. If the file is wrapped in a zip or tar file, extract the file first, because heimdall isn’t going to do it for you.
    Note: this device has an initramfs recovery, meaning recovery is actually packaged inside a kernel image. Substitute the filename of the kernel/recovery combo that you downloaded in place of zImage above.
  8. A blue transfer bar will appear on the device showing the recovery being transferred.
  9. Unplug the USB cable from your device.
    • NOTE: Be sure to reboot into recovery immediately after having installed the custom recovery. Otherwise the custom recovery will be overwritten and the device will reboot (appearing as though your custom recovery failed to install).
  10. Manually reboot the phone into recovery mode by performing the following. {{{device_recovery_boot_steps}}}
  11. The Vibrant now has a custom recovery installed. Continue to the next section.

Note: Flashing with heimdall

  • In Windows 7 UAC (User Account Control) may need switching off. Once Heimdall is finished it can be re-enabled.
  • Protocol initialization can fail if the device is connected via a USB hub – connect the USB cable directly to the PC
  • It may be necessary to run the heimdall flash command as root in Linux or Mac OS X: sudo heimdall flash [...]. Typical symptoms of this are:
    • a blue bar doesn’t show up after the process has finished
    • Failed to confirm end of file transfer sequence!
  • It may be necessary to capitalize the name of the partition on some devices. Try --KERNEL instead of --kernel and/or --recovery instead of --RECOVERY.
  • If on Linux 64bit you get “unable to execute ./heimdall: No such file or directory”, try the 32bit version and make sure to run it with sudo: reference.
  • On Mac OS X you may see this message: “ERROR: Claiming interface failed!”. If so, you need to disable the default USB drivers with the following commands:
    sudo kextunload -b com.apple.driver.AppleUSBCDC;
    sudo kextunload -b com.apple.driver.AppleUSBCDCACMControl;
    sudo kextunload -b com.apple.driver.AppleUSBCDCACMData;
    If you have installed Samsung Kies, you may further need to unload those USB drivers with the following commands:
    sudo kextunload -b com.devguru.driver.SamsungComposite;
    sudo kextunload -b com.devguru.driver.SamsungACMData
    sudo kextunload -b com.devguru.driver.SamsungACMControl
  • Using Heimdall version 1.4.0 (the latest version available for download on the Glass Echidna website) you may see this message or one similar to it:
    Error: Failed to confirm end of PIT file transfer!
    If you experience this error, follow the instructions for compiling Heimdall from source to get the latest version on GitHub with the issue patched.

Helpful Tip

  • The stock ROM may overwrite your custom recovery on boot. To prevent this, boot immediately into recovery after leaving Download Mode instead of letting the ROM boot up normally. If your recovery is overwritten, simply redo the steps you followed above and catch it before it boots next time.
  • Note for upgrades from gingerbread to jellybean remember the recovery is changed. This means once you install do NOT restore to old-gingerbread-stock ROM from cwm-recovery.
  • To upgrade from stock/CM7/CM9/CM10.1.2/CM10.1.3 to CM10.2, you must first boot into recovery and wipe data, cache, and dalvik cache (factory reset). Due to the new partition layout in CM10.2, failing to perform these steps will result in a bootloop. See here for details; more about repartitioning here. If you missed this step before installing, boot to recovery and factory reset, then reinstall CM10.2.
  • Some users have reported connection errors if the device is connected to a USB hub. If you experience such errors it is recommended that you try connecting your device to a USB port on the motherboard.
  • Antivirus software may prevent Heimdall from connecting properly. Disable your antivirus before proceeding.
  • When Heimdall fails to connect, the Download mode may get stuck, making all further attempts fail too. To retry, you may need to restart the Download mode: turn off the phone by holding Power for 5-10 seconds (or by pulling out the battery), then boot into Download mode and run Heimdall again.
  • If Heimdall fails to connect (errors related to initializing the protocol, or transferring data):
    if you just installed the driver, try rebooting your computer and trying again.
    if you still have troubles after reboot, in Zadig try installing the libusbK driver rather than the WinUSB driver.

Installing CyanogenMod from recovery

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Boot to recovery mode, and connect the phone to your computer through USB.
    • Volume Up, Volume Down, & Power
  4. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  5. Optional (Recommended): Select backup and restore to create a backup.
  6. Select wipe data/factory reset.
  7. You have two options for transferring and installing the installation packages. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  8. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip – SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user’s /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here’s the most frequent scenarios:

  1. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you’re coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

How To Build CyanogenMod For Samsung Vibrant (vibrantmtd)

Introduction

These instructions will hopefully assist you to start with a stock Vibrant, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Vibrant
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Vibrant (typically micro USB, but older devices may use mini USB or have a proprietary 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 recovery. 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.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt apps (CM11 and below)

Next,

$ cd ~/android/system/vendor/cm

then enter:

$ ./get-prebuilts

You won’t see any confirmation- just another prompt. But this should cause some prebuilt apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

Helpful Tip – Errors during breakfast

Different maintainers setup their device inheritance rules differently. Some require a vendor directory to be populated before breakfast will even succeed. If you receive an error here about vendor makefiles, then jump down to the next section Extract proprietary blobs. The first portion of breakfast should have succeeded at pulling in the device tree and the extract blobs script should be available. After completing that section, you can rerun breakfast vibrantmtd

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

$ source build/envsetup.sh
$ breakfast vibrantmtd

This will download the device specific configuration and kernel source for your device. An alternative to using the breakfast command is to build your own local manifest. To do this, you will need to locate your device on CyanogenMod’s GitHub and list all of the repositories defined in cm.dependencies in your local manifest.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Vibrant is connected to your computer via the USB cable and that you are in the ~/android/system/device/samsung/vibrantmtd directory (you can cd ~/android/system/device/samsung/vibrantmtd 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 ~/android/system/vendor/samsung 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 a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/samsung directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilts/misc/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch vibrantmtd

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make vibrantmtd should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/vibrantmtd/cm_vibrantmtd-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-13.0-20161224-UNOFFICIAL-vibrantmtd.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-13.0-20161224-UNOFFICIAL-vibrantmtd.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Advent Vega (vega)

Advent Vega ("vega") Cyanogenmod

Cyanogenmod ROM Advent Vega (vega)

Quick Info

Download CyanogenMod

It looks like we don’t have any roms for download for this device. 🙁

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the gingerbread branch of CyanogenMod.

Notes

CyanogenMod for the Advent Vega should also work on the Advent Vega clones, like the POV Mobii 10.1

Source code

Device http://www.github.com/cyanogenmod/android_device_advent_vega
Vega Specifications
Codename: vega
Vendor: Advent
Manufacturer: Advent
Release date: Nov 14, 2010 (US)
Type: tablet
Platform: NVIDIA Tegra 2
CPU: 1 GHz dual-core ULP GeForce
RAM: 512MB
Weight: 700 g (24.7 oz)
Dimensions: 275 mm (10.8 in) (h)
178 mm (7 in) (w)
14 mm (0.551 in) (d)
Screen size: 257 mm (10.1 in)
Resolution: 1024×600
Internal storage: 512MB
SD Card: yes
Bluetooth: Bluetooth 2.1 +ERD
Wi-Fi: (802.11b/g/n)
Main camera: 1.3MP
Power: 2 cell internal rechargeable lithium-polymer battery
Peripherals: mini-USB, capacitive touchscreen display, capacitive touch buttons, 3-axis accelerometer
CM supported: 7
Latest CM version: gingerbread

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

This guide will walk you through the process of taking the Advent Vega from stock to having a custom recovery image and the ability to flash the latest version of CyanogenMod.

Rooting the Advent Vega

  1. You will need ADB on the computer to root the Advent Vega. Follow the Android SDK guide, to get the ADB shell on the computer.
  2. Download the rageinthecage-arm5 & Superuser package:
    • rageagainstthecage-arm5: Download
      md5: bfa28d457b54508326ab55d11399c586
    • Superuser package: Download
      md5: 43d9a40b63e916635d5ad7ca32433fab
  3. Unzip the rageinthecage-arm5 & Superuser package to the same folder as adb (the /platform-tools folder within the Android SDK folder).
  4. Connect the Advent Vega to the computer via USB.
  5. On the computer, open terminal and run the following commands:
    adb push rageagainstthecage-arm5.bin /data/local/tmp/
    adb shell
    chmod 755 /data/local/tmp/rageagainstthecage-arm5.bin
    /data/local/tmp/rageagainstthecage-arm5.bin
  6. Once the exploit finishes, in terminal, run the following commands:
    exit
    adb kill-server
    adb start-server
    adb shell

    NOTE: You should see a “#”. If you see a “$”, then the exploit didn’t work, please repeat steps 4 & 5.
    mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
    exit
    adb push su /system/xbin/
    adb shell chmod 4755 /system/xbin/su
    adb push Superuser.apk /system/app/
  7. The Advent Vega is now rooted, please continue to the next section.

If you have a device that is stuck in USB hostmode (like the Mobii). The above still applies but instead of using adb you’ll have to download the necessary files either to an sdcard or the device directly and a terminal emulator like ConnectBot. Install the .apks by enabling install from unknown sources and simply select the apk in the filemanager.

Installing a Custom Recovery Image

If the Advent Vega already has a custom Recovery Image installed, you may skip this section.

The Simple method install the RomManager: [1]

And Open the app and select Flash ClockworkMod Recovery; Click on Advent Vega. If it asks you to give root permissions, go ahead and give the permissions.

OR

  1. Download the latest version of the ClockworkMod Recovery, flash_image & the Advent Vega Recovery app:
    • ClockworkMod Recovery 3.0.2.7: download
      md5: 51e88d9ea11646c7adda8c666a1c9286
    • flash_image: download
      md5: bd475f29e0665c702f8eaf57a0423b58
    • Advent Vega Recovery app: download
      md5: 096fe2a2d3220931015d4a1019b74298
  2. Unzip flash_image and copy the contents with the ClockworkMod Recovery image & the Advent Vega Recovery app to the same folder as adb (the /platform-tools folder within the Android SDK folder).
  3. Connect the Advent Vega to the computer via USB.
  4. On the computer, open terminal and run the following commands:
    adb push recovery-clockwork-3.0.2.7-vega.img /data/local/
    adb push flash_image /data/local/
    adb shell chmod 4755 /data/local/flash_image
    adb shell /data/local/flash_image recovery /data/local/recovery-clockwork-3.0.2.7-vega.img
    adb install -r moduleap.apk
  5. The ClockworkMod Recovery along with the Advent Vega Recovery app, should now be installed on the Advent Vega.

Installing CyanogenMod from recovery

  1. Make sure your computer has working adb.
  2. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  3. Boot to recovery mode, and connect the phone to your computer through USB.
    • adb reboot recovery
  4. In ClockworkMod Recovery, use the physical volume buttons to move up and down. On most devices, the power button is used to confirm a menu selection, but for some devices a physical home key acts as a selector. Some devices have touch enabled ClockworkMod Recovery, in which case you may be able to swipe to, or touch, menu selections.
  5. Optional (Recommended): Select backup and restore to create a backup.
  6. Select wipe data/factory reset.
  7. You have two options for transferring and installing the installation packages. The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 or /sdcard as a mountable volume, go ahead and mount it. If you do not see one of these partitions, then instead mount the /data partition. Take note of which volume you mounted. Now, push the package(s) to your device (also, see tip below):
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /sdcard or /data, then: adb push update.zip /sdcard/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  8. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Helpful Tip – SD card folders

CyanogenMod 10.1 and newer have multi-user support (introduced in Android 4.2). If your device has storage on the /data partition, then Android actually looks in /data/media/0/ for the first user’s /sdcard/ storage. ClockworkMod recovery symlinks /sdcard/ to /data/media/ though. So, if you are pushing files to internal storage in recovery and want them to be visible in Android, you should push them to /sdcard/0/ or /data/media/0/. Here’s the most frequent scenarios:

  1. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10 or older: adb push update.zip /sdcard/
  2. If you’re coming from a ROM with Android 4.1 or older to CyanogenMod 10.1 or newer: adb shell "mkdir /sdcard/0/" followed by adb push update.zip /sdcard/0/
  3. If you’re coming from a ROM with Android 4.2 or newer to CyanogenMod 10.1 or newer: adb push update.zip /sdcard/0/

Screen Recalibration

On first boot, you may have issues with portions of the screen not responding correctly. It’s recommended to install & recalibrate with the Calibration app. While the recalibration is occurring, it’s important to not touch the device.

How To Build CyanogenMod For Advent Vega (vega)

Introduction

These instructions will hopefully assist you to start with a stock Vega, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Vega
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Vega (typically micro USB, but older devices may use mini USB or have a proprietary 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 recovery. 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.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b gingerbread

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt Rom Manager

$ cd ~/android/system/vendor/cyanogen

then enter:

$ ./get-rommanager

You won’t see any confirmation- just another prompt. But this should cause the Rom Manager apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

After the source downloads, ensure you are in the root of the source code (cd ~/android/system), then type:
$ source build/envsetup.sh
$ lunch

You should see a list of devices, including something like cm_vega-userdebug. Select it by typing its number. It is possible that lunch does not display your device. In that case try

$ lunch cm_vega-userdebug

or

$ lunch full_vega-userdebug

If all goes well, you should see that vega-specific directories are downloaded automatically.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Vega is connected to your computer via the USB cable and that you are in the ~/android/system/device/advent/vega directory (you can cd ~/android/system/device/advent/vega 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 ~/android/system/vendor/advent 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 a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/advent directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilt/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch vega

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make vega should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/vega/cm_vega-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-7-20161224-UNOFFICIAL-vega.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-7-20161224-UNOFFICIAL-vega.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.

Sony Ericsson Xperia Ray (urushi)

Sony Ericsson Xperia Ray ("urushi") Cyanogenmod

Cyanogenmod ROM Sony Ericsson Xperia Ray (urushi)

Quick Info

Download CyanogenMod

It looks like we don’t have any roms for download for this device. 🙁

Note: Support Status

This device does not support the latest official release of CyanogenMod. This may be due to hardware limitations or simply because development is ongoing. The most recent version supported is based on the jellybean branch of CyanogenMod.

Notes

The Sony Ericsson Xperia Ray (aka urushi) is a touchscreen smartphone manufactured by Sony Ericsson. Official CyanogenMod support for the Sony Ericsson Xperia Ray was added in CyanogenMod 7.1.

Special boot modes

  • Fastboot: Vol Up

Source code

Device http://www.github.com/cyanogenmod/android_device_semc_urushi
Kernel http://www.github.com/cyanogenmod/semc-kernel-msm7x30
Xperia Ray Specifications
Codename: urushi
Vendor: Sony Ericsson
Release date: 2011 August 1 (UK)
Type: phone
GSM freq: Quad-band GSM 850 900 1800 1900 MHz GPRS/EDGE
CDMA freq: Tri-band 850 1900 2100 MHz HSPA/WCDMA; or
Dual-band 900 2100 MHz HSPA/WCDMA
Platform: Qualcomm MSM8255
CPU: 1 GHz single-core Qualcomm Snapdragon S2
GPU: Qualcomm Adreno 205
RAM: 512MB
Weight: 100 g (3.5 oz)
Dimensions: 111 mm (4.4 in) (h)
53 mm (2.09 in) (w)
9 mm (0.37 in) (d)
Screen size: 84 mm (3.3 in)
Resolution: 854×480 (FWVGA)
Screen type: TFT LED-LCD
Internal storage: 1 GB
SD Card: supports up to 32 GB
Bluetooth: Bluetooth 2.1+EDR with A2DP
Wi-Fi: 802.11b/g/n
Main camera: 8.1 megapixel with LED flash
Power: 1500 mAh internal rechargeable removable lithium-ion polymer battery
Peripherals: microUSB, A-GPS, DNLA, microHDMI, capacitive touchscreen, proximity & ambient light sensors, volume controls, 3-axis accelerometer, digital compass
CM supported: 7, 9, 10
Latest CM version: jellybean

How to Install CyanogenMod on the Sony Ericsson Xperia Ray (urushi)

Note: DISCLAIMER

Modifying or replacing your device’s software may void your device’s warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.

Important Notes

The Sony Ericsson Xperia Ray (aka urushi) is a touchscreen smartphone manufactured by Sony Ericsson. Official CyanogenMod support for the Sony Ericsson Xperia Ray was added in CyanogenMod 7.1.

Unlock your Xperia Ray

What does “unlocking” mean?

The first step in putting any custom operating system on your Xperia Ray is to unlock the bootloader. A bootloader is the very first program that runs when you turn on your device. The bootloader initializes some hardware and then loads the kernel and ramdisk, and gets the boot process going. If the bootloader is in locked mode, it will ensure that only the stock operating system can run. Since you will be installing your own operating system (CyanogenMod), you need to turn this off.

To unlock your bootloader, you’ll first need a program on your computer called adb. One way to get adb is to download and install the Android SDK (Software Developer Kit) from Google. The SDK is used by app developers when they’re writing programs for Android, and who knows, you may want to write apps someday.

Install the Android SDK

Download the SDK, per the steps on Google’s web page. Then install it by following the specific instructions for your computer.

Obtaining the Bootloader Unlock Code

Note:

Unlocking the bootloader on a Sony device may automatically wipe internal storage; a backup of the sdcard is suggested. It will also irreversibly erase the DRM keys stored in the TA partition of some devices, which will result in the loss of certain proprietary features that may have been included. Check your specific device forum on XDA to learn more.

In order to unlock the bootloader on your Xperia Ray you will need to obtain a code from Sony. The following process will help you acquire this code so that you can flash a custom recovery.

  1. Open the Phone application on the Xperia Ray and enter *#06# to obtain the device’s IMEI, IDID or MEID. Save this for later use.
    • Optional: if you do not have a phone app, the IMEI, IDID or MEID can be found on the box or on the device in Settings -> About Device -> Status.
  2. Put the device into fastboot mode:
    • Vol Up
  3. Open a terminal on the PC and enter fastboot getvar version
    • If you receive the message <waiting for device> fastboot is not configured properly, please see fastboot for more details.
  4. Navigate a browser here
    • Select your device and click the ‘continue’ button at the bottom of the page.
    • Enter your email address, agree to the terms and select ‘Submit’
    • Click the link from your email, enter your IMEI, IDID or MEID and continue
    • The unlock code should now appear, write this down for the next step.
  5. In the PC’s terminal, enter the following command: fastboot oem unlock 0xKEY
    • KEY corresponds to the unlock code you were given.

The Xperia Ray’s bootloader should now be unlocked.

Installing CyanogenMod on Sony Devices

  1. Download the CyanogenMod build package for your device that you’d like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  2. Extract boot.img from the zip to your computer, you will need this file for fastboot.
  3. Put the phone into fastboot mode:
    Vol Up
  4. Open a terminal on the PC with admin rights, access your platform-tools directory of the Android SDK, and enter the following:
    • fastboot flash boot boot.img
    • fastboot reboot
    While the device reboots, press the Volume rockers a few times to load recovery.
Note: Make the selection below based on the recovery version you see on your screen. If you’re installing CyanogenMod 11, you will have CWM Recovery. If installing CyanogenMod 12.0 or newer, you will have CyanogenMod Recovery.
Click here to continue instructions using CyanogenMod Recovery
Note: Once the device boots into CyanogenMod Recovery, use the physical volume buttons to move up and down. The home button is used to confirm your selection. The recovery is also touch screen friendly, so you can swipe up or down to scroll and tap the item you wish to select.
  1. Optional (Recommended): Using adb you can create a backup on your PC of your apps and app data. Boot the device into android and open a command prompt (or terminal on Mac and Linux) and enter the following:
    • adb backup -apk -all -f backup20161224.ab
    When the backup is complete return to recovery mode.
  2. On the device, select wipe data/factory reset.
  3. You have two options for installing the installation zip packages. (Note: The sideload method requires a recent version of adb to be working in recovery (adb bundled with ubuntu may have protocol errors):
    • Sideload method: Select apply update > apply update from adb. Open a command prompt (or Terminal on Mac and Linux) and enter adb sideload update.zip, where update.zip should be replaced with the package filename. If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Install update method: If you previously placed the installation zip packages on your internal storage, select apply update > choose from internal storage. Navigate to the directory where you placed the packages and select one. If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  4. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Note:

On all 2011 model Sony devices, the kernel will not update when flashed in recovery, so the kernel must be updated via fastboot every time you flash a new build of CyanogenMod.

Click here to continue instructions using CWM Recovery
Note:Once the device boots into ClockworkMod Recovery, use the physical volume buttons to move up and down. The home button is used to confirm your selection.
  1. Optional (Recommended): Select backup and restore to create a backup of your current ROM.
  2. Select wipe data/factory reset. If you get an error formatting /data, try format /data and /data/media from the mounts and storage menu
  3. You have two options for transferring and installing the installation zip packages. Both cases require a recent version of adb to be working in recovery (adb bundled with ubuntu may have protocol errors). The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an “Install complete.” message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 as a mountable volume, go ahead and mount it. If you do not see this directory, then instead mount the /data directory. Take note of which volume you mounted. Now, push the package(s) to your device:
    – If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    – If you mounted /data, then: adb push update.zip /sdcard/0/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  4. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Note:

On all 2011 model Sony devices, the kernel will not update when flashed in recovery, so the kernel must be updated via fastboot every time you flash a new build of CyanogenMod.

Helpful Tip

See something wrong on this page? Click here: Report a Site Problem.

How To Build CyanogenMod For Sony Ericsson Xperia Ray (urushi)

Introduction

These instructions will hopefully assist you to start with a stock Xperia Ray, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for CyanogenMod (based on Google’s Android operating system). Using these, you can build both CyanogenMod and CyanogenMod Recovery image from source code, and then install them both to your device.

It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.

Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home :) And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.

What you’ll need

  • A Xperia Ray
  • A relatively recent computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
  • A USB cable compatible with the Xperia Ray (typically micro USB, but older devices may use mini USB or have a proprietary 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 recovery. 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.

If you are not accustomed to using Linux– this is an excellent chance to learn. It’s free– just download and run a virtual machine (VM) such as Virtualbox, then install a Linux distribution such as Ubuntu (AOSP vets Ubuntu as well). Any recent 64-bit version should work great, but the latest is recommended.

Note:

You want to use a 64-bit version of Linux. A 32-bit Linux environment will only work if you are building CyanogenMod 6 and older. For CyanogenMod 10.1, if you encounter issues with 64bit host binaries, you can set BUILD_HOST_32bit=1 in your environment. This is generally not needed, though, especially with CyanogenMod 10.2 and newer.

Using a VM allows Linux to run as a guest inside your host computer– a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

So let’s begin!

Build CyanogenMod and CyanogenMod Recovery

Prepare the Build Environment

Note:

You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Prepare the device-specific code.

Install the SDK

If you have not previously installed adb and fastboot, install the Android SDK. “SDK” stands for Software Developer Kit, and it includes useful tools that you can use to flash software, look at the system logs in real time, grab screenshots, and more– all from your computer.

Helpful Tip

While the SDK contains lots of different things– the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

Install the Build Packages

Several “build packages” are needed to build CyanogenMod. You can install these using the package manager of your choice.

Helpful Tip

A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

For both 32-bit & 64-bit systems, you’ll need:

bc bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev

In addition to the above, for 64-bit systems, get these:

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

For Ubuntu 15.10 (wily) and newer, substitute:

  • lib32readline-gplv2-devlib32readline6-dev

For Ubuntu 16.04 (xenial) and newer, substitute (additionally see java notes below):

  • libwxgtk2.8-devlibwxgtk3.0-dev
  • openjdk-7-jdkopenjdk-8-jdk

Java versions: Different versions of CyanogenMod require different versions of the JDK (Java Development Kit):

  • CyanogenMod 7 – 9: Sun/Oracle Java SE 1.6
  • CyanogenMod 10.1: Sun/Oracle Java SE 1.6 or 1.7
  • CyanogenMod 10.2 – 11.0: Sun/Oracle Java SE 1.6 or 1.7 (OpenJDK 1.7 works fine, but the build system will display a warning)
  • CyanogenMod 12.0 – 13.0: OpenJDK 1.7 (see note about OpenJDK 1.8 below)
  • CyanogenMod 14.1: OpenJDK 1.8

Ubuntu 16.04 (Xenial Xerus) or newer and OpenJDK: Since OpenJDK 1.7 was removed from the official Ubuntu repositories, you have a couple options:

  1. Obtain OpenJDK 1.7 from the openjdk-r PPA
  2. Enable experimental OpenJDK 1.8 support in CyanogenMod 13.0 (not available in earlier version). To enable OpenJDK 1.8 support, add this line to your $HOME/.bashrc file: export EXPERIMENTAL_USE_JAVA8=true.

Also see http://source.android.com/source/initializing.html which lists needed packages.

Create the directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

Install the repo command

Enter the following to download the “repo” binary and make it executable (runnable):

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Put the ~/bin directory in your path of execution

In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Initialize the CyanogenMod source repository

Enter the following to initialize the repository:

Note: Make sure the cm branch entered here is the one you wish to build and is supported on your device.
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b jellybean

Download the source code

To start the download of all the source code to your computer:

$ repo sync

The CM manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire CM history.

Prepare to wait a long time while the source code downloads.

Helpful Tip

The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.

Get prebuilt apps (CM11 and below)

Next,

$ cd ~/android/system/vendor/cm

then enter:

$ ./get-prebuilts

You won’t see any confirmation- just another prompt. But this should cause some prebuilt apps to be loaded and installed into the source code. Once completed, this does not need to be done again.

Prepare the device-specific code

Helpful Tip – Errors during breakfast

Different maintainers setup their device inheritance rules differently. Some require a vendor directory to be populated before breakfast will even succeed. If you receive an error here about vendor makefiles, then jump down to the next section Extract proprietary blobs. The first portion of breakfast should have succeeded at pulling in the device tree and the extract blobs script should be available. After completing that section, you can rerun breakfast urushi

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

$ source build/envsetup.sh
$ breakfast urushi

This will download the device specific configuration and kernel source for your device. An alternative to using the breakfast command is to build your own local manifest. To do this, you will need to locate your device on CyanogenMod’s GitHub and list all of the repositories defined in cm.dependencies in your local manifest.

Helpful Tip

If you want to know more about what source build/envsetup.sh does or simply want to know more about the breakfast, brunch and lunch commands, you can head over to the Envsetup help page.

Helpful Tip

Instead of typing cd ~/android/system every time you want to return back to the root of the source code, here’s a short command that will do it for you: croot. To use this command, you must first run source build/envsetup.sh from ~/android/system.

Extract proprietary blobs

Now ensure that your Xperia Ray is connected to your computer via the USB cable and that you are in the ~/android/system/device/semc/urushi directory (you can cd ~/android/system/device/semc/urushi 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 ~/android/system/vendor/semc 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 a build of CyanogenMod for the branch you wish to build for the extract-files.sh script to function properly.

Note:

It’s important that these proprietary files are extracted to the ~/android/system/vendor/semc directory by using the extract-files.sh script. Makefiles are generated at the same time to make sure the blobs are eventually copied to the device. Without these blobs, CyanogenMod may build without error, but you’ll be missing important functionality, such as graphics libraries that enable you to see anything!

Turn on caching to speed up build

You can speed up subsequent builds by adding

export USE_CCACHE=1

to your ~/.bashrc file (what’s a .bashrc file?). Then, specify the amount of disk space to dedicate to ccache by typing this from the top of your Android tree:

prebuilts/misc/linux-x86/ccache/ccache -M 50G

where 50G corresponds to 50GB of cache. This only needs to be run once and the setting will be remembered. Anywhere in the range of 25GB to 100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s android build environment initialization page.

Helpful Tip

If you are a very active developer, working on many other projects than just Android, you might prefer to keep your Android ccache independent (because it’s huge and can slow down the efficiency of ccache in your other projects). Beginning with CyanogenMod 12.1, you can specify environment variables for the location and size of CyanogenMod’s ccache. Some syntax examples: export ANDROID_CCACHE_DIR="$HOME/android/.ccache" and export ANDROID_CCACHE_SIZE="50G".

Start the build

Time to start building! So now type:

$ croot
$ brunch urushi

The build should begin.

Helpful Tip

If the build doesn’t start, try lunch and choose your device from the menu. If that doesn’t work, try breakfast and choose from the menu. The command make urushi should then work.

Helpful Tip

A second, bonus tip! If you get a command not found error for croot, brunch, or lunch, be sure you’ve done the source build/envsetup.sh command in this Terminal session from the ~/android/system directory.

Helpful Tip

A third tip! If the build to fails while downloading Gello, you’ll need to import a missing certificate into Maven’s truststore. Detailed instructions on how to do that can be found here

If the build breaks…

  • If you experience this not-enough-memory-related error…
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/urushi/cm_urushi-ota-eng.root.zip] Error 1

…you may want to make the following change to ~/android/system/build/tools/releasetools/common.py:

Search for instances of -Xmx2048m (it should appear either under OPTIONS.java_args or near usage of signapk.jar), and replace it with -Xmx1024m or -Xmx512m.

Then start the build again (with brunch).

  • If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

Install the build

Assuming the build completed without error (it will be obvious when it finishes), type:

$ cd $OUT

in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called… kernel.

But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains CyanogenMod Recovery, and (2) cm-10-20161224-UNOFFICIAL-urushi.zip, which is the CyanogenMod installation package.

Install CyanogenMod

Back to the $OUT directory on your computer– you should see a file that looks something like:

cm-10-20161224-UNOFFICIAL-urushi.zip

Note:

The above file name may vary depending on the version of CM you are building. Your build may not include a version number or may identify itself as a “KANG” rather than UNOFFICIAL version. Regardless, the file name will end in .zip and should be titled similarly to official builds.

Now you can flash the cm...zip file above as usual via recovery mode. Before doing so, now is a good time to make a backup of whatever installation is currently running on the device in case something goes wrong with the flash attempt. While CyanogenMod Recovery doesn’t have a backup feature, there are other custom recoveries available that do. You can also use something like Titanium Backup (root required) as an alternative.

Success! So….what’s next?

You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.

Now that you’ve succeeded in building CyanogenMod for your device, here are some suggestions on what to do next.

Also, be sure to take a glance at the Dev Center on this wiki for all kinds of more detailed information about developer topics ranging from collecting logs, understanding what’s in the source code directories, submitting your own contributions, porting CyanogenMod to new devices, and a lot more.

Congrats again!

Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.