[Miscellaneous Android Development] steadfasterX:
sediROM for LG Optimus F3Q - Custom ROM (codenames: fx3q, d520)

This is about building a custom ROM like Cyanogenmod or AOSP working on the LG Optimus F3Q.

Introduction

First of all: At the moment there is

no CM or AOSP based ROM available

for the F3Q. Not yet.

That said it means I try to port CM (or build pure AOSP) to the F3Q and this is this thread about.

Some words about me and what I do:

I do Android ROM development since June 2014 mainly doing things based on stock.

Before the F3Q I never had to do with porting CM or AOSP to a brand new (no not such "new" anymore) device before.

New means "no file device tree" etc available. So I dive into porting months ago and still learning every day new things here.

Porting is nothing you can learn in a week or so :rolleyes: The main problem with porting is that there is not much you can read or

where you can get many help for. The guides out there are very generic and to be honest the best would be having a pro on your site

which guides you through all the problems which WILL occur when porting.

Before starting I never heard about "loki", doesn't know how TWRP gets compiled or created an Android kernel with or without CM

automatism. In the meantime I compiled a working TWRP version, having a kernel in place which allows to boot unsigned system

images and many more. The only "little" thing left is to get CM ready.. :eek: Nevertheless I have 2 things which helped me a lot over

the years: patience and "never-give-up".

The state:

If you ever tried to compile Android or CM by your own you know that you need a valid file device tree (in this case "device/lge/fx3q/")

which contains all the stuff which describes the hardware, the things to do, proprietary files you cannot compile because their sources

are kept by LG and so on. Building that from scratch is a pain in the a.. so you need to find another device whose hardware is as much

the same as yours. In this case this means LG Optimus F6 which has the same processor etc. The great thing is that there are people

out there who had build a working device tree for the F6 which means it should be possible to have the same for the F3Q!

The problem is that before I used the DT from hroark and fixed several build errors there and well now I use the very much more newer

one from dm47021 and this means: adapt everything again, fixing build errors again..

Even when there is such a valid base available from a device with same specs this does not means it would simply work when copying

it over.

I need to adapt nevertheless many things to get the sources at least compiled! and then the question is what works and what not.

This is where we are atm: Fixing compilation errors (fix 1 and you get 2 new) and then we will see..

For updates about the state scroll down to the "current state" topic.

Here what we achieved so far :

Root:

Saferoot: http://www.andromods.com/root-unlock/d520-one-click-rooted-tmobile-lg-optimus-f3q.html (Original: http://xdaforums.com/showthread.php?t=2565758)

Recovery:

CWM (I cannot recommend that CWM version atm! Because it was build with not a full valid device tree and is missing features TWRP has included!): https://play.google.com/store/apps/details?id=com.pressy4pie.oudhs.manager

TWRP (highly recommended!): http://xdaforums.com/showthread.php?t=2867339

Kernel:

sediKERNEL thread

ROM related:

AROMA installer for customized ROM installation

Stock based "hLe Storm ROM" by [MENTION=5720423]joel.maxuel[/MENTION]:

[ROM][STOCK][JB 4.1.2] LG Optimus F3Q / D520

Guides & Discussions:

General talk: http://xdaforums.com/showthread.php?t=2650840

Revert to STOCK again: http://xdaforums.com/showpost.php?p=54667480&postcount=181

If you want to help let me know and I provide you the sources and whatever else needed.

Current state (as of 2015-04-30):

Spent time = about 244 hours... any "Thanks" click still HIGHLy motivating..

Done:

Lokifying (without that we were absolutely L-O-S-T!!! BIG thx [MENTION=4229979]djrbliss[/MENTION]) process is done automatically by my self created build-script (took me some time but was it worth)

Lokifying means: due to a hack by [MENTION=4229979]djrbliss[/MENTION] (click here and click at his THANKS button!!) we can trick the locked bootloader to boot whatever we want!

boot a modified compiled kernel with the stock ROM / or hLe stock ROM

custom 3.4.0 kernel with kexec(disabled atm), xattr, selinux support and much more based on the stock kernel sources (sediKERNEL thread)

the ability to boot unsigned ROM's provided by sediKERNEL

Fully (or mostly) working TWRP version where storages correctly mounted and backup/restore working fine (

TWRP thread

)

adapt hroark's device tree of the LG optimus F6 to the F3Q (superseeded by dm47021)

adapt DM47021 DT to F3Q and compiling CM KK systemimage/full otapackage (do not expect too much it simply means that I was able to fix all the thousands of compilation errors. which is GREAT but now the debuggin starts)

Rebasing EVERYTHING of the file device tree to the f6mft one by Dm47021. Reason: CM is now available for the F6 which is damn great because we use the same hardware in many cases. I currently rewriting everything from scratch, adding the correct proprietary files etc. Will take a while but hopefully then we get more in the right direction then before.

Current progress:

Testing and debugging CM KK image

Building a custom kernel without stock initrd (Details on the process here:

sediKERNEL thread

)

To do:

must-have: Building a custom kernel without stock initrd

must-have: having a working device tree (depends on having an own initrd)

undecided: compiling AOSP JB

undecided: compiling CM JB

Stalled:

compiling CM11 kernel based on the F6 device tree (too many compilation failures)

compiling AOSP Jellybean including the LG sources works (but different issues with booting)

compiling AOSP KitKat including the LG sources fails (doesn't start at all because of several changed vars maybe. Didn't investigate that further cause I focus on kernel now)

compiling CM JellyBean fails with the adapted LG Optimus F6 device tree

MultiRom (discontinued as sediKERNEL can now do all I need):

Multirom TWRP = compiling OK but no screen shown?!

Multirom binary = compiling OK

Multirom trampoline = compiling OK if it works or not? Cannot test it until TWRP

Kexec Kernel = Porting to F3Q (hopefully) finished. compiling OK but it has problems with mounting the correct places (I think. Didnt investigate that further atm)

For testers: ALPHA/BETA testing download area

http://tinyurl.com/q7fwcf3

(password protected - PM me to get access)

For developers: my sources

My current device tree of the fx3q AOSP build can be found here: device_lge_fx3q_aosp (updated from time to time, PM me for an immediate commit)

My current device tree of the fx3q CM11 build can be found here: android_device_lge_fx3q_cm (updated from time to time, PM me for an immediate commit)

My build tools (useful tools I developed for me to speed up build/compile etc): buildtools (updated from time to time, PM me for an immediate commit)

.

XDA:DevDB Information

sediROM for LG Optimus F3Q / D520, ROM for the Android General

Contributors

xdajog, joel.maxuel

Source Code: https://github.com/xdajog/android_device_lge_fx3q_cm

ROM OS Version: 4.4.x KitKat

ROM Kernel: Linux 3.1.x

Based On: CyanogenMod

Version Information

Status: Testing

Created 2015-05-19

Last Updated 2015-05-20