[DEV + HOWTO] KangXperiaProject - AOKP for Xperia (tutorial to compile from source)

Which phone you own


  • Total voters
    1,256
Search This thread

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
CONTENTS

Post #1 = General Info
Post #2 = [TUTORIAL] How to Compile AOKP for any Xperia phone
Post #3 = KangXperiaProject ROM threads list

================================================================================================

WHAT is KangXperiaProject ??
We (that is KangXperiaProject Team) have tried to create a buildable source tree from which anyone can build AOKP for the Xperia line of devices

This is a combined work of all team members. (Supervenom , Championswimmer, Stelios97, Daveee10, Pikpok)

CREDITS
It is very important to mention here that nothing, yes i repeat NOTHING was possible without the awesome work done by FreeXperia team for the community. For all 2011 devices we are using their device trees almost untouched. So all the hardware work (making camera, sensors, gralloc, hardware acceleration etc work flawlessly) is purely the credit of FreeXperiaTeam (FXP, bin4ry, defer and Kali- )
If there is anyone whom you really need to thank for Xperia devices being able to run CM9/AOSP/AOKP/MIUI or whatever non-stock ROMs it's the great people like :
ZdZihu, FXP, Bin4ry, defer, Kali-, KeiranFTW, DoomLord, Androxyde, Achotjan, Azuzu and many many more.

The only thing that KXP team has done is made the devices and vendor trees fit into the groove of AOKP source tree and manage a buildable environment. Our contribution in KXP ROMs is much much less as compared to the contribution of Team Kang and Team FreeXperia. (Ofcourse on older devices we had to work a lot becuase FXP does not support them anymore)


GET YOUR AOKP ROM FOR XPERIA
Scroll down to Post#3 to see a list of AOKP ROMs available for Xperia phones (that are compiled from KXP source tree).

STATUS OF REPOS

The platform_manifest and source trees we maintain are usually always up-to-date. We can guarantee that the sources are usually always 'buildable' (i.e. the compilation will always be error-free if our source tree is used) but we cannot always guarantee that the builds that you compile will be 'bootable'. This is mainly because we do not own all the devices and hence cannot test if builds are booting or not. Whenever bugs are reported, we try to fix them if our scope of knowledge allows us to.

As of 22 August 2012
KXP-AOKP JB Repo : -
- repo can be synced
- buildable for all these devices
Code:
Arc/ArcS          aokp_anzu-userdebug
Live with Walkman aokp_coconut-userdebug
Mini              aokp_smultron-userdebug
Mini Pro          aokp_mango-userdebug
Active            aokp_satsuma-userdebug
S                 aokp_nozomi-userdebug
Acro S            aokp_hikari-userdebug
Neo               aokp_hallon-userdebug
Neo V             aokp_haida-userdebug
Play              aokp_zeus-userdebug
Play(CDMA)        aokp_zeusc-userdebug
Ray               aokp_urushi-userdebug
Pro               aokp_iyokan-userdebug
- all builds shall be bootable, but there might be enough bugs to not make it usable daily
KXP-AOKP ICS Repo : -
not actively maintained anymore, repo may not be buildable. we are working ONLY on JB now
- repo can be synced
- buildable for all these devices
Code:
Arc/ArcS          aokp_anzu-userdebug
Ray               aokp_urushi-userdebug
Neo               aokp_haida-userdebug
Neo(V)            aokp_hallon-userdebug
Pro               aokp_iyokan-userdebug
Play              aokp_zeus-userdebug
Play(CDMA)        aokp_zeusc-userdebug
Live with Walkman aokp_coconut-userdebug
Mini              aokp_smultron-userdebug
Mini Pro          aokp_mango-userdebug
Active            aokp_satsuma-userdebug
X10               aokp_es-userdebug09ra-userdebug
X8                aokp_shakira-userdebug
X10 MiniPro       aokp_robyn-userdebug
X10 Mini          aokp_mimmi-userdebug
- all builds are bootable
 
Last edited:

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
I'd like to give a quick rundown on how to compile AOKP from sources for all Xperia devices.

The KangXperiaProject had been working for past few weeks to try to set up and maintain a buildable repo for AOKP on all Xperia phones.

The skeleton of this tutorial is taken largely from this thread

This tutorial assumes that you are using Ubuntu (prefer to use 64 bit). If you use some other Linux distro then there might be minor changes in the way the environment is setup. Figure that out yourself ;)

Source code is about 10GB in size. One single build will take about 8GB (10+8=18). For a full set of builds and for building for multiple devices i HIGHLY recommend more than 100 GB of free space on your harddrive.

1) You need the following:
-JDK 6 if you wish to build Ice Cream Sandwich. You can download it from java.sun.com. Or:
Code:
$ sudo apt-get install   sun-java6-jdk
-Python 2.4 -- 2.7, which you can download from python.org. Or:
Code:
$ sudo apt-get install python
-Git 1.7 or newer. You can find it at git-scm.com. Or:
Code:
$ sudo apt-get install   git-core
2) Install required packages. 64-bit (recommended)
Code:
$ 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
On newer versions of Ubuntu such as 11.10 you may need to do the following:
Code:
$ sudo ln -s   /usr/lib/i386-linux-gnu/libX11.so.6   /usr/lib/i386-linux-gnu/libX11.so
if you wish to use adb for debugging or logging your builds you need to perform the steps hidden below.

3) Configure your USB.
Code:
$  gksudo gedit  /etc/udev/rules.d/51-android.rules
Inside of this blank text file insert:
Code:
#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"

[COLOR=Red]#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"[/COLOR]

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

#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"
4) Save the file and close it and then issue this command:
Code:
$ sudo chmod a+r   /etc/udev/rules.d/51-android.rules
the line in red is most important, the other lines are not important if you are using adb only for xperia phones




5) Install the repo:
Code:
$  mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
restart your PC or log off and log on


6) Choose work directory:

Code:
$ mkdir -p ~/android/kxp 
$ cd ~/android/kxp
(the working directory could be anything you like. ~/android/kxp is an example)

7. Initialize the repo

Code:
$ repo init -u https://github.com/KangXperiaProject/platform_manifest.git -b jb
NOTE : to compile for ICS, use "-b ics" instead of "-b jb"
Only JB is maintained actively now. ICS repos are buildable but not anymore maintained.

7) When prompted, enter your real name and email address.

8) Gather the files:
Code:
Code:
$ repo sync -j1
if you have fast internet, you can use -j8 or -j16 for faster sync
total source will be around 10GB in size. please be patient


9) Compiling:
after complete sync
create the environment

Code:
 $ . build/envsetup.sh
now choose your device

Code:
$ lunch
pick your device according to the following list
Code:
Arc/ArcS          aokp_anzu-userdebug
Ray               aokp_urushi-userdebug
Neo               aokp_haida-userdebug
Neo(V)            aokp_hallon-userdebug
Pro               aokp_iyokan-userdebug
Play              aokp_zeus-userdebug
Play(CDMA)        aokp_zeusc-userdebug
Live with Walkman aokp_coconut-userdebug
Mini              aokp_smultron-userdebug
Mini Pro          aokp_mango-userdebug
Active            aokp_satsuma-userdebug
X10               aokp_es-userdebug09ra-userdebug
X8                aokp_shakira-userdebug
X10 MiniPro       aokp_robyn-userdebug
X10 Mini          aokp_mimmi-userdebug
S                 aokp_nozomi-userdebug


Now start the build process

Code:
mka -j4 otapackage
yes it's "mka" not "make"
you can obviously use make instead of mka but mka is faster and optimized specially for android building.
NOTE: the -j# number should be double the number of cores of your CPU (the CPU of the PC on which you are building)
Thus if you are on a quad core build machine use -j8

If compilation (i.e. the last step) takes too much time for your comfort, you can see this article written by cyanogenmod devs Koush and aremcee to make compile time less :)

After everybuild, we need to clean the directory... do it like this
Code:
 cd ~/android/kxp 
make clobber

("make clean" also works)

Before next build, sync repo again to get latest changes
Code:
repo sync -j2

Now build again
Code:
. build/envsetup.sh
lunch
Code:
mka -j4 otapackage
 
Last edited:

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
AOKP(JB 4.1.1) ROMs for Xperia Phones
(which are maintined by KXP team members/friends)

Xperia Mini/MiniPro/Active/LiveWALKMAN
Xperia S
Xperia Acro S
Xperia Arc / Arc S
Xperia Ray
Xperia Play
Xperia Pro
Xperia Neo
Xperia Neo V


AOKP(ICS4.0.4) ROMs for Xperia Phones
(which are maintined by KXP team members/friends)

Xperia Arc / Arc S
Xperia Neo [cooked and optimized by kormatoes]
Xperia Neo(v) [cooked and optimized by kormatoes]
Xperia Ray
Xperia Pro
Xperia Play (GSM/CDMA)
Xperia Mini/MiniPro/Live/Active
Xperia X10
Xperia X8
Xperia X10 Mini
Xperia X10 MiniPro
 
Last edited:

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
Great thread

Sent from my Xperia neo using XDA Premium HD app
you can also begin making native builds for neo/neov using this method if you want...
haida and hallon are already present in the working tree and are buildable (as of now we do not make builds for hallon/haida because we do not want two aokp threads for same device ;) )... but you and your team can anytime start building aokp from source using our trees, and we would be very happy :)
 
  • Like
Reactions: thomiSvK

kormatoes

Senior Member
you can also begin making native builds for neo/neov using this method if you want...
haida and hallon are already present in the working tree and are buildable (as of now we do not make builds for hallon/haida because we do not want two aokp threads for same device ;) )... but you and your team can anytime start building aokp from source using our trees, and we would be very happy :)

I need new pc bro ubunto it's not the best on it I will have a play tonight with it thanks for your great words much love Chris

Sent from my Xperia neo using XDA Premium HD app
 

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
can you push aplha build for JEllY BEAN from sorces ?
maybe a week from now we can start doing that...
devices like Ray, Arc and Neo already have a stable milestone6 so next builds for these devices will be jellybean only

early builds MAY NOT be bootable, or have too many bugs to be usable...
also AOKP team have not properly set up a jb repo completely yet.
i myself have started the repo sync process for jb... it'll take me about 7-8 hours to complete the sync as i have slow internet...
jb repo is not buildable right now as it is pure aosp atm and to make xperia devices buildable many changes need to be committed ;)

i also want to make it clear here that people like me, supervenom and pikpok are just "schoolboys" we are no major developers and cannot make hardware libraries from ground-up
we depend heavily on freexperia team's device and vendor source trees. the ics trees will provide a start but we will need some changes to that to make it 100% working and we do not know if our team of noobs can pull it off :)
and also it's hard to develop without devices... (supervenom owns an Xperia Play and I own an Xperia X10, while pikpok owns LiveWalkman... none of us own any hdpi 2011 device like ray, neo or arc)
 
Last edited:

kormatoes

Senior Member
On Ubuntu for 5 mins already want to smash it lol uploadfromtaptalk1342089381825.jpguploadfromtaptalk1342089381825.jpg
Champ and me on talk so I can ask you ridiculous amount of questions jk lol

Sent from my Xperia neo using XDA Premium HD app
 

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
On Ubuntu for 5 mins already want to smash it lolView attachment 1193140View attachment 1193140
Champ and me on talk so I can ask you ridiculous amount of questions jk lol

Sent from my Xperia neo using XDA Premium HD app
look at your pm ;)

btw i use an even older notebook than yours :)

1.6ghz dual core, 4gb ram and 4mbps download speed.... my environment is worse than yours ha ha ha... but well... i have to make do with it...
it put the repo sync all over night and put mka otapackage when i go for lunch/swimming practice/hanging out with friends ha ha ...
also my upload takes 2-3 hours...

but after first compilation, from next time time will be very less...

also repo sync takes long only first time.. from next time it'll only update and so it'll be only 5-10 minutes...
 
  • Like
Reactions: kormatoes

justmpm

Retired Senior Moderator
Dec 22, 2010
4,221
4,869
Jumpston Junction
look at your pm ;)

btw i use an even older notebook than yours :)

1.6ghz dual core, 4gb ram and 4mbps download speed.... my environment is worse than yours ha ha ha... but well... i have to make do with it...
it put the repo sync all over night and put mka otapackage when i go for lunch/swimming practice/hanging out with friends ha ha ...
also my upload takes 2-3 hours...

but after first compilation, from next time time will be very less...

also repo sync takes long only first time.. from next time it'll only update and so it'll be only 5-10 minutes...

Since I am going to have to set up a Ubuntu partition anyway...does it matter which version of ubuntu I install....I saw in some JellyBean threads that some versions are not "guaranteed" supported......
 
  • Like
Reactions: kormatoes

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
Since I am going to have to set up a Ubuntu partition anyway...does it matter which version of ubuntu I install....I saw in some JellyBean threads that some versions are not "guaranteed" supported......
i am running 12.04 so i can "guarantee" that 12.04 at least will not fail to build this :)

jdk6 might be a pain in the a$$ but there are workarounds to install this found on google.... (this problem is common to all ubuntu distros)
 
Last edited:

justmpm

Retired Senior Moderator
Dec 22, 2010
4,221
4,869
Jumpston Junction
I am getting an error during the sync: Exited sync due to fetch errors

First I tried: repo sync -j8 and that failed after 3-4 hours

Then I deleted the working dir, made a new one and tried: repo sync -j16
That failed after about 1 hour....

Thinking back on it, I probably should have tried a slower and not a faster download....ehhhh, what
can I say...patience was all gone.....

Not sure what I should do...I looked in google for a fix and it didn't seem like there was a
more or less universal fix.....
 

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
I am getting an error during the sync: Exited sync due to fetch errors

First I tried: repo sync -j8 and that failed after 3-4 hours

Then I deleted the working dir, made a new one and tried: repo sync -j16
That failed after about 1 hour....

Thinking back on it, I probably should have tried a slower and not a faster download....ehhhh, what
can I say...patience was all gone.....

Not sure what I should do...I looked in google for a fix and it didn't seem like there was a
more or less universal fix.....
do NOT delete your working directory on bad syncs
just kill the terminal window, restart terminal, cd to working directory and run "repo sync -j#" again :) it will resume from where it left

i personally use -j2 and that's what i would suggest you to use too :)
i often have sync errors, i just restart sync and it finishes :)
 
  • Like
Reactions: justmpm

Top Liked Posts

  • There are no posts matching your filters.
  • 43
    CONTENTS

    Post #1 = General Info
    Post #2 = [TUTORIAL] How to Compile AOKP for any Xperia phone
    Post #3 = KangXperiaProject ROM threads list

    ================================================================================================

    WHAT is KangXperiaProject ??
    We (that is KangXperiaProject Team) have tried to create a buildable source tree from which anyone can build AOKP for the Xperia line of devices

    This is a combined work of all team members. (Supervenom , Championswimmer, Stelios97, Daveee10, Pikpok)

    CREDITS
    It is very important to mention here that nothing, yes i repeat NOTHING was possible without the awesome work done by FreeXperia team for the community. For all 2011 devices we are using their device trees almost untouched. So all the hardware work (making camera, sensors, gralloc, hardware acceleration etc work flawlessly) is purely the credit of FreeXperiaTeam (FXP, bin4ry, defer and Kali- )
    If there is anyone whom you really need to thank for Xperia devices being able to run CM9/AOSP/AOKP/MIUI or whatever non-stock ROMs it's the great people like :
    ZdZihu, FXP, Bin4ry, defer, Kali-, KeiranFTW, DoomLord, Androxyde, Achotjan, Azuzu and many many more.

    The only thing that KXP team has done is made the devices and vendor trees fit into the groove of AOKP source tree and manage a buildable environment. Our contribution in KXP ROMs is much much less as compared to the contribution of Team Kang and Team FreeXperia. (Ofcourse on older devices we had to work a lot becuase FXP does not support them anymore)


    GET YOUR AOKP ROM FOR XPERIA
    Scroll down to Post#3 to see a list of AOKP ROMs available for Xperia phones (that are compiled from KXP source tree).

    STATUS OF REPOS

    The platform_manifest and source trees we maintain are usually always up-to-date. We can guarantee that the sources are usually always 'buildable' (i.e. the compilation will always be error-free if our source tree is used) but we cannot always guarantee that the builds that you compile will be 'bootable'. This is mainly because we do not own all the devices and hence cannot test if builds are booting or not. Whenever bugs are reported, we try to fix them if our scope of knowledge allows us to.

    As of 22 August 2012
    KXP-AOKP JB Repo : -
    - repo can be synced
    - buildable for all these devices
    Code:
    Arc/ArcS          aokp_anzu-userdebug
    Live with Walkman aokp_coconut-userdebug
    Mini              aokp_smultron-userdebug
    Mini Pro          aokp_mango-userdebug
    Active            aokp_satsuma-userdebug
    S                 aokp_nozomi-userdebug
    Acro S            aokp_hikari-userdebug
    Neo               aokp_hallon-userdebug
    Neo V             aokp_haida-userdebug
    Play              aokp_zeus-userdebug
    Play(CDMA)        aokp_zeusc-userdebug
    Ray               aokp_urushi-userdebug
    Pro               aokp_iyokan-userdebug
    - all builds shall be bootable, but there might be enough bugs to not make it usable daily
    KXP-AOKP ICS Repo : -
    not actively maintained anymore, repo may not be buildable. we are working ONLY on JB now
    - repo can be synced
    - buildable for all these devices
    Code:
    Arc/ArcS          aokp_anzu-userdebug
    Ray               aokp_urushi-userdebug
    Neo               aokp_haida-userdebug
    Neo(V)            aokp_hallon-userdebug
    Pro               aokp_iyokan-userdebug
    Play              aokp_zeus-userdebug
    Play(CDMA)        aokp_zeusc-userdebug
    Live with Walkman aokp_coconut-userdebug
    Mini              aokp_smultron-userdebug
    Mini Pro          aokp_mango-userdebug
    Active            aokp_satsuma-userdebug
    X10               aokp_es-userdebug09ra-userdebug
    X8                aokp_shakira-userdebug
    X10 MiniPro       aokp_robyn-userdebug
    X10 Mini          aokp_mimmi-userdebug
    - all builds are bootable
    28
    I'd like to give a quick rundown on how to compile AOKP from sources for all Xperia devices.

    The KangXperiaProject had been working for past few weeks to try to set up and maintain a buildable repo for AOKP on all Xperia phones.

    The skeleton of this tutorial is taken largely from this thread

    This tutorial assumes that you are using Ubuntu (prefer to use 64 bit). If you use some other Linux distro then there might be minor changes in the way the environment is setup. Figure that out yourself ;)

    Source code is about 10GB in size. One single build will take about 8GB (10+8=18). For a full set of builds and for building for multiple devices i HIGHLY recommend more than 100 GB of free space on your harddrive.

    1) You need the following:
    -JDK 6 if you wish to build Ice Cream Sandwich. You can download it from java.sun.com. Or:
    Code:
    $ sudo apt-get install   sun-java6-jdk
    -Python 2.4 -- 2.7, which you can download from python.org. Or:
    Code:
    $ sudo apt-get install python
    -Git 1.7 or newer. You can find it at git-scm.com. Or:
    Code:
    $ sudo apt-get install   git-core
    2) Install required packages. 64-bit (recommended)
    Code:
    $ 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
    On newer versions of Ubuntu such as 11.10 you may need to do the following:
    Code:
    $ sudo ln -s   /usr/lib/i386-linux-gnu/libX11.so.6   /usr/lib/i386-linux-gnu/libX11.so
    if you wish to use adb for debugging or logging your builds you need to perform the steps hidden below.

    3) Configure your USB.
    Code:
    $  gksudo gedit  /etc/udev/rules.d/51-android.rules
    Inside of this blank text file insert:
    Code:
    #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"
    
    [COLOR=Red]#Sony Ericsson
    SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"[/COLOR]
    
    #Toshiba
    SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
    
    #ZTE
    SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"
    4) Save the file and close it and then issue this command:
    Code:
    $ sudo chmod a+r   /etc/udev/rules.d/51-android.rules
    the line in red is most important, the other lines are not important if you are using adb only for xperia phones




    5) Install the repo:
    Code:
    $  mkdir ~/bin
    $ PATH=~/bin:$PATH
    $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
    $ chmod a+x ~/bin/repo
    restart your PC or log off and log on


    6) Choose work directory:

    Code:
    $ mkdir -p ~/android/kxp 
    $ cd ~/android/kxp
    (the working directory could be anything you like. ~/android/kxp is an example)

    7. Initialize the repo

    Code:
    $ repo init -u https://github.com/KangXperiaProject/platform_manifest.git -b jb
    NOTE : to compile for ICS, use "-b ics" instead of "-b jb"
    Only JB is maintained actively now. ICS repos are buildable but not anymore maintained.

    7) When prompted, enter your real name and email address.

    8) Gather the files:
    Code:
    Code:
    $ repo sync -j1
    if you have fast internet, you can use -j8 or -j16 for faster sync
    total source will be around 10GB in size. please be patient


    9) Compiling:
    after complete sync
    create the environment

    Code:
     $ . build/envsetup.sh
    now choose your device

    Code:
    $ lunch
    pick your device according to the following list
    Code:
    Arc/ArcS          aokp_anzu-userdebug
    Ray               aokp_urushi-userdebug
    Neo               aokp_haida-userdebug
    Neo(V)            aokp_hallon-userdebug
    Pro               aokp_iyokan-userdebug
    Play              aokp_zeus-userdebug
    Play(CDMA)        aokp_zeusc-userdebug
    Live with Walkman aokp_coconut-userdebug
    Mini              aokp_smultron-userdebug
    Mini Pro          aokp_mango-userdebug
    Active            aokp_satsuma-userdebug
    X10               aokp_es-userdebug09ra-userdebug
    X8                aokp_shakira-userdebug
    X10 MiniPro       aokp_robyn-userdebug
    X10 Mini          aokp_mimmi-userdebug
    S                 aokp_nozomi-userdebug


    Now start the build process

    Code:
    mka -j4 otapackage
    yes it's "mka" not "make"
    you can obviously use make instead of mka but mka is faster and optimized specially for android building.
    NOTE: the -j# number should be double the number of cores of your CPU (the CPU of the PC on which you are building)
    Thus if you are on a quad core build machine use -j8

    If compilation (i.e. the last step) takes too much time for your comfort, you can see this article written by cyanogenmod devs Koush and aremcee to make compile time less :)

    After everybuild, we need to clean the directory... do it like this
    Code:
     cd ~/android/kxp 
    make clobber

    ("make clean" also works)

    Before next build, sync repo again to get latest changes
    Code:
    repo sync -j2

    Now build again
    Code:
    . build/envsetup.sh
    lunch
    Code:
    mka -j4 otapackage
    13
    AOKP(JB 4.1.1) ROMs for Xperia Phones
    (which are maintined by KXP team members/friends)

    Xperia Mini/MiniPro/Active/LiveWALKMAN
    Xperia S
    Xperia Acro S
    Xperia Arc / Arc S
    Xperia Ray
    Xperia Play
    Xperia Pro
    Xperia Neo
    Xperia Neo V


    AOKP(ICS4.0.4) ROMs for Xperia Phones
    (which are maintined by KXP team members/friends)

    Xperia Arc / Arc S
    Xperia Neo [cooked and optimized by kormatoes]
    Xperia Neo(v) [cooked and optimized by kormatoes]
    Xperia Ray
    Xperia Pro
    Xperia Play (GSM/CDMA)
    Xperia Mini/MiniPro/Live/Active
    Xperia X10
    Xperia X8
    Xperia X10 Mini
    Xperia X10 MiniPro
    4
    On the last action, to build, isn't the make to use instead of mka ? typo ?
    nope buddy... it's mka only... you can use make too ... but mka is faster ;)
    4
    That error was because of my stupidity sorry for that
    But now im heaving real error right now i was about thee hours in to building and then this pops out

    Code:
    Finding NOTICE files: out/target/product/hallon/obj/NOTICE_FILES/hash-timestamp
    Combining NOTICE files: out/target/product/hallon/obj/NOTICE.html
    Installed file list: out/target/product/hallon/installed-files.txt
    Target system fs image: out/target/product/hallon/obj/PACKAGING/systemimage_intermediates/system.img
    Install system fs image: out/target/product/hallon/system.img
    Package target files: out/target/product/hallon/obj/PACKAGING/target_files_intermediates/aokp_hallon-target_files-eng.tenacious.zip
    Package OTA: out/target/product/hallon/aokp_hallon-ota-eng.tenacious.zip
    device/semc/msm7x30-common/releasetools/semc_ota_from_target_files -v \
    	   -p out/host/linux-x86 \
    	   -k build/target/product/security/testkey \
    	   --no_assert=false \
    	   --backup=true \
    	   --override_device=MT15i,MT15a,hallon \
    	   out/target/product/hallon/obj/PACKAGING/target_files_intermediates/aokp_hallon-target_files-eng.tenacious.zip out/target/product/hallon/aokp_hallon-ota-eng.tenacious.zip
    
    Given a target-files zipfile, produces an OTA package that installs
    that build.  An incremental OTA is produced if -i is given, otherwise
    a full OTA is produced.
    
    Usage:  ota_from_target_files [flags] input_target_files output_ota_package
    
      -b  (--board_config)  <file>
          Deprecated.
    
      -k (--package_key) <key> Key to use to sign the package (default is
          the value of default_system_dev_certificate from the input
          target-files's META/misc_info.txt, or
          "build/target/product/security/testkey" if that value is not
          specified).
    
          For incremental OTAs, the default value is based on the source
          target-file, not the target build.
    
      -i  (--incremental_from)  <file>
          Generate an incremental OTA using the given target-files zip as
          the starting build.
    
      -w  (--wipe_user_data)
          Generate an OTA package that will wipe the user data partition
          when installed.
    
      -n  (--no_prereq)
          Omit the timestamp prereq check normally included at the top of
          the build scripts (used for developer OTA packages which
          legitimately need to go back and forth).
    
      -e  (--extra_script)  <file>
          Insert the contents of file at the end of the update script.
    
      -a  (--aslr_mode)  <on|off>
          Specify whether to turn on ASLR for the package (on by default).
    
      --backup <boolean>
          Enable or disable the execution of backuptool.sh.
          Disabled by default.
    
      --override_device <device>
          Override device-specific asserts. Can be a comma-separated list.
    
      -p  (--path)  <dir>
          Prepend <dir>/bin to the list of places to search for binaries
          run by this script, and expect to find jars in <dir>/framework.
    
      -s  (--device_specific) <file>
          Path to the python module containing device-specific
          releasetools code.
    
      -x  (--extra)  <key=value>
          Add a key/value pair to the 'extras' dict, which device-specific
          extension code may look at.
    
      -v  (--verbose)
          Show command lines being executed.
    
      -h  (--help)
          Display this usage message and exit.
    
    ** option --no_assert not recognized **
    make: *** [out/target/product/hallon/aokp_hallon-ota-eng.tenacious.zip] Error 2

    to make it permanent fix, just comment
    # --no_assert=false \

    it's in /build/core/MakeFile at line around 1200