[Miscellaneous Android Development] mifl:
Compile Unofficial CyanogenMod 10 for Pantech Burst

To compile Unofficial CyanogenMod for Pantech Burst P9070 (presto), following the next steps.

1º - Prepare the Build Environment:

This step is based on the following tutorial: [Tutorial] Compile JB on Ubuntu - Thanks dastin1015.

A) Install Python and Git

:

$ sudo apt-get install python

$ sudo apt-get install git-core

B) Install Android SDK:

- Download the SDK here: http://developer.android.com/sdk/index.html

- Extract the SDK and place it in your home directory.

- I renamed my SDK to android-sdk to make it easier to navigate to.

- Go to your home folder, press Ctrl+H to show hidden files, and open up your .bashrc file.

- Add these lines at the bottom of the file:

# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin

- Find your .profile file and add this at the bottom of the file:

PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"

You have now successfully installed the Android SDK.

To check for updates issue this into your terminal:

$ android

C) Install required packages:

Building on Ubuntu 10.10/11.10:

$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils xsltproc

On Ubuntu 10.10:

$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so

On Ubuntu 11.10:

$ sudo apt-get install libx11-dev:i386

On newer versions of Ubuntu such as 11.10 you may need to do the following:

$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so

Building on Ubuntu 12.04/10:

$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386 \
pngcrush optipng

$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

D) Install Oracle Java 6:

To install Oracle Java 6 in Ubuntu via PPA: http://www.webupd8.org/2012/11/oracle-sun-java-6-installer-available.html

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java6-installer

After the installation, check the version of java, using the command:

$ java -version

Output console:

java version "1.6.0_38"
Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.13-b02, mixed mode)

Note:

The installed version of java, may have been updated, but should be kept in version 1.6.XX

Verify the symlinks:

$ ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar

Output console:

lrwxrwxrwx 1 root root 39 ene 17 08:02 /etc/alternatives/java -> /usr/lib/jvm/java-6-oracle/jre/bin/java
lrwxrwxrwx 1 root root 45 ene 17 08:02 /etc/alternatives/java.1.gz -> /usr/lib/jvm/java-6-oracle/man/man1/java.1.gz
lrwxrwxrwx 1 root root 36 ene 17 08:02 /etc/alternatives/javac -> /usr/lib/jvm/java-6-oracle/bin/javac
lrwxrwxrwx 1 root root 46 ene 17 08:02 /etc/alternatives/javac.1.gz -> /usr/lib/jvm/java-6-oracle/man/man1/javac.1.gz
lrwxrwxrwx 1 root root 38 ene 17 08:02 /etc/alternatives/javadoc -> /usr/lib/jvm/java-6-oracle/bin/javadoc
lrwxrwxrwx 1 root root 48 ene 17 08:02 /etc/alternatives/javadoc.1.gz -> /usr/lib/jvm/java-6-oracle/man/man1/javadoc.1.gz
lrwxrwxrwx 1 root root 36 ene 17 08:02 /etc/alternatives/javah -> /usr/lib/jvm/java-6-oracle/bin/javah
lrwxrwxrwx 1 root root 46 ene 17 08:02 /etc/alternatives/javah.1.gz -> /usr/lib/jvm/java-6-oracle/man/man1/javah.1.gz
lrwxrwxrwx 1 root root 36 ene 17 08:02 /etc/alternatives/javap -> /usr/lib/jvm/java-6-oracle/bin/javap
lrwxrwxrwx 1 root root 46 ene 17 08:02 /etc/alternatives/javap.1.gz -> /usr/lib/jvm/java-6-oracle/man/man1/javap.1.gz
lrwxrwxrwx 1 root root 42 ene 17 08:02 /etc/alternatives/java_vm -> /usr/lib/jvm/java-6-oracle/jre/bin/java_vm
lrwxrwxrwx 1 root root 41 ene 17 08:02 /etc/alternatives/javaws -> /usr/lib/jvm/java-6-oracle/jre/bin/javaws
lrwxrwxrwx 1 root root 47 ene 17 08:02 /etc/alternatives/javaws.1.gz -> /usr/lib/jvm/java-6-oracle/man/man1/javaws.1.gz
lrwxrwxrwx 1 root root 34 ene 17 08:02 /etc/alternatives/jar -> /usr/lib/jvm/java-6-oracle/bin/jar

E) Configure your USB

:

$ gksudo gedit /etc/udev/rules.d/51-android.rules

Inside of this blank text file insert:

#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"

#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"

#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"

#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"

#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"

#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"

#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"

#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"

#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"

#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"

#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"

#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"

#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"

#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"

#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"

#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"

#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"

#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"

#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"

#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"

#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"

#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"

#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"

#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"

#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"

#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"

#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"

#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"

Save the file and close it and then issue this command:

$ sudo chmod a+r /etc/udev/rules.d/51-android.rules

2º - Create the Directories

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

Note:

For the next steps, I modified the installation path sources, because in this way you can include other repositories (CAF, AOSP, etc ...).

To create them:

mkdir -p ~/bin
mkdir -p ~/android
mkdir -p ~/android/cyanogenmod
mkdir -p ~/android/cyanogenmod/jellybean

3º - Install the repo:

Enter the following to download make executable the "repo" binary:

curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

Note

:

You may need to reboot for these changes to take effect.

4º - Install the CM10 Repository:

Now enter the following to initialize the CyanogenMod repository:

cd ~/android/cyanogenmod/jellybean/
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
repo sync -j16

5º - Obtain the presto device tree:

Create/Edit a file with the name roomservice.xml in the ".repo/local_manifests/" directory. To see this directory, you have to press Ctrl-H in your file manager.

mkdir -p ~/android/cyanogenmod/jellybean/.repo/local_manifests/
gedit ~/android/cyanogenmod/jellybean/.repo/local_manifests/roomservice.xml

Add these lines

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="PantechDevTeam/android_device_pantech_presto" path="device/pantech/presto" remote="github" revision="jellybean" />
<project name="PantechDevTeam/android_device_pantech_qcom-common" path="device/pantech/qcom-common" remote="github" revision="jellybean" />
<project name="PantechDevTeam/android_device_pantech_msm8660-common" path="device/pantech/msm8660-common" remote="github" revision="jellybean" />
<project name="PantechDevTeam/android_kernel_pantech_p9070" path="kernel/pantech/p9070" remote="github" revision="jellybean" />
</manifest>

Synchronize the repositories:

cd ~/android/cyanogenmod/jellybean/
repo sync

6º - Copy proprietary files:

Option 1

:

To compile pantech presto, connect the device to the computer and ensure that ADB is working properly.

cd ~/android/cyanogenmod/jellybean/device/pantech/presto
./extract-files.sh

Option 2

:

You can also include the repository with the necessary files for complilación:

gedit ~/android/cyanogenmod/jellybean/.repo/local_manifests/roomservice.xml

Add this line

<project name="PantechDevTeam/android_vendor_pantech_presto" path="vendor/pantech/presto" remote="github" revision="jellybean" />

Synchronize the repositories:

cd ~/android/cyanogenmod/jellybean/
repo sync

7º - Download RomManager

Note

:

This only needs to be done when an update to RomManager is released. If you are-up-to date, you may skip to Building CyanogenMod.

Download RomManager which is needed by the build:

~/android/cyanogenmod/jellybean/vendor/cm/get-prebuilts

8º - Building CyanogenMod

First, check for updates in the source:

cd ~/android/cyanogenmod/jellybean/
repo sync

Now, the environment must be configured to build and the ROM compiled.

. build/envsetup.sh && brunch presto

9º - Install

If you're a little crazy, and at your own risk, you can complete the installation:

Copy your .zip file from ~/android/cyanogenmod/jellybean/out/target/product/presto/cm-10-XXXXX-UNOFFICIAL-presto.zip to the root of the SD card.

Optional

: Download Google Apps for CyanogenMod 10 and place it on the root of the SD card.

Flash both of these .zip files from recovery.

-----------------------------------------------------------------------------------------

Update:

In CyanogenMod, ~/.repo/local_manifest.xml file has been changed to ~/.repo/local_manifests/roomservice.xml

----------------------------------------------------------------------------------------------------------------

Greetings.