[GUIDE][AOSPA:v3.+] How to Compile AOSPA from Source : + Support and Maintenance

Status
Not open for further replies.
Search This thread

Slimegod

Senior Member
Mar 12, 2011
2,300
99
I need a opinion on something. I'm trying to build AOSP for my Sprint galaxy s3 using this, https://github.com/SuperNexus/android_manifest. I know I have to build the kernel for my device. Is this a good guild to follow http://jhshi.me/2014/06/30/build-kernel-in-tree-with-aosp-for-nexus-5-hammerhead/. Also if you have any other advice on building it I can use it. Its way different from building cm. I came across this link doing because I was getting a particular error when it's in the building stage of my kernel. The error was "no rule to make target d2_config". I built my kernel separately and added it to the kernel/samsung directory. Any help, thanks.
 
Last edited:

tecno789

Senior Member
Feb 27, 2015
337
33
Milan
Hi, I am trying to compile paranoid for g2 mini, so I would like to know, after having a properly device tree, how have I change to make it compatible with this Rom.. Which files have I change?

Thanks in advanced
 

someone755

Senior Member
Sep 27, 2011
2,048
1,380
Ljubljana
I need a opinion on something. I'm trying to build AOSP for my Sprint galaxy s3 using this, https://github.com/SuperNexus/android_manifest. I know I have to build the kernel for my device. Is this a good guild to follow http://jhshi.me/2014/06/30/build-kernel-in-tree-with-aosp-for-nexus-5-hammerhead/. Also if you have any other advice on building it I can use it. Its way different from building cm. I came across this link doing because I was getting a particular error when it's in the building stage of my kernel. The error was "no rule to make target d2_config". I built my kernel separately and added it to the kernel/samsung directory. Any help, thanks.

Make sure the file "d2_config" exists in your kernel's arch/arm/configs directory. If not, make the necessary changes either to the config's name or the ROM build makefile pointing to that config.
Either that or, if you'd rather use the prebuilt kernel, place it somewhere in your device tree, then point the makefile to it, removing any and all references to the kernel built alongside the ROM. (A nice example of how to do the latter can be seen in omnirom's android_device_sony_leo tree commits.)

Hi, I am trying to compile paranoid for g2 mini, so I would like to know, after having a properly device tree, how have I change to make it compatible with this Rom.. Which files have I change?

Thanks in advanced

Now if you'd just look at the first post in the thread, that's where your answer is.
 

Slimegod

Senior Member
Mar 12, 2011
2,300
99
Make sure the file "d2_config" exists in your kernel's arch/arm/configs directory. If not, make the necessary changes either to the config's name or the ROM build makefile pointing to that config.
Either that or, if you'd rather use the prebuilt kernel, place it somewhere in your device tree, then point the makefile to it, removing any and all references to the kernel built alongside the ROM. (A nice example of how to do the latter can be seen in omnirom's android_device_sony_leo tree commits.)

Yeah it dawned on my that that's what I was missing.
 

smartAgent47

Senior Member
Jan 1, 2013
550
552
Mumbai
Code:
target StaticLib: libc_aeabi (out/target/product/nicki/obj/STATIC_LIBRARIES/libc_aeabi_intermediates/libc_aeabi.a)
target StaticLib: libc_bionic (out/target/product/nicki/obj/STATIC_LIBRARIES/libc_bionic_intermediates/libc_bionic.a)
target StaticLib: libc_cxa (out/target/product/nicki/obj/STATIC_LIBRARIES/libc_cxa_intermediates/libc_cxa.a)
target StaticLib: libc_dns (out/target/product/nicki/obj/STATIC_LIBRARIES/libc_dns_intermediates/libc_dns.a)
target StaticLib: libc_freebsd (out/target/product/nicki/obj/STATIC_LIBRARIES/libc_freebsd_intermediates/libc_freebsd.a)
target StaticLib: libc_gdtoa (out/target/product/nicki/obj/STATIC_LIBRARIES/libc_gdtoa_intermediates/libc_gdtoa.a)
target StaticLib: libc_malloc (out/target/product/nicki/obj/STATIC_LIBRARIES/libc_malloc_intermediates/libc_malloc.a)
target StaticLib: libc_netbsd (out/target/product/nicki/obj/STATIC_LIBRARIES/libc_netbsd_intermediates/libc_netbsd.a)
target StaticLib: libc_openbsd (out/target/product/nicki/obj/STATIC_LIBRARIES/libc_openbsd_intermediates/libc_openbsd.a)
target StaticLib: libc_stack_protector (out/target/product/nicki/obj/STATIC_LIBRARIES/libc_stack_protector_intermediates/libc_stack_protector.a)
target StaticLib: libc_syscalls (out/target/product/nicki/obj/STATIC_LIBRARIES/libc_syscalls_intermediates/libc_syscalls.a)
target StaticLib: libc_tzcode (out/target/product/nicki/obj/STATIC_LIBRARIES/libc_tzcode_intermediates/libc_tzcode.a)
target StaticLib: libm (out/target/product/nicki/obj/STATIC_LIBRARIES/libm_intermediates/libm.a)
target StaticLib: libfs_mgr (out/target/product/nicki/obj/STATIC_LIBRARIES/libfs_mgr_intermediates/libfs_mgr.a)
target thumb C: liblogwrap <= system/core/logwrapper/logwrap.c
target StaticLib: libcutils (out/target/product/nicki/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a)
Export includes file: external/pcre/Android.mk -- out/target/product/nicki/obj/STATIC_LIBRARIES/libpcre_intermediates/export_includes
make: *** No rule to make target `out/target/product/nicki/obj/STATIC_LIBRARIES/libminshacrypt_intermediates/libminshacrypt.a', needed by `out/target/product/nicki/obj/STATIC_LIBRARIES/libselinux_intermediates/libselinux.a'.  Stop.
make: *** Waiting for unfinished jobs....
target StaticLib: liblog (out/target/product/nicki/obj/STATIC_LIBRARIES/liblog_intermediates/liblog.a)

#### make failed to build some targets (58 seconds) ####

Please Help someone ...
 

alteredlikeness

Senior Member
Mar 2, 2012
2,454
5,472
reflecting on Indra's net
Copied from G+ for visibility:

Looking for some assistance with my AOSPA-L builds for spyder/umts_spyder. I can't install or update _certain_ apps from Play Store, error -506: INSTALL_FAILED_CONTAINER_ERROR: Failed to extract native libraries

I know I need this commit, otherwise I can't install anything from Play Store: https://github.com/CyanogenMod/andr...mmit/a394f4a423a5977553e3159fd6e0f3d5f808c6e8

I was able to make a 5.0 alpha build with the AOSPA-legacy sources before they were retired, and didn't have this -506 error. I have been digging around for a week, and still haven't found a solution. Any help would be greatly appreciated.

Log:
Code:
D/Finsky  ( 2601): [1] DownloadImpl.setState: jackpal.androidterm from QUEUED to DOWNLOADING.
D/Finsky  ( 2601): [1] DownloadQueueImpl.onStart: jackpal.androidterm: onStart
D/Finsky  ( 2601): [1] DownloadQueueImpl.notifyProgress: jackpal.androidterm: onProgress 0/-1 Status: 190.
D/DownloadManager( 2999): [144] Starting
D/Finsky  ( 2601): [1] DownloadQueueImpl.notifyProgress: jackpal.androidterm: onProgress 0/-1 Status: 192.
W/ResourceType( 1180): Failure getting entry for 0x010406e3 (t=3 e=1763) (error -75)
W/Resources( 1180): Converting to string: TypedValue{t=0x1/d=0x10406e3 a=-1 r=0x10406e3}
W/DownloadManager( 2999): fallocate() not supported; falling back to ftruncate()
I/Timeline( 2601): Timeline: Activity_idle id: [email protected] time:2622872
D/DownloadManager( 2999): [144] Finished with status SUCCESS
D/Finsky  ( 2601): [1] DownloadBroadcastReceiver.onReceive: Intent received at DownloadBroadcastReceiver
D/Finsky  ( 2601): [1] DownloadQueueImpl.notifyProgress: jackpal.androidterm: onProgress 320232/320232 Status: 200.
D/Finsky  ( 2601): [1] DownloadImpl.setState: jackpal.androidterm from DOWNLOADING to SUCCESS.
D/Finsky  ( 2601): [1] DownloadQueueImpl.onComplete: jackpal.androidterm: onComplete
D/Finsky  ( 2601): [1] DownloadQueueImpl.remove: Download jackpal.androidterm removed from DownloadQueue
I/installd(  191): free_cache(0) avail 1024114688
D/Finsky  ( 2601): [1] InstallerTask.startCopyFromDownload: Prepare to copy jackpal.androidterm (jackpal.androidterm) from content://downloads/my_downloads/144 (expect 564672 bytes)
V/Herrevad( 2011): NQAS connected
I/installd(  191): free_cache(564672) avail 1024114688
D/Finsky  ( 2601): [1] 7.onPostExecute: Successfully copied APK to update jackpal.androidterm (jackpal.androidterm)
D/Finsky  ( 2601): [1] InstallerTask.startInstaller: Begin install of jackpal.androidterm
W/        (  561): Zip: unable to allocate space for file to 13496: Operation not supported on transport endpoint
W/zipro   (  561): ExtractToMemory failed with I/O Error
I/NativeLibraryHelper(  561): Failed uncompressing libjackpal-termexec2.so to /data/app/vmdl2077642233.tmp/lib/arm/tmp.LvCGJY
W/NativeHelper(  561): Failure copying native libraries [errorCode=-18]
E/PackageInstaller(  561): Commit of session 2077642233 failed: Failed to extract native libraries, res=-18
E/Finsky  ( 2601): [1] PackageInstallerImpl.handleCommitCallback: Error -506 while installing jackpal.androidterm: INSTALL_FAILED_CONTAINER_ERROR: Failed to extract native libraries, res=-18
W/Finsky  ( 2601): [1] 3.installFailed: Install failure of jackpal.androidterm: -506 null
D/Finsky  ( 2601): [1] InstallerTask.cancelCleanup: Cancel running installation of jackpal.androidterm (jackpal.androidterm)
D/Finsky  ( 2601): [1] PackageInstallerImpl.innerCreateSession: Created session 137104376 for jackpal.androidterm
W/OpenGLRenderer( 1180): Incorrectly called buildLayer on View: DismissViewButton, destroying layer...
V/WindowManager(  561): not Base app: Adding window Window{3759faf8 u0 com.android.vending/com.google.android.finsky.activities.MainActivity} at 9 of 13
 

OfficerJimLahey

Retired Forum Moderator
Feb 12, 2014
2,716
1,306
Sunnyvale
www.chebucto.ns.ca
These errors are killing me now, all was fine and dandy til new commits

Code:
target thumb C: libOmxQcelp13Enc <= hardware/qcom/audio-caf/mm-audio/aenc-qcelp13/qdsp6/src/aenc_svr.c
In file included from hardware/qcom/audio-caf/mm-audio/aenc-aac/qdsp6/src/omx_aac_aenc.cpp:41:0:
hardware/qcom/audio-caf/mm-audio/aenc-aac/qdsp6/inc/omx_aac_aenc.h:52:34: fatal error: QOMX_AudioExtensions.h: No such file or directory
compilation terminated.
make: *** [/raid/Ayysir/pa/out/target/product/d2tmo/obj/SHARED_LIBRARIES/libOmxAacEnc_intermediates/src/omx_aac_aenc.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from hardware/qcom/audio-caf/mm-audio/aenc-qcelp13/qdsp6/src/aenc_svr.c:35:0:
hardware/qcom/audio-caf/mm-audio/aenc-qcelp13/qdsp6/inc/aenc_svr.h:39:0: warning: "LOG_TAG" redefined [enabled by default]
In file included from frameworks/native/include/utils/Log.h:31:0,
                 from hardware/qcom/audio-caf/mm-audio/aenc-qcelp13/qdsp6/inc/aenc_svr.h:36,
                 from hardware/qcom/audio-caf/mm-audio/aenc-qcelp13/qdsp6/src/aenc_svr.c:35:
system/core/include/cutils/log.h:68:0: note: this is the location of the previous definition
In file included from hardware/qcom/audio-caf/mm-audio/aenc-amrnb/qdsp6/src/omx_amr_aenc.cpp:41:0:
hardware/qcom/audio-caf/mm-audio/aenc-amrnb/qdsp6/inc/omx_amr_aenc.h:53:34: fatal error: QOMX_AudioExtensions.h: No such file or directory
compilation terminated.
make: *** [/raid/Ayysir/pa/out/target/product/d2tmo/obj/SHARED_LIBRARIES/libOmxAmrEnc_intermediates/src/omx_amr_aenc.o] Error 1
In file included from hardware/qcom/audio-caf/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp:41:0:
hardware/qcom/audio-caf/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h:52:34: fatal error: QOMX_AudioExtensions.h: No such file or directory
compilation terminated.
make: *** [/raid/Ayysir/pa/out/target/product/d2tmo/obj/SHARED_LIBRARIES/libOmxEvrcEnc_intermediates/src/omx_evrc_aenc.o] Error 1
In file included from hardware/qcom/audio-caf/mm-audio/aenc-qcelp13/qdsp6/src/omx_qcelp13_aenc.cpp:41:0:
hardware/qcom/audio-caf/mm-audio/aenc-qcelp13/qdsp6/inc/omx_qcelp13_aenc.h:52:34: fatal error: QOMX_AudioExtensions.h: No such file or directory
compilation terminated.
make: *** [/raid/Ayysir/pa/out/target/product/d2tmo/obj/SHARED_LIBRARIES/libOmxQcelp13Enc_intermediates/src/omx_qcelp13_aenc.o] Error 1
Error: make failed with error code 2

Yeah, fixed with last commit to media.
Keep an eye on it though, I'd honestly revert the last 2 commits to that if you have problems again down the road.
(Another change to msm8960-common could break it again)

to circumvent til i can test further is that i used evervolv's audio-caf

I read ahead a little bit, but I could not find any newer information about this problem. I tried EverVolv's audio-caf, but they must have synced with upstream since your post. So I still have the same problem:

Code:
target thumb C++: libOmxAacEnc <= hardware/qcom/audio-caf/mm-audio/aenc-aac/qdsp6/src/omx_aac_aenc.cpp
In file included from hardware/qcom/audio-caf/mm-audio/aenc-aac/qdsp6/src/omx_aac_aenc.cpp:41:0:
hardware/qcom/audio-caf/mm-audio/aenc-aac/qdsp6/inc/omx_aac_aenc.h:52:34: fatal error: QOMX_AudioExtensions.h: No such file or directory
compilation terminated.
build/core/binary.mk:384: recipe for target '/home/joel/cm-10.1/out/target/product/doubleshot/obj/SHARED_LIBRARIES/libOmxAacEnc_intermediates/src/omx_aac_aenc.o' failed
make: *** [/home/joel/cm-10.1/out/target/product/doubleshot/obj/SHARED_LIBRARIES/libOmxAacEnc_intermediates/src/omx_aac_aenc.o] Error 1
make: *** Waiting for unfinished jobs....

Any way around it while keeping caf? Thanks.

P.S. Sorry for digging up an ancient post.
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 210
    NOTE: The method explained here is to be followed for compiling ParanoidAndroid v3.+
    The process is WIP.
    Feel free to try & compile, post your results/errors here. Community effort would make this a lot faster.
    :)

    WELCOME TO PARANOIDANDROID
    Source Compilation Guide v3.+


    pax3u3k.png



    Hello, & welcome to a complete reference guide on compiling ParanoidAndroid from source!
    I've been getting a lot of mails & PMs, asking for help on PA compilation. I could only help 3 of them, after which, it wasn't feasible for me.
    So, here we are, as promised! :cowboy:

    This guide will walk you through each & every step involved in compiling the ROM, right after the stage of installing Ubuntu.
    This is to help you all explore your own development domains. :)

    Remember, I'm NOT responsible if something, or anything goes wrong at your end, on any device or system.




    I, & others, will try & help you out whenever possible. If there's some delay, don't whine or complain, just have patience & you'll be helped.
    I can't practically reach out to everybody, but I'll try my best.

    So, with that,
    Good Luck :good:





    ------------------Pre-requisites------------------


    Make sure you have:

    • Ubuntu 12.04 (Precise Pangolin) 64-bit
    • Decent Computer, with at least 4GB RAM
    • Decent Internet (Trust me... you DON'T want to do this on a 512 kbits connection...)
    • Functional Device Tree, Hardware tree, Kernel source tree for your device
    • Device with support for latest CM10.2/AOSP 4.3 Jellybean




    ------------------Steps Involved------------------


    Step 1: Download the sources

    Step 2: Add device support to PA, & Builiding ROM

    Step 3: The After-life: Git, Gerrit, Patch Submissions





    ------------------Lets Start :cowboy: ------------------

    STEP 1: Downloading the Sources


    For the curious kind, here's some theoretical information:

    Before compiling any ROM, we need some basic 'stuffs', or tools if you may.
    In short, here's what we need:

    1) Compile Dependencies (libs)
    2) Python 2.7.3
    3) Java JDK 6.xx
    4) Android SDK
    5) USB Configs
    6) Git, Repo
    7) Project Sources
    8) CM10.2/JellyBean Device Tree
    9) Device Kernel Tree
    10) Device Hardware sources
    11) Device Vendor Proprietaries




    # Install OpenSSL, for Python:
    Code:
    $ sudo apt-get install libssl1.0.0=1.0.1-4ubuntu5.3
    $ sudo apt-get install libssl-dev


    # Install Dependencies:

    There are some dependencies that might not be useful. But just in case, I'm gonna give you all dependencies that any Android compilation would need. Its better than facing errors while compiling.


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


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



    # Configure USB:

    1) Open/Create file 51-android.rules:
    Code:
    $ gksudo gedit /etc/udev/rules.d/51-android.rules

    -> Add these lines:

    Code:
    #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"


    2) Save & Close

    3) Set proper permisisons: (Provide read permission to all users, in addition to whatever other permissions are pre-set)
    Code:
    $ sudo chmod a+r /etc/udev/rules.d/51-android.rules


    # JAVA JDK Installation:

    1) Download & keep aside the latest Oracle Java 6 JDK. (I dislike OpenJDK. Feel free to use it if you prefer that ;) )
    Remember: WE NEED JAVA 6, not any other version (5 or 7 etc). Or this will not work for you.

    http://www.oracle.com/technetwork/java/javase/downloads/jdk6-downloads-1637591.html

    2) Remove other JAVA Packages:

    Code:
    $ sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*

    3) Install JAVA JDK:

    Code:
    $ sudo mkdir -p /opt/java/64/
    $ sudo cp jdk-6u[COLOR="Red"]##[/COLOR]-linux-x64.bin /opt/java/64
    $ sudo su -
    $ cd /opt/java/64
    $ chmod +x jdk-6u[COLOR="red"]##[/COLOR]-linux-x64.bin
    $ ./jdk-6u[COLOR="red"]##[/COLOR]-linux-x64.bin
    $ exit

    REPLACE THE HASHes (#) WITH YOUR VERSION NUMBER.

    -> Save & Exit

    4) Add JDK PATH to .bashrc:

    Code:
    $ gksudo gedit ~/.bashrc

    -> Add these lines:

    Code:
    # Java PATHs
    export JAVA_HOME=/opt/java/64/jdk1.6.0_[COLOR="red"]##[/COLOR]
    export PATH=$PATH:$JAVA_HOME/bin

    REPLACE THE HASHes (#) WITH YOUR VERSION NUMBER.


    # Python Installation:

    For Python installation, I give you two choices. Pick whichever you like. But pick ANY ONE.

    Option 1: Direct package installation: (Easy way)
    Code:
    $ sudo apt-get install python

    -----OR------

    Option 2: Self compile Python from source: (Advanced way. Not recommended if you have no experience with software compilation)

    1) Download Python 2.7.3:

    http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz

    -> For 2.7 you need to explicitly enable SSL after running the ./configure script and before running make:

    2) Configure Python:

    Code:
    $ ./configure

    3) Navigate to & open Modules/Setup.
    There are lines like this:

    Code:
    #SSL=/usr/local/ssl
    #_ssl _ssl.c \
    #       -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
    #       -L$(SSL)/lib -lssl -lcrypto

    4) Uncomment these lines and change the SSL variable to /usr:

    Code:
    SSL=/usr
    _ssl _ssl.c \
           -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
           -L$(SSL)/lib -lssl -lcrypto

    5) Install Python:

    Code:
    $ make
    $ sudo make install

    6) Add Python PATH to .bashrc:
    Code:
    $ gksudo gedit .bashrc

    -> Add these lines:
    Code:
    # Python
    export PATH=/usr/bin:$PATH
    -> Save & Exit


    # Android SDK:

    1) Download the SDK here:

    http://developer.android.com/sdk/index.html

    2) Extract the SDK and place it in your home directory.

    3) Add AndroidSDK PATH to .bashrc:
    Code:
    $ gksudo gedit .bashrc

    -> Add the following lines:
    Code:
    # Android tools
    export PATH=${PATH}:~/android-sdk/tools
    export PATH=${PATH}:~/android-sdk/platform-tools
    export PATH=${PATH}:~/bin
    ->Save & Exit

    4) Add PATH to .profile:
    Code:
    $ gksudo gedit .profile

    -> Add these lines:
    Code:
    PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"
    -> Save & Exit


    *To use the ADB Update software (or to verify a working adb path), use the following command:

    Code:
    $ android


    # 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


    # Initialize the ParanoidAndroid Repo:

    Code:
    $ mkdir android
    $ cd android
    $ mkdir system
    $ cd system
    $ repo init -u git://github.com/ParanoidAndroid/manifest.git -b [B]jb43-legacy[/B]



    VERY IMPORTANT: Now, before the final stage sync, make sure there's no code referring to 'ParanoidPreferences' in manifest.

    To check that

    1) Open your File Browser,
    2) Press Ctrl+H (to show hidden files/directories)
    3) Navigate to android/system/.repo/manifest.xml
    (Right Click & open the XML file in text editor)

    *REMOVE ANY 'PARANOIDPREFERENCES' CODE FROM MANIFEST*
    *REMOVE GROUPER DEVICE TREE FROM MANIFEST* (This'll be useless, unless you're compiling for Grouper: Nexus 7)


    -> Now, Lets add the device specific trees:


    Add your own device tree, kernel tree, hardware source tree, & vendor proprietaries tree in the local manifest.

    For this, create a new file .repo/local_manifest.xml, & use something in similar terms:

    For example, I'm using all corresponding trees for Samsung Galaxy S3 i9300 - International
    Following is just an example, not what you should copy/paste. SEARCH & USE YOUR OWN DEVICE SPECIFIC TREES.
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
      <project name="ParanoidAndroid/android_device_samsung_i9300" path="device/samsung/i9300" remote="github" revision="cm-10.2" />
      <project name="CyanogenMod/android_kernel_samsung_smdk4412" path="kernel/samsung/smdk4412" remote="github" revision="cm-10.2" />
      <project name="ParanoidAndroid/android_device_samsung_smdk4412-common" path="device/samsung/smdk4412-common" remote="github" revision="cm-10.2" />
      <project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="cm-10.2" />
      <project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="cm-10.2" />
      <project name="CyanogenMod/android_hardware_samsung" path="hardware/samsung" remote="github" revision="cm-10.2" />
    </manifest>

    CAUTION: Your device tree, kernel source, vendor props etc WILL be different. Search & find out where your device specific sources are located.



    # Sync the Repo
    Code:
    $ repo sync [COLOR="Red"]<-parameters->[/COLOR]

    Now, here's a reference to the repo sync parameters:

    “make” command has ‘-j’ option to run multi jobs parallely. “repo sync” has similar option, too.
    Let’s examine command line help:

    Code:
    $ [B]repo sync[/B] [COLOR="Red"]-h[/COLOR]
    Usage: repo sync [...]
    
    Options:
      [COLOR="red"]-h[/COLOR], [COLOR="red"]--help[/COLOR]            show this help message and exit
      [COLOR="red"]-f[/COLOR], [COLOR="red"]--force-broken[/COLOR]    continue sync even if a project fails to sync
      [COLOR="red"]-l[/COLOR], [COLOR="red"]--local-only[/COLOR]      only update working tree, don't fetch
      [COLOR="red"]-n[/COLOR], [COLOR="red"]--network-only[/COLOR]    fetch only, don't update working tree
      [COLOR="red"]-d[/COLOR], [COLOR="red"]--detach[/COLOR]          detach projects back to manifest revision
      [COLOR="red"]-q[/COLOR], [COLOR="red"]--quiet[/COLOR]           be more quiet
      [COLOR="red"]-j[/COLOR][COLOR="SeaGreen"]JOBS[/COLOR], [COLOR="red"]--jobs[/COLOR]=[COLOR="SeaGreen"]JOBS[/COLOR]   number of projects to fetch simultaneously
      [COLOR="red"]-s[/COLOR], [COLOR="red"]--smart-sync[/COLOR]      smart sync using manifest from a known good build
    
      repo Version options:
        [COLOR="red"]--no-repo-verify[/COLOR]    do not verify repo source code

    So, for instance, if you want to run 8 fetching jobs parallelly,
    Code:
    $ repo sync [COLOR="Red"]-j[/COLOR][COLOR="SeaGreen"]8[/COLOR]

    I personally use -j4, due to my awful internet. You may use any no. of jobs value, like -j16.
    This can reduce the download time. However, this'll suck lots of the bandwidth of the network. Just so you know ;)



    Now that you have the sources, its time to deal with the precompilation & compilation steps :cowboy:
    Move on to Post 2.



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


    Credits:

    - molesarecoming
    - D4rKn3sSyS
    - dastin1015
    - Perka
    - pmos69
    - ProTekk (Rootzwiki)
    95
    STEP 2: Adding device support to PA, & Building ROM:

    STEP 2: Adding device support to PA, & Building ROM:

    I've tried to provide you a basic guideline. You might need to make some changes according to the files/device you have.
    If your device already has the support, skip to Instruction to compile the ROM.

    NOTE: Throughout this guide, I'll be using the device name as '<device>', & in red. So, if the device is 'pa_i9100', I'm using a generic name: 'pa_<device>'. This means, replace the red <device> with your device name, as per your JellyBean Device Tree


    After you've the complete source, you need some prebuilts & additional props, & the script needs to know of the existence of the device (<device>) you want to compile for.

    For additional prebuilts & props extraction, look for a extraction script.
    In some devices, we have 'extract-files.sh', in others we have 'proprietary-files.sh'. There might be other names for the script as well. Just go through make sure you know which one it is.

    For example, in case of Galaxy S3 i9300:

    You get to the device source, by navigating to android/system/device/samsung/i9300/, & using the script: "proprietary-files.sh"
    Here's what you do:

    1) Connect your device, running working CM10/AOSP JB, with Android Debugging ACTIVATED.

    2) Make the script executable, after cd to device/samsung/i9300:
    Code:
    $ cd android/system/device/[COLOR="red"]samsung[/COLOR]/[COLOR="red"]i9300[/COLOR]
    $ chmod +x [COLOR="Red"]proprietary-files.sh[/COLOR]

    3) Execute the script, in terminal:
    Code:
    $ ./[COLOR="red"]proprietary-files.sh[/COLOR]

    ----------------------------------------------------DEVICE SPECIFIC CHANGES----------------------------------------------------

    Next, here's an overview of what PA needs you to do to allow compilation for your device:


    (Everything here is to be done under /vendor/pa)

    * Create /manifest/<device>.adds
    * Create /manifest/<device>.removes
    * Create /prebuilt/pa_<device>.conf
    * Create /products/pa_<device>.mk
    * Add device makefile entry to /products/AndroidProducts.mk
    * Create /vendorprops/<device>.proprietaries
    * Add device lunch menu entry to /vendorsetup.sh



    Again, lets start:

    # Create /manifest/<device>.adds:

    I'll give you two examples of .adds, to show the general extent of variation between devices:

    For i9300:
    Code:
    [
        {
            "remote":       "github",
            "account":      "CyanogenMod",
            "repository":   "android_frameworks_av",
            "target_path":  "frameworks/av",
            "revision":     "cm-10.1"
        },
        {
            "remote":       "github",
            "account":      "CyanogenMod",
            "repository":   "android_frameworks_native",
            "target_path":  "frameworks/native",
            "revision":     "cm-10.1"
        },
        {
            "remote":       "github",
            "account":      "CyanogenMod",
            "repository":   "android_hardware_libhardware",
            "target_path":  "hardware/libhardware",
            "revision":     "cm-10.1"
        },
        {
            "remote":       "github",
            "account":      "CyanogenMod",
            "repository":   "android_hardware_libhardware_legacy",
            "target_path":  "hardware/libhardware_legacy",
            "revision":     "cm-10.1"
        },
        {
            "remote":       "github",
            "account":      "CyanogenMod",
            "repository":   "android_frameworks_opt_telephony",
            "target_path":  "frameworks/opt/telephony",
            "revision":     "cm-10.1"
        },
        {
            "remote":       "github",
            "account":      "CyanogenMod",
            "repository":   "android_device_common",
            "target_path":  "device/common",
            "revision":     "cm-10.1"
        },
        {
            "remote":       "github",
            "account":      "CyanogenMod",
            "repository":   "android_device_generic_armv7-a-neon",
            "target_path":  "device/generic/armv7-a-neon",
    	"revision":     "cm-10.1"
        },
        {
            "remote":       "github",
            "account":      "CyanogenMod",
            "repository":   "android_device_generic_common",
            "target_path":  "device/generic/common",
            "revision":     "cm-10.1"
        }
    ]

    For bravo:
    Code:
    [
        {
            "remote":       "github",
            "account":      "WoH",
            "repository":   "android_bionic",
            "target_path":  "bionic",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_external_wpa_supplicant_8",
            "target_path":  "external/wpa_supplicant_8",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_frameworks_av",
            "target_path":  "frameworks/av",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "WoH",
            "repository":   "android_frameworks_base",
            "target_path":  "frameworks/base",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_frameworks_native",
            "target_path":  "frameworks/native",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_atheros",
            "target_path":  "hardware/atheros",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_gpsshim",
            "target_path":  "hardware/gpsshim",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_libhardware",
            "target_path":  "hardware/libhardware",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_libhardware_legacy",
            "target_path":  "hardware/libhardware_legacy",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_ril",
            "target_path":  "hardware/ril",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_audio",
            "target_path":  "hardware/qcom/audio",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_audio-legacy",
            "target_path":  "hardware/qcom/audio-legacy",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_bt",
            "target_path":  "hardware/qcom/bt",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_camera",
            "target_path":  "hardware/qcom/camera",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_display",
            "target_path":  "hardware/qcom/display",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_display-caf",
            "target_path":  "hardware/qcom/display-caf",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_display-legacy",
            "target_path":  "hardware/qcom/display-legacy",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_gps",
            "target_path":  "hardware/qcom/gps",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_gps-legacy",
            "target_path":  "hardware/qcom/gps-legacy",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_keymaster",
            "target_path":  "hardware/qcom/keymaster",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_media",
            "target_path":  "hardware/qcom/media",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_media-legacy",
            "target_path":  "hardware/qcom/media-legacy",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_power",
            "target_path":  "hardware/qcom/power",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_sensors",
            "target_path":  "hardware/qcom/sensors",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_hardware_qcom_wlan",
            "target_path":  "hardware/qcom/wlan",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_system_bluetooth",
            "target_path":  "system/bluetooth",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "WoH",
            "repository":   "android_system_core",
            "target_path":  "system/core",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_system_extras",
            "target_path":  "system/extras",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_system_security",
            "target_path":  "system/security",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_system_vold",
            "target_path":  "system/vold",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "WoH",
            "repository":   "android_frameworks_opt_telephony",
            "target_path":  "frameworks/opt/telephony",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_device_common",
            "target_path":  "device/common",
            "revision":     "jellybean"
        },
        {
            "remote":       "github",
            "account":      "CyanogenMod",
            "repository":   "android_device_generic_armv7-a-neon",
            "target_path":  "device/generic/armv7-a-neon",
            "revision":     "cm-10.1"
        },
        {
            "remote":       "github",
            "account":      "CyanogenMod",
            "repository":   "android_device_generic_common",
            "target_path":  "device/generic/common",
            "revision":     "cm-10.1"
        },
        {
            "remote":       "github",
            "account":      "Evervolv",
            "repository":   "android_device_generic_goldfish",
            "target_path":  "device/generic/goldfish",
            "revision":     "jellybean"
        }
    ]

    You may use the i9300 as the base .adds, & make changes, add/remove/modify as per your device requirements.


    # Create /manifest/<device>.removes:

    Another example based explanation:

    For i9300:
    Code:
    [
        {
            "name":     "platform/frameworks/av",
            "path":     "frameworks/av"
        },
        {
            "name":     "ParanoidAndroid/android_frameworks_native",
            "path":     "frameworks/native"
        },
        {
            "name":     "platform/hardware/libhardware",
            "path":     "hardware/libhardware"
        },
        {
            "name":     "platform/hardware/libhardware_legacy",
            "path":     "hardware/libhardware_legacy"
        },
        {
            "name":     "device/common",
            "path":     "device/common"
        },
        {
            "name":     "ParanoidAndroid/android_frameworks_opt_telephony",
            "path":     "frameworks/opt/telephony"
        }
    ]

    For bravo:
    Code:
    [
        {
            "name":     "ParanoidAndroid/android_bionic",
            "path":     "bionic"
        },
        {
            "name":     "platform/external/wpa_supplicant_8",
            "path":     "external/wpa_supplicant_8"
        },
        {
            "name":     "platform/frameworks/av",
            "path":     "frameworks/av"
        },
        {
            "name":     "ParanoidAndroid/android_frameworks_base",
            "path":     "frameworks/base"
        },
        {
            "name":     "ParanoidAndroid/android_frameworks_native",
            "path":     "frameworks/native"
        },
        {
            "name":     "platform/hardware/ril",
            "path":     "hardware/ril"
        },
        {
            "name":     "platform/hardware/libhardware",
            "path":     "hardware/libhardware"
        },
        {
            "name":     "platform/hardware/libhardware_legacy",
            "path":     "hardware/libhardware_legacy"
        },
        {
            "name":     "platform/system/bluetooth",
            "path":     "system/bluetooth"
        },
        {
            "name":     "ParanoidAndroid/android_system_core",
            "path":     "system/core"
        },
        {
            "name":     "platform/system/extras",
            "path":     "system/extras"
        },
        {
            "name":     "platform/system/security",
            "path":     "system/security"
        },
        {
            "name":     "platform/system/vold",
            "path":     "system/vold"
        },
        {
            "name":     "device/common",
            "path":     "device/common"
        },
        {
            "name":     "ParanoidAndroid/android_frameworks_opt_telephony",
            "path":     "frameworks/opt/telephony"
        }
    ]

    Basically, you need to remove the official manifest bits that you replaced/overlayed using the <device>.adds, for your device


    # Create /prebuilt/pa_<device>.conf:

    -> For an HDPI device, use the pa_hdpi.conf
    -> For an XHDPI device WITH Hardware buttons, use pa_i9300.conf
    -> For an XHDPI device WITHOUT Hardware buttons, use the pa_xhdpi.conf


    # Create /products/pa_<device>.mk:

    Open, & paste the following: (Read the instruction after this code)(All RED LETTERED parts vary from device to device. Use your own values)

    Code:
    # Copyright (C) 2012 ParanoidAndroid Project
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #      http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    # Check for target product
    ifeq (pa_[COLOR="Red"]<device>[/COLOR],$(TARGET_PRODUCT))
    
    # Define PA bootanimation size
    PARANOID_BOOTANIMATION_NAME := [COLOR="red"]XHDPI[/COLOR] [B]OR[/B] [COLOR="red"]HDPI[/COLOR]
    
    # OVERLAY_TARGET adds overlay asset source
    OVERLAY_TARGET := pa_[COLOR="red"]xhdpi[/COLOR] [B]OR[/B] pa_[COLOR="red"]i9300[/COLOR] [B]OR[/B] pa_[COLOR="red"]hdpi[/COLOR]
    
    # Build paprefs from sources
    PREFS_FROM_SOURCE ?= false
    
    # Include ParanoidAndroid common configuration
    include vendor/pa/config/pa_common.mk
    
    # Inherit AOSP device configuration
    $(call inherit-product, device/[COLOR="red"]<device-manufacturer>[/COLOR]/[COLOR="Red"]<device>[/COLOR]/full_[COLOR="Red"]<device>[/COLOR].mk)
    
    # Product Package Extras - Repos can be added manually or via addprojects.py
    -include vendor/pa/packages/[COLOR="Red"]<device>[/COLOR].mk
    
    # CM Package Extras
    -include vendor/pa/packages/cm.mk
    
    # Override AOSP build properties
    PRODUCT_NAME := pa_[COLOR="Red"]<device>[/COLOR]
    PRODUCT_BRAND := [COLOR="red"]<device-manufacturer>[/COLOR]
    PRODUCT_MODEL := [COLOR="red"]<Official Device Name, Eg: [COLOR="RoyalBlue"]GT-I9300[/COLOR]>[/COLOR]
    PRODUCT_MANUFACTURER := [COLOR="Red"]<device-manufacturer>[/COLOR]
    PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=[COLOR="red"]<product-name as per CyanogenMod>[/COLOR] TARGET_DEVICE=[COLOR="red"]<target-device as per CyanogenMod>[/COLOR] BUILD_FINGERPRINT="[COLOR="red"]<As per CM>[/COLOR]" PRIVATE_BUILD_DESC="[COLOR="red"]<As per CM>[/COLOR]"
    
    # Update local_manifest.xml
    GET_VENDOR_PROPS := $(shell vendor/pa/tools/getvendorprops.py $(PRODUCT_NAME))
    GET_PROJECT_RMS := $(shell vendor/pa/tools/removeprojects.py $(PRODUCT_NAME))
    GET_PROJECT_ADDS := $(shell vendor/pa/tools/addprojects.py $(PRODUCT_NAME))
    GET_CM_PROJECT_ADDS := $(shell vendor/pa/tools/addprojects.py cm.adds)
    
    endif

    -> Change the inherit device config directory to device/.... (wherever you've kept your device tree)(could change as per manufact: Samsung, Sony, Motorola etc)

    -> Change OVERLAY_TARGET value as per your device pixel density

    -> Save & Exit


    # Add device makefile entry to /products/AndroidProducts.mk:

    Append this at the end:
    Code:
    ifeq (pa_[COLOR="Red"]<device>[/COLOR],$(TARGET_PRODUCT))
        PRODUCT_MAKEFILES += $(LOCAL_DIR)/pa_[COLOR="red"]<device>[/COLOR].mk
    endif

    -> Use your device name in place of <device>
    -> Save & Exit.



    # Create /vendorprops/<device>.proprietaries:

    1) Now, navigate to your_workspace/vendor/pa/vendorprops

    2) Make a new file, & name it '<device>.proprietaries'

    3) You need to point the script towards your device's proprietary vendor files from your manufacturer.

    Example of what Samsung's looks like.
    (Do some research on google, github, forums etc, & find out your required tree/configs.)

    Here's i9300.proprietaries code: (Same for all Samsung devices)
    Code:
    [
        {
            "remote":       "github",
            "account":      "TheMuppets",
            "repository":   "proprietary_vendor_samsung",
            "target_path":  "vendor/samsung",
            "revision":     "cm-10.1"
        },
        {
            "remote":       "github",
            "account":      "CyanogenMod",
            "repository":   "android_packages_apps_SamsungServiceMode",
            "target_path":  "packages/apps/SamsungServiceMode",
            "revision":     "cm-10.1"
        },
        {
            "remote":       "github",
            "account":      "CyanogenMod",
            "repository":   "android_hardware_samsung",
            "target_path":  "hardware/samsung",
            "revision":     "cm-10.1"
        },
        {
            "remote":       "github",
            "account":      "ParanoidAndroid",
            "repository":   "android_device_samsung_smdk4412-common",
            "target_path":  "device/samsung/smdk4412-common",
            "revision":     "cm-10.1"
        }
    ]

    These are your device specific props that'll get added to local manifest.

    If you've added all such prop sources in <device>.adds, no need to add duplicate entries to <device>.proprietaries
    Just create the file & paste the following in the proprietaries file:
    Code:
    [
    ]

    -> Make your changes
    -> Save & Exit.

    # Add device lunch menu entry to /vendorsetup.sh:

    1) Navigate to android/system/vendor/pa, & open 'vendorsetup.sh' (Just right click, open in Text Editor)

    2) Append this line :
    Code:
    add_lunch_combo pa_[COLOR="Red"]<device>[/COLOR]-userdebug

    That's it!
    Make sure you also have all the hardware, kernel, device specific files, blobs, prebuilts, extracts etc before hand, & set the addresses accordingly.

    You've come so far, & here's the final punch.
    Build the ROM:

    # Build the ROM:


    -> For building ParanoidAndroid you must cd to the working directory. Make sure you have your device tree sources, located on:
    Code:
    $ cd ~/android/system/device/[COLOR="Red"]-manufacturer-[/COLOR]/[COLOR="red"]-device-[/COLOR]

    -> Now you can run the build script:
    Code:
    $ cd ~/android/system
    $ ./rom-build.sh [COLOR="red"]-device-[/COLOR]

    -> You can also use a second parameter for syncing sources before building

    Code:
    # ./rom-build.sh [COLOR="red"]-device-[/COLOR] [B]true[/B]


    -> There are also a few parameters that you can use together with before mentioned:

    threads: Allows to choose a number of threads for syncing operation
    clean: Removes intermediates and output files
    The usage is the same

    Code:
    $ ./rom-build.sh [COLOR="red"]-device-[/COLOR] [B]-parameters-[/B] [B]-sync-[/B]

    (Parameters will be considered false unless you set them to true)


    This will generate a signed zip located at ~/android/system/out/target/product/-device-
    (This'll take a while, depending on your processor speed, & memory. On 3GHz Quad Core Processor, with 4GB RAM, it takes me 71-75 minutes to get the final ZIP. If your configs are higher, it'll take you less)


    Congratulations! You've successfully compiled ParanoidAndroid for your device!

    -> That's it. You're done! You can test your build by flashing the output zip via CWM.
    :good: :laugh:

    Disclaimer:
    It shouldn't be necessary to mention but well, Paranoid-Settings is meant for Official Paranoid Android only, or ports that stay true to our vision. It is not meant to be included in other ROMs or Kangs - unless we give permission. This is our good name that people pull through the mud when they mix it with conflicting source like aokp. Hybrid engine and dpi changer will only result in a crappy user experience for the end-user. Hybrid relies on a clean system and does not change its DPI, thats the whole point of it. Furthermore hybrid engine is huge and complicated to kang because it grew over half a year and hundreds of commits, resets, reverts, rewrites. The only real hybrid engine is the result of a clean repo init and .rom-build.sh devicename.
    Kangs and ROMs that don't have our permission can either write their own implementation (its really just a text file reader/writer), or adopt on the old paprefs version in the ICS branch, which is 100% opensource. Hybrid engine is 100% open source as well, of course. :cool:
    48
    STEP 3: The After-life: Git, Gerrit, Patch Submissions:

    -Credits to D4rKn3sSyS, for the Git tutorial below-




    STEP 3: The After-life: Git, Gerrit, Patch Submissions:


    As many of you know, our gerrit is officially up since a few days ago here, so here's a simple how-to for pushing changes to gerrit, mostly taken from here.

    If you make any changes, or want to officially maintain PA for a new device, this is where you upload your changes.



    You must create a gerrit account first, and add your ssh keys to Settings > SSH Public Keys

    Guide on how to generate ssh keys (Only generating part, ignore adding to github)

    https://help.github.com/articles/generating-ssh-keys



    # Submitting changes:

    1) First, you need to start a topic branch. This 'branch' holds the changes you make to the files on your computer that you will ultimately send to the ParanoidAndroid servers for review. Create your topic branch:

    Code:
    $ repo start [COLOR="Red"]<branch name> <project name>[/COLOR]
    Note: This starts a new branch called '<branch name>' in the '<project name>' project. Replace <project name> with the name of your target repository instead.

    2) Now, you can cd to the project (directory) that contains the file(s) you want to edit:
    Code:
    $ cd ~/android/system/[COLOR="red"]path/to/project[/COLOR]

    Now you can make your changes. Make sure you do not edit any files before you run repo start, or your changes will happen on a different branch and will not be tracked correctly.


    3) After you make your changes, you can commit them just as you would normally:
    Code:
    $ git add -A
    $ git commit -a
    $ cd ~/android/system

    4) Now you can upload your changes to the ParanoidAndroid server:
    Code:
    $ repo upload [COLOR="red"]<project name>[/COLOR]

    That's it! Your change will be reviewed and may be accepted or rejected.



    ProTip: The first line of your commit message will become the Change's Title. Add a blank space after the Title and write the summary of changes there. Make sure that the change's title and summary width do not exceed 80 chars per line.




    # Submitting patch sets:

    -> It's a common case. Your patch has issues or errors, which are noted in the code review, so you will want to resolve them. Sometimes it's just tabs instead of spaces or typos in strings and variable names.

    -> Before you edit those files, type in
    Code:
    $ git branch -v
    to make sure you are on the correct branch.

    -> If you are not in the correct branch or in no branch at all, type in
    Code:
    $ git checkout [COLOR="red"][branchname][/COLOR]
    to switch to the correct branch.

    -> Now you can edit the files. After you made your changes, do the usual
    Code:
    $ git status
    and notice that git diff will only show you the changes you just made. Once you are satisfied, you can prepare the upload.

    -> Add the files that you've modified by using
    Code:
    $ git add -A
    .

    -> To Upload, type in
    Code:
    $ git commit --amend
    .
    This will open an editor with your initial commit message.

    -> You can also change the commit message if you want to, but make sure the last two lines stay as are. They contain the initial commit ID and a blank line. With this id, Gerrit will detect your upload as a patch set and not as a new patch.

    -> You can do

    Code:
    $ git log
    and
    Code:
    $ git status
    again.

    Notice how Git handles your initial commit and the commit using --amend as one patch. Same for git show. It will show you all the changes, your initial patch & the patch set you just committed, as one patch.

    -> Now you can submit you patch set to your initial patch with
    Code:
    $ repo upload [COLOR="red"]<project name>[/COLOR]


    ProTip: If this fails and you get two different reviews on gerrit, abandon the oldest one, you make reviewer life easier!.





    # How to know latest commit ID on github project:

    -> Open project, example, for frameworks:

    https://github.com/ParanoidAndroid/android_frameworks_base

    Youll see this, wich is latest commit ID

    commit-id.jpg





    ---Common issues---

    • Permission denied (publickey): Make sure you have ssh keys and your local git username matchs with gerrit username. Is everything correct but you still have issues?, try with "ssh-add" command, or changing your RSA key by a DSA key
    • no branches ready for upload: you must do the following steps
      Code:
      $ cd ~/android/system
      $ repo abandon [COLOR="red"]<branch> <project>[/COLOR]
      $ repo start [COLOR="red"]<branch> <project>[/COLOR]
      $ cd ~/android/system/[COLOR="red"]path/to/project[/COLOR]
      $ git reset --hard [COLOR="Red"]<latest-github-commit-id>[/COLOR]

      MAKE OR RESTORE YOUR CHANGES AND COMMIT

      Code:
      $ cd ~/android/system
      $ repo upload [COLOR="red"]<project>[/COLOR]

    14
    --Reserved 4--
    13
    --Reserved 5--
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone