FORUMS
Remove All Ads from XDA
Honor 7x
Win an Honor 7X!

[Reference] Building Android / Kernels for the LG E980 (ATT)

1,026 posts
Thanks Meter: 10,437
 
Post Reply Email Thread
Howdy Everyone!

Here's my quick guide to compiling Android for the Optimus G Pro for ATT.
Basic Reference

For reference, this phone's codename is "geefhd" per the stock boot.img, however the kernel defconfig is "gkatt_bcm".
Simplicity sake dictates that I would like to use the kernel defconfig's name as the device codename.

From here on out, I'd like to refer to this phone in code as gkatt, yet we'll call the kernel source dir geefhd.
Prerequisites

Building Android for this phone requires quite a bit of familiarity with the Android build system. If you are unfamiliar with things like makefiles and bash, I do not recommend trying this, as you'll pull out more of your hair than you can afford to lose.

That said, I'd recommend you have at least repo installed, or in your $PATH variable to make this guide a little easier to follow.

You also need to have the build utilities installed. See the CyanogenMod wiki for the build dependencies and how to install them.
Getting your tree set up

Well, it ain't Christmas, but let's put up the tree anyway.

For this guide, I'm going to assume you're like me, and you put all your Android projects in ~/android/.

Let's begin.

Code:
mkdir -p ~/android/cm-10.1/
cd ~/android/cm-10.1/
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
repo sync
Now after a few hours, you'll have a empty tree set up. Let's decorate!
Getting the device repos set up

Once you have the basic CM skeleton in place, we need to add our device support files.

Code:
mkdir -p ~/android/cm-10.1/device/lge
cd ~/android/cm-10.1/device/lge
git clone -b cm-10.1 https://github.com/TeamLGOG/android_device_lge_gee-common.git gee-common
git clone https://github.com/thecubed/android_device_lge_gkatt.git gkatt
Congrats. Now you have the Android side of things ready, however you're not fully ready to start building-- you need a kernel!
Getting the kernel repos ready

Next up: kernel.

Code:
mkdir -p ~/android/cm-10.1/kernel/lge
cd ~/android/cm-10.1/kernel/lge
git clone https://github.com/thecubed/android_kernel_lge_geefhd.git geefhd
You should now have a nice folder containing the kernel and everything you need to build it.
Great! What do I do with this?

You now have two options -- do you want to build Android AND a kernel, or just a kernel?

Let's assume you want to build a kernel only first.

Code:
cd ~/android/cm-10.1/kernel/lge/geefhd
. envsetup.sh
Now you'll see some neat text from my setup script, it'll tell you what commands it just added to your shell and how to use them.
To build a kernel do this:

Code:
make mrproper
make gkatt_bcm-perf_defconfig
make zImage
Then you can look in arch/arm/boot for a file called zImage, which is the kernel itself, ready to be used and abused.

Once you're done and want to clean up, just run make clean or make mrproper to erase all tracks of ever building.

Keep in mind, "mrproper" erases your ".config" file, so before you can build again, you have to issue "make gkatt_bcm-perf_defconfig".
My envsetup script will warn you of that, just incase you forget

Now, let's assume you want to build an Android recovery image!

Code:
cd ~/android/cm-10.1/
. build/envsetup.sh
lunch cm_gkatt-userdebug
The environment is now ready for you to build...

Code:
mka recoveryimage
In about 10 mins you'll have a full recovery.img in $OUT.
The neat thing about this is it builds the kernel inline with your build -- so you build a recovery AND a kernel at the same time.
This will save you a LOT of time testing kernels, since you don't have to manually unpack and repack the boot image after modifying the kernel.

To see your shiny new recovery.img file:
Code:
cd $OUT
KEEP IN MIND you CANNOT flash these images! Flashing them will result in a security error!
You can only fastboot boot these images. I'll post fastboot instructions shortly.
How do I get help??

Well, first things first, ask on IRC.

I'm nearly always around on Freenode. Join #lg-optimus-g and ask if I'm around.
I go by the name IOMonster on IRC. When I'm at work, I'm IOMonster_work.

Please don't just ask to ask a question, ask your full question.
Don't PM me unless you ask first, it's weird to get 20 PM windows open on my IRC client and not have any idea who is who or what they want... basic courtesy please

If by chance/miracle I'm not on IRC, post here. Again, I will not answer questions related to this via PM on XDA. I like answering things publicly so that others can read the answer. Google doesn't index PM's (yet, at least haha), so it doesn't do anyone any good to help you over PM unless it's something private.
I <3 you so much, how do I show my love?

You are so kind

I most definitely do not expect donations of any kind, however they are appreciated a lot.
I purchased this phone off-contract just to get it unlocked, if you are a kind soul and would like to send me a token of your appreciation I would love you forever.

XDA has a neat "Donate to me" button that should be on the left side of this page under my name. Donations go to purchasing new hardware to work on and other neat stuff, so they're always appreciated.
Let me know if I missed anything!
The Following 18 Users Say Thank You to thecubed For This Useful Post: [ View ]
 
 
5th July 2013, 10:51 AM |#2  
apascual89's Avatar
Recognized Contributor
Flag Atlanta, GA
Thanks Meter: 13,287
 
Donate to Me
More
Awesome work! How can we get the vendor files to build cm-10.1? For now, could we use the same as the OG ?
5th July 2013, 11:10 AM |#3  
thecubed's Avatar
OP Recognized Developer
Flag Austin, TX
Thanks Meter: 10,437
 
Donate to Me
More
Quote:
Originally Posted by apascual89

Awesome work! How can we get the vendor files to build cm-10.1? For now, could we use the same as the OG ?

Check http://github.com/TeamLGOG

The vendor files there should work fine for this device, minus the wlan props and any modem/DSP related firmware.

This phone is *very* similar to the OG/N4, it's just got a larger screen and different wlan chip (Broadcom instead of Qualcomm)

However, all that said, I've yet to build it for the phone-- I'm focused on getting it more unlocked right now.
The Following 2 Users Say Thank You to thecubed For This Useful Post: [ View ]
5th July 2013, 12:51 PM |#4  
Senior Member
Thanks Meter: 146
 
Donate to Me
More
Quote:
Originally Posted by thecubed

Check http://github.com/TeamLGOG

The vendor files there should work fine for this device, minus the wlan props and any modem/DSP related firmware.

This phone is *very* similar to the OG/N4, it's just got a larger screen and different wlan chip (Broadcom instead of Qualcomm)

However, all that said, I've yet to build it for the phone-- I'm focused on getting it more unlocked right now.

Hi there

I am interest in building E988 kernel which is international version of Optimus G Pro

would you mind tell me how to tweak the E988 source on this development ?
E988 is using gku-perf_defconfig

E988 is using different wlan chip vs ATT
5th July 2013, 01:22 PM |#5  
thecubed's Avatar
OP Recognized Developer
Flag Austin, TX
Thanks Meter: 10,437
 
Donate to Me
More
Quote:
Originally Posted by hkfriends

Hi there

I am interest in building E988 kernel which is international version of Optimus G Pro

would you mind tell me how to tweak the E988 source on this development ?
E988 is using gku-perf_defconfig

E988 is using different wlan chip vs ATT

Have you tried gku_bcm-perf_defconfig ?

I have a feeling that might do the trick
5th July 2013, 01:38 PM |#6  
Senior Member
Thanks Meter: 146
 
Donate to Me
More
Quote:
Originally Posted by thecubed

Have you tried gku_bcm-perf_defconfig ?

I have a feeling that might do the trick

yes, i tested in E988 source.. and it will hanged and stuck in fastboot screen (as last time, I try to compile BCM config (want a trick for a wrong driver)

anyway.. i will clone your kernel source first to see and will try using your source to compile with "gku-perf_defconfig"

I believe the E980 and E988 is the same kernel source, only config is different (i hope)


Edit: (Testing Case)

1) Using your source code and with gku-perf_defconfig =>
Fastboot boot <myboot.img> => reboot => then back to Fastboot mode

It seems wcnss_wlan (Qualcomm) has issue again

https://mega.co.nz/#!VI4S3RgK!SpgWgX...IYz6J_CWWe9X5M

[ 5.528704 / 01-18 07:39:57.262] wcnss_wlan wcnss_wlan.0: WCNSS Power-up failed.
[ 5.535174 / 01-18 07:39:57.272] init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
[ 5.535449 / 01-18 07:39:57.272] init: cannot find '/system/bin/libbroadcast_server', disabling 'broadcast'
[ 5.536303 / 01-18 07:39:57.272] init: cannot find '/system/xbin/spritebud', disabling 'spritebud'
[ 5.536365 / 01-18 07:39:57.272] init: cannot find '/system/bin/rf4ce', disabling 'rf4ce'
[ 5.547504 / 01-18 07:39:57.282] wcnss_wlan triggered by userspace

2) Using your source code and with gku_bcm-perf_defconfig =>
Fastboot boot <myboot.img> => hanged => need press power button for 3sec and re-start in fastboot mode
then I fash back the stock image and then try to get last_kmsg...

but I get nothing due to hanged (i think)

root@android:/ # cat /proc/last_kmsg > /sdcard/last_kmsg.txt
cat /proc/last_kmsg > /sdcard/last_kmsg.txt
/proc/last_kmsg: No such file or directory
5th July 2013, 04:43 PM |#7  
Gotroot's Avatar
Senior Member
Thanks Meter: 287
 
Donate to Me
More
thanks for all your work only one question how to get into fast boot
5th July 2013, 06:21 PM |#8  
Gotroot's Avatar
Senior Member
Thanks Meter: 287
 
Donate to Me
More
Got a small error but duno how to fix it here a build log\



build/core/Makefile:419: *** BOARD_FORCE_RAMDISK_ADDRESS has been deprecated. Use BOARD_MKBOOTIMG_ARGS.. Stop.
root@gotroot-OptiPlex-380:~/android/cm-10.1#

that's when tring to build recovery


This is when tring to build kernel


MK_FW firmware/audience-es325-fw.bin.gen.S
make[1]: *** No rule to make target `firmware/audience-es325-fw.bin', needed by `firmware/audience-es325-fw.bin.gen.o'. Stop.
make: *** [firmware] Error 2
The Following User Says Thank You to Gotroot For This Useful Post: [ View ] Gift Gotroot Ad-Free
5th July 2013, 07:15 PM |#9  
apascual89's Avatar
Recognized Contributor
Flag Atlanta, GA
Thanks Meter: 13,287
 
Donate to Me
More
Quote:
Originally Posted by Gotroot

Got a small error but duno how to fix it here a build log\



build/core/Makefile:419: *** BOARD_FORCE_RAMDISK_ADDRESS has been deprecated. Use BOARD_MKBOOTIMG_ARGS.. Stop.
root@gotroot-OptiPlex-380:~/android/cm-10.1#

that's when tring to build recovery


This is when tring to build kernel


MK_FW firmware/audience-es325-fw.bin.gen.S
make[1]: *** No rule to make target `firmware/audience-es325-fw.bin', needed by `firmware/audience-es325-fw.bin.gen.o'. Stop.
make: *** [firmware] Error 2

I got that same error this morning. Had to leave for work so couldn't really look into it.

Sent from my GT-I9505G using Tapatalk 4 Beta
5th July 2013, 09:25 PM |#10  
thecubed's Avatar
OP Recognized Developer
Flag Austin, TX
Thanks Meter: 10,437
 
Donate to Me
More
Quote:
Originally Posted by apascual89

I got that same error this morning. Had to leave for work so couldn't really look into it.

Sent from my GT-I9505G using Tapatalk 4 Beta

So, all that is because I just realized I didn't sync CM10.1, but just CM10 to my buildbox...

I'll update it all today, I just realized that when I set up my build dir I just did repo init -u .. -b jellybean instead of cm-10.1

oops!

Anyway, easy fix, and I'll have it out soon-ish today.
The Following User Says Thank You to thecubed For This Useful Post: [ View ]
5th July 2013, 09:29 PM |#11  
apascual89's Avatar
Recognized Contributor
Flag Atlanta, GA
Thanks Meter: 13,287
 
Donate to Me
More
Quote:
Originally Posted by thecubed

So, all that is because I just realized I didn't sync CM10.1, but just CM10 to my buildbox...

I'll update it all today, I just realized that when I set up my build dir I just did repo init -u .. -b jellybean instead of cm-10.1

oops!

Anyway, easy fix, and I'll have it out soon-ish today.

No rush man, I don't want to take time away from you unlocking this beast!
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes