[LG Optimus 2x] Raum1807:
Build your own ParanoidAndroid ROM based on CM10 for LG P990

SInce I took some notes a while back when I was trying out ParanoidAndroid myself, I made a user-friendly version out of these notes.

Here you go:

Build your own ParanoidAndroid ROM based on CM10 for LG P990

IMPORTANT! THIS IS A FOLLOW-UP GUIDE THAT REQUIRES A WORKING BUILDING ENVIRONMENT.

Preparation

You need a tested and fully working building environment (Ubuntu 12.04/12.10, Java 6, etc.). If you do not have one already, please follow this guide throughly first and build a normal CM10 ROM from sources as a test. If everything works as it should, then you can proceed with the following lines.

ParanoidAndroid Environment

Let's start.

Use the terminal to make the steps. A terminal window can be opened by pressing Ctrl+Alt+T. Every single command for the terminal is marked with a $ sign. Just paste every command (without the $ sign) to your terminal window and there shouldn't be any problem.

Create a directory named 'paranoid' in your home folder

$ mkdir ~/paranoid

Initialize the Repo in your newly created directory:

$ cd ~/paranoid
$ repo init -u git://github.com/ParanoidAndroid/android.git -b jellybean

Before downloading the files you need to edit a file. One line leads to sync errors and has to be deleted from the file. Edit 'default.xml' in /paranoid/.repo/manifests/

(Hint if you can't see the .repo directory: it's hidden, so to make it visible press Ctrl+H) or use this line

$ gedit ~/paranoid/.repo/manifests/default.xml

Search (Ctrl+F) for 'ParanoidPreferences' and remove the whole line. Save and close the 'default.xml' file.

We need to add some LGE (P990) specific repositories as well. You can either copy the 'local_manifest.xml' file (it's the same!) from your cm10-build-environment or create a new file in /paranoid/.repo/

To create a new file use

$ gedit ~/paranoid/.repo/local_manifest.xml

Insert the following lines

<manifest>
<project name="TheMuppets/proprietary_vendor_lge.git" path="vendor/lge" remote="github" revision="jellybean"/>
<project name="CyanogenMod/android_device_lge_p990" path="device/lge/p990" remote="github" revision="jellybean"/>
<project name="CyanogenMod/android_device_lge_star-common" path="device/lge/star-common" remote="github" revision="jellybean"/>
<project name="CyanogenMod/lge-kernel-star" path="kernel/lge/star" remote="github" revision="jellybean"/>
<project name="TheMuppets/proprietary_vendor_lge" path="vendor/lge" remote="github" revision="jellybean"/>
</manifest>

Save it.

Sync the repositories (takes time!)

$ repo sync

Take a looong coffee break.

Some files

After the successful sync process go to 'paranoid/vendor/pa/products/'.

Create a new file with the name 'pa_p990.mk'

$ gedit ~/paranoid/vendor/pa/products/pa_p990.mk

Insert these lines:

(lines changed, xhdpi to hdpi, thanks rugglez)

# Check for target product
ifeq (pa_p990,$(TARGET_PRODUCT))

# Define PA bootanimation size
PARANOID_BOOTANIMATION_NAME := HDPI

# OVERLAY_TARGET adds overlay asset source
OVERLAY_TARGET := pa_hdpi

# include ParanoidAndroid common configuration
include vendor/pa/config/pa_common.mk

# Inherit CM device configuration
$(call inherit-product, device/lge/p990/cm.mk)

PRODUCT_NAME := pa_p990

GET_VENDOR_PROPS := $(shell vendor/pa/tools/getvendorprops.py $(PRODUCT_NAME))

endif

Save it.

Open 'AndroidProducts.mk' in 'paranoid/vendor/pa/products/' with

$ gedit ~/paranoid/vendor/pa/products/AndroidProducts.mk

and add these lines to then end of the file:

ifeq (pa_p990,$(TARGET_PRODUCT))
PRODUCT_MAKEFILES += $(LOCAL_DIR)/pa_p990.mk
endif

Save it.

Create a file called 'p990.proprietaries' in 'paranoid/vendor/pa/vendorprops/'

$ gedit ~/paranoid/vendor/pa/vendorprops/p990.proprietaries

[
{
"account": "TheMuppets",
"repository": "proprietary_vendor_lge",
"target_path": "vendor/lge",
"revision": "jellybean"
}
]

Save it.

Open 'vendorsetup.sh' in 'paranoid/vendor/pa/'

$ gedit ~/paranoid/vendor/pa/vendorsetup.sh

Add this line

add_lunch_combo pa_p990-userdebug

Save it.

Get CM Prebuilts

Now go to

$ ~/paranoid/vendor/cm/get-prebuilts

Building ParanoidAndroid

Ready to go! Build your ROM now with

$ cd ~/paranoid
$ ./rom-build.sh p990

The compiling takes around the same amount of time as when building CM10. Half an hour minimum, up to a few hours on slower systems. You will find your CWM flashable zip in 'paranoid/out/target/product/p990/'. It is called 'pa_p990-version-date-time.zip'

Rebuilding

Everytime you want to rebuild or build a new version, just change to the directory, resync the sources and start building:

$ cd ~/paranoid
$ repo sync
$ ./rom-build.sh p990

If you haven't enlarged your system partition yet, you have to delete some files or the ROM probably won't fit.

Deletable files

/system/media/: delete bootanimation.zip, saves 9.4 MB

/system/media/video/: delete all files, saves 6.4 MB

/system/media/audio/ringtones/: keep one or two, delete the rest, saves up to ~8 MB

You can even delete some system apps (.apk) from '/system/app/' like LiveWallpapers.apk, VisualizationWallpapers.apk, CMWallpapers.apk, MagicSmokeWallpapers.apk, HoloSpiralWallpaper.apk

Feedback regarding improvements/error corrections welcome!