[Miscellaneous Android Development] mifl:
Compile AOSP Codeaurora for Pantech Burst P9070 (presto)

To compile AOSP Codeaurora for Pantech Burst P9070 (presto) - "REVISION I", 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 lib32readline-gplv2-dev schedtool lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils

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.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android
$ mkdir -p ~/android/codeaurora
$ mkdir -p ~/android/codeaurora/ics

Note

:

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

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 Codeaurora ICS Repository:

Now enter the following to initialize the Codeaurora repository:

cd ~/android/codeaurora/ics/
$ repo init -u git://codeaurora.org/platform/manifest.git -b ics
$ repo sync -j16

Note

:

Remember that the repository, usually requests a username and password.

5º - Obtain proprietary kernel:

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

$ gedit ~/android/codeaurora/ics/.repo/local_manifest.xml.

Add these lines

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="aosp" fetch="https://android.googlesource.com/"/>
<remote name="github" fetch="https://github.com/"/>
<!-- Kernel Pantech presto -->
<remove-project name="kernel/msm"/>
<project name="mifl/android_kernel_pantech_p9070" path="kernel" remote="github" revision="master"/>
</manifest>

Note

:

The third and fourth lines, allows you to add repositories: Github and AOSP.

The sixth and seventh lines, if all goes well, delete the repository kernel, and replace it with the official Pantech kernel.

6º - Copy proprietary files:

Unzip the file "vendor-blobs-rev2.zip" attached to the end of the post. In the root: device/qcom/msm8660_surf

To extract proprietary files, connect the device to the computer and ensure that ADB is working properly.

$ cd ~/android/codeaurora/ics/device/qcom/msm8660_surf
$ ./extract-files.sh

Note

:

The file "proprietary-files.txt" can fail depending on the version of Android, you have installed on your device.You should add to the list, You should add to the list the files that are necessary for compilation.

7º - Necessary changes:

These are needed to include the files created in the previous step.

Add these lines, if not already included, to the end of the file: "device/qcom/msm8660_surf/msm8660_surf.mk":

#============================================

# Also get non-open-source specific aspects if available
$(call inherit-product, vendor/qcom/proprietary/common/msm8660_surf/device-vendor.mk)

Add these lines, if not already included, to the end of the file: "device/qcom/msm8660_surf/BoardConfig.mk":

#============================================

# Also get non-open-source specific aspects if available
-include vendor/qcom/proprietary/common/msm8660_surf/BoardConfigVendor.mk

Note

:

Check each time you synchronize the repository, the lines are on your site.

In these two files, you can include your own code, for example (BT, WI-FI, etc ...).

Part of what is necessary, changing the routes vendor directory, you can find it here: https://github.com/mifl/android_device_pantech_presto.

Working method

:

Changes for BoardConfig.mk files, you must make in the file "vendor/qcom/proprietary/common/msm8660_surf/board-presto.mk".

Changes for device.mk files, you must make in the file "vendor/qcom/proprietary/common/msm8660_surf/device-presto.mk".

These two files are created by the script ". / Extract-files.sh". If the files exist, when you run the script again, does not modify the changes you in them before.

Example

:

Copy from here: https://github.com/mifl/android_device_pantech_presto/blob/jellybean/BoardConfig.mk:

# Headers path
TARGET_SPECIFIC_HEADER_PATH: = device/pantech/presto/include

In "vendor/qcom/proprietary/common/msm8660_surf/board-presto.mk", paste and replace the route. It should look like this:

# Headers path
TARGET_SPECIFIC_HEADER_PATH: = vendor/qcom/proprietary/common/msm8660_surf/include

Now copy the files in the folder /include. To download the entire repository: https://github.com/mifl/android_device_pantech_presto/archive/jellybean.zip

8º - Building ROM

First, check for updates in the source:

$ cd ~/android/codeaurora/ics/
$ repo sync

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

$ source build/envsetup.sh
$ lunch msm8660_surf-userdebug
$ make -j4 KERNEL_DEFCONFIG=msm8660-perf-PRESTO_TP20_defconfig

9º - Install

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

Copy your .zip file from ~/android/codeaurora/ics/out/target/product/msm8660_surf/msm8660_surf-ota-XXX.zip to the root of the SD card.

Flash both of these .zip files from recovery.

Note

:

This last step is unconfirmed, google search for how to.

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

Final note

This guide is part of a project I started some time ago. If you find errors, make every effort to solve them by yourself.

To find more information visit:

https://www.codeaurora.org/gitweb/quic/la/.

https://www.codeaurora.org/xwiki/bin/QAEP/.

Greetings.

P.D.

:

Specially dedicated to our friend "mrakattack". I hope this guide will be useful.