[Android Software Development] topet2k12001:
New ROM Builder Here! Question. :)

Hi Guys,

First of all, thanks for this thread. :) I now have a copy of CM13.0 and CM12.1 (both repo and non-repo).

Can I ask ROM building-related questions here? If not, please advice of a good thread that I can ask the question. Here's my story.

Background: I'm no programmer, but I'm a technology enthusiast/hobbyist, so I know how to use Linux, I learned how to do simple programming (I started with Autoit - which is what I used to create Imageprep - see my signature below). I know how to overclock my 2700K Sandy Bridge and water-cool my entire PC/rig, etc. I can at least write documentation pretty well and I can follow instructions well. I am also very good with MS Excel formulas (average in macros/Visual Basic) and crunching spreadsheets involving huge amounts of data.

First Stage.

My LG G3 variant (the dual-SIM, D858HK) has very low developer support. This inspired me to take my knowledge up a notch, because dual-SIM flagship phones are not common and I don't want to carry more than one phone around. And my wife will not let me change phones that easily, lol.

I came across a thread that teaches how to "port" ROMs through process that involves creating a "base" and a "port" folder and just replacing files/folders, repacking them, and then reflashing to the device: http://xdaforums.com/chef-central/android/guide-how-to-port-lollipop-marshmallow-t3283452.

Result: I was able to port Exodus and Euphoria OS 1.1 (both Lollipop). :)

Not Contented: Second Stage.

As I really wanted to be able to build a custom ROM (my goal is eventually Marshmallow), I then tried to compile the Android Kernel as a starting point for learning how to build from sources. I found it surprisingly easy, as long as it's just compilation and just adding/removing features here and there (adding fast charge support, OTG support, CPU governors and I/O schedulers) - not really extreme like actually changing the code and pushing proposed changes (commits). I realized that the code is mostly C or C++ and I have absolutely zero background with that.

I learned from this thread: http://xdaforums.com/android/software/ultimate-guide-compile-android-kernel-t2871276.

Result: I was able to learn how to build a kernel for the D858HK using the sources from Exodus ROM. I also learned how to compile using third-party tool chains (Uber Tool Chain).

Challenge: Third Stage.

Keeping my eyes on the goal (build a custom ROM for my device for Marshmallow), my interest turned to Cyanogenmod because I wanted to be able to do "integrated kernel building" by following their Wiki (building both the ROM and kernel together) and it looks like there's good documentation to follow.

I used this XDA thread as reference while I was building: http://xdaforums.com/chef-central/android/guide-android-rom-development-t2814763, as well as the Wiki Pages of Cyanogenmod:

https://wiki.cyanogenmod.org/w/Build_for_d855

https://wiki.cyanogenmod.org/w/Doc:_porting_intro

So I was able to build CM12.1 for the D858HK using the device tree from the links below (I followed the steps about creating a local_manifests.xml file, added the repositories below, and then I ran repo sync, which downloaded the files in these repositories):

https://github.com/mysteryjeans/android_device_lge_g3-common

https://github.com/mysteryjeans/android_vendor_lge_g3-common

https://github.com/mysteryjeans/android_device_lge_d856

https://github.com/mysteryjeans/android_vendor_lge_d856

https://github.com/mysteryjeans/android_kernel_lge_g3

...yes it says D856, but the dual-SIM variants of the LG G3 pretty much share the same code (the official Kernel source code in LG's website shares the D856 and D858HK source code).

Result: today, I just finished building my first custom ROM (CM12.1) from sources! Thanks by the way to MSF Jarvis for his upload on CM12.1.

Here's my situation:

Issue: I flashed my CM12.1 build and it booted, all features working, EXCEPT the SIM cards (issue is exactly like this: http://xdaforums.com/showpost.php?p=63649222&postcount=13).

Questions:

I observed the Terminal while it was building. I noticed a lot of warnings but the build finished (that's why I was able to flash). Should I be concerned about those warnings? If you need the full log, please guide me where I can post it.

In the Cyanogenmod Wiki as well as source.android.com, they talk about plugging the device (or extracting a ROM zip) to extract proprietary blobs (extract-files.sh) - which I did. Since the device tree I mentioned above has "g3_common" repos that, I assume, contains blobs, should I have just skipped the step of extracting proprietary blobs from the device/ROM zip?

The guy who owns the repos (mysteryjeans) was able to build a fully working CM12.1 (SIM cards working). Maybe the extract-files.sh script overwrites the blobs that I downloaded from his repos that's why I had those warnings, and ended up as well with a ROM that has no SIM card detected?

Since I did the extract-files.sh step, is there a way to "delete" those blobs that came from the phone and still keep whatever (if applicable) blobs that got downloaded from the device tree repos? Or there's no other way, i.e. I have to delete the folders and start all over with repo sync?

Or...if I do another

repo sync

, will that overwrite any blobs that initially got overwritten by extract-files.sh (or do I add --force-sync)?

Basically I wanted to see if there's a way of avoiding having to delete my CM12.1 folder and starting all over with the first

repo sync

command, from the top.

Off-topic from my issue: how do developers prepare device trees for a newer version/branch (let's say Lollipop to Marshmallow)? Do they download blobs from stock Marshmallow and write everything from scratch? Or do they just re-use existing blobs/files from Lollipop and then attempt to build Marshmallow, and then troubleshoot from there?

Sorry for the long post, and thank you in advance for anyone who can help! I rarely post this long because I make sure I search/read first any available thread to the best of my abilities, but now I am a bit lost.