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

Search This thread

thecubed

Inactive Recognized Developer
Aug 19, 2008
1,046
10,458
Austin, TX
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 :D

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!
 
Last edited:

apascual89

Inactive Recognized Contributor
Jan 17, 2011
5,558
13,306
Atlanta, GA
Awesome work! How can we get the vendor files to build cm-10.1? For now, could we use the same as the OG ?
 

thecubed

Inactive Recognized Developer
Aug 19, 2008
1,046
10,458
Austin, TX
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 :D

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.
 

hkfriends

Senior Member
Aug 24, 2007
582
149
Check http://github.com/TeamLGOG :D

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
 
Last edited:

thecubed

Inactive Recognized Developer
Aug 19, 2008
1,046
10,458
Austin, TX
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 :)
 

hkfriends

Senior Member
Aug 24, 2007
582
149
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!SpgWgX5mUXrQFpYeE9oZlXbyVkImsIYz6J_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
 
Last edited:

Gotroot

Senior Member
Jun 27, 2008
684
289
www.sbhacker.net
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
 
Last edited:
  • Like
Reactions: apascual89

apascual89

Inactive Recognized Contributor
Jan 17, 2011
5,558
13,306
Atlanta, GA
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
 

thecubed

Inactive Recognized Developer
Aug 19, 2008
1,046
10,458
Austin, TX
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.
 
  • Like
Reactions: apascual89

apascual89

Inactive Recognized Contributor
Jan 17, 2011
5,558
13,306
Atlanta, GA
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!
 

Gotroot

Senior Member
Jun 27, 2008
684
289
www.sbhacker.net
DUDE LOL still throwing back error after redoing my folers heres the error



When making recovery
build/core/base_rules.mk:130: *** gee-common/recovery: MODULE.TARGET.STATIC_LIBRARIES.librecovery_ui_geehrc already defined by device/lge/gee-common/recovery. Stop.

When making 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
 
Last edited:

thecubed

Inactive Recognized Developer
Aug 19, 2008
1,046
10,458
Austin, TX
I just pushed my (very minor) only correction needed to make this build with cm-10.1 sources.

Provided you have your build environment set up correctly, everything should build now (for recovery at least)
 
  • Like
Reactions: apascual89

apascual89

Inactive Recognized Contributor
Jan 17, 2011
5,558
13,306
Atlanta, GA
I just pushed my (very minor) only correction needed to make this build with cm-10.1 sources.

Provided you have your build environment set up correctly, everything should build now (for recovery at least)

I tried the mka bootimage option and it gives me the following error:

LD drivers/usb/storage/ums-alauda.o
LD drivers/usb/storage/ums-cypress.o
LD drivers/usb/storage/ums-datafab.o
LD drivers/usb/storage/ums-freecom.o
LD drivers/usb/storage/ums-isd200.o
LD drivers/usb/storage/ums-jumpshot.o
LD drivers/usb/storage/ums-karma.o
LD drivers/usb/storage/ums-onetouch.o
LD drivers/usb/storage/ums-realtek.o
LD drivers/usb/storage/ums-sddr09.o
LD drivers/usb/storage/ums-sddr55.o
LD drivers/usb/storage/ums-usbat.o
LD drivers/usb/storage/built-in.o
LD drivers/usb/built-in.o
LD drivers/built-in.o
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/apascual89/android/cm-10.1/kernel/lge/geefhd'
make: *** [TARGET_KERNEL_BINARIES] Error 2
make: *** Waiting for unfinished jobs....
apascual89@apascual89:~/android/cm-10.1$

In the past I remember seeing that if I was trying to build with an unsupported toolchain.
 

apascual89

Inactive Recognized Contributor
Jan 17, 2011
5,558
13,306
Atlanta, GA
I tried now to build the zImage and got the following error:

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
apascual89@apascual89:~/android/cm-10.1/kernel/lge/geefhd$


Just reporting to let you know.
 

Gotroot

Senior Member
Jun 27, 2008
684
289
www.sbhacker.net
Ok even after thrown my env. away and starting from scratch im still getting the same error


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
 

thecubed

Inactive Recognized Developer
Aug 19, 2008
1,046
10,458
Austin, TX
I'm not sure why you guys are getting those errors. I'm able to build the kernel just fine...

Maybe my repo is missing something that I have locally? I'll try re-syncing everything to a new dir and testing again later.
 

Gotroot

Senior Member
Jun 27, 2008
684
289
www.sbhacker.net
Awesome you got my error log just let me know I will keep hitting it I have nun but time....
Thanks fir the work

Sent from my LG-E980 using xda premium
 

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    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 :D

    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!
    3
    Noticed one more thing:
    You are copying vold.fstab in device.mk (https://github.com/thecubed/android_device_lge_gkatt/blob/master/device.mk line 59) but there actually is no vold.fstab in your device tree
    How are you setting mountpoints? Or is this not necessary anyway?


    if you need anyone to test let me know. Is it going to be 4.2.2?

    yeah sure, newest slim version is on 4.2.2

    Edit: same thing for gps.conf, which should be in configs/
    Edit2: and for libpn544_fw.so, which should be in prebuilt/
    2
    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 :D

    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.
    2
    Hey all,

    I just pushed the proper file to make the kernel build-- sorry about that! Apparently LGE has a .gitignore file in firmware/ in the kernel that makes it ignore the .bin firmware files... ugh.

    I've removed that and pushed the update to my github. You should be able to build successfully now!
    Happy building!
    2
    I'm not sure why you guys are getting those errors. I'm able to build the kernel just fine...

    Maybe my repo is missing something that I have locally? I'll try re-syncing everything to a new dir and testing again later.