[G2 Q&A, Help & Troubleshooting] NetDwarf:
Hello,

as the title says I want to help people who want to compile SlimLP Beta 0.6 for d802 themselves. I am myself a newbie to this, but found somehow out to get it working and want to share my findings. This will likely work for most d8xx versions. I make special notes where I guess you need to do a change for your d8xx version if it's not a d802.

Requirements

you need to know how to use a terminal

64-bit Linux

8GB of memory (swap counts)

at least 100GB of free disk space

recommended is also the lp bootstack and Cloudyfa's Modem

I used a VirtualBox VM with 4GB of memory with 4GB of Swap and 3 CPU Cores. I use Ubuntu 14.04 LTS (x64). If you use a different system, you might want to read the sources of these instructions.

Side Note: If you use a VM,please use "fixed size" hard disk, because dynamic allocation may lead to segmentation faults later, that are hard to track. For exchange of data you can use a shared folder or Airdroid or the likes.

100GB is adviced for compiling a single device source. 150GB is for single device with CCache. 200GB+ is for CCache and multiple devices I'd say. CCache will not be explained here, but is explained in the initializing source. Just you know it exists and it accelerates rebuilds.

Setup tools

ctrl+alt+t (on Ubuntu) to open the terminal and type in:

$sudo apt-get update
$sudo apt-get install openjdk-7-jdk
$sudo apt-get install phablet-tools
$sudo apt-get install bison g++-multilib git gperf libxml2-utils make python-networkx zlib1g-dev:i386 zip

(the last command might be different on different OS versions see Source)

Setup and acquire the source

$mkdir ~/SlimLP
$cd ~/SlimLP
$repo init -u git://github.com/SlimRoms/platform_manifest.git -b lp5.1

Open or create a file in ~/SlimLP/.repo/local_manifests/slim_manifest.xml (.repo is hidden)

And insert the following text:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="TheLoonyBin/proprietary_vendor_lge" path="vendor/lge" remote="github" revision="lp5.1"/>
<project name="SlimRoms/device_lge_d802" path="device/lge/d802" remote="github" revision="lp5.1" />
<project name="SlimRoms/device_lge_g2-common" path="device/lge/g2-common" remote="github" revision="lp5.1" />
<project name="SlimRoms/kernel_lge_msm8974" path="kernel/lge/msm8974" remote="github" revision="lp5.1" />
</manifest>

Now download source and blobs. This takes some time, so get you a beer and wait :)

$cd ~/SlimLP
$repo sync

(Source)

Note: You can ignore the error from repo init.

Note2: It downloads ~30GB (compressed, so actual size is way lower) and this process takes some time mostly depending on the download rate.

Note: If you want to compile for another manufacturer's device you might want to check TheLoonyBin. An alternative might be TheMuppets, that is used by CM afaik.

Prepare make

$cd ~/SlimLP
$. build/envsetup.sh
$lunch slim_d802-userdebug

Note: When you just use $lunch you see all available options

go to ~/SlimLP/kernel/lge/msm8974/arch/arm/configs

copy the name of the file (it's "slim_d802_defconfig" for d802)

open ~/SlimLP/device/lge/d802/BoardConfig.mk with a texteditor

replace "cyanogenmod_d802_defconfig" with "slim_d802_defconfig"

As of 13.09. it is no longer necessary to edit the BoardConfig.mk (see)

Make your own build with blackjack and hookers.

$cd ~/SlimLP
$make -j4 bacon

Note: -j specifies how many threads are used in the compiling process.

After a few hours depending on the memory, disk speed and CPU power you have your fresh SlimLP build. Have fun. :D

Credits:

Google

SlimROMs

TheLoonyBin

Josue Rivera (he explained the procedure for SlimKat to someone here)

Kind Regards

NetDwarf

PS: Subsequent (updated) compiles are realized by:

$cd ~/SlimLP
$make clean
$repo sync
$. build/envsetup.sh
$lunch slim_d802-userdebug
$make -j4 bacon

Don't omit the point in the fourth line and this is the save way to do it, but you can usually omit make clean