[Moto G Android Development] Lanchon:
hola [MENTION=6331811]Carlos Arriaga[/MENTION],

i've a falcon GPE.

as you know, the GPE has a different bootloader that allows bootloader unlocking without cypto key and without e-fuse blowing in the qualcomm SoC. it's easily recognizable as it shows google's logo instead of moto's as the kernel loads.

moto's and google's BLs are either both signed with the same key, or else the earlier stage BL in all falcons accept the two keys, because it is a known fact that you can "convert" the non-GPE to GPE and supposedly go back.

another thing that you might know is that both editions of the phone come with a different partition layout. in particular, the GPE has a slightly smaller system partition than moto's. because there are relatively few GPEs compared to standard falcons, CM wasn't prepared to flash the GPE and from android 5 it started wanting to dump a partition image in /system that didn't fit. the files comfortably fitted, but not the full partition.

in the i9100 we solved this eons ago, by configuring the build to create a smaller system partition, and then adding a 'resizefs' step during zip install. CM for some other phone models copied this later. but flacon's CM didn't implement this, so flashing on flacon GPE was a manual and painful affair, if you knew how to do it.

FYI, here is one post complaining about the issue, and proposing converting to non-GPE to fix it:

https://xdaforums.com/moto-g/help/patching-image-unconditionally-install-t3311564

of course flashing the moto bootloader has risks. the moto BL needs metadata supposedly somewhere outside its partition to store the public/private keys for the unlock process. given that such data is not in the GPE, people found that they couldn't unlock the phone anymore after the conversion.

it so happens that i'm the author of a phone repartitioning tool for android, and it was the perfect fit for the job: repartition the phone without touching the BL. the tool is called REPIT:

https://github.com/Lanchon/REPIT

but.... i discovered that newer qcomm devices unfortunately have their **partition table signed**!! this is enforced even when the device is BL-unlocked, which is completely horrible. more info here:

https://github.com/Lanchon/REPIT/issues/55

i have very strong indications that the flacon is GPT-locked, so i produced a falcon port of REPIT but never tried it or published builds for it. (it's in the public repo though: https://github.com/Lanchon/REPIT/tree/master/device/.disabled/falcon )

so i ended up using a mixture of moto's and goog's setup. both partition layouts differ only in the last big partitions, the ones that linux and not the BL cares about. and there were strong hints that both GPTs were signed with the same key. (also, fastboot is supposed to sign-check the GPT before flashing it so supposedly i had a safety net there.) so i went ahead and converted my GPE partition layout to standard (with moto's signed GPT) but kept google's BL. the combo worked perfectly, and display problems related to BLs in other falcons never happened in my converted GPE.

i describe the conversion process here:

https://xdaforums.com/moto-g/help/patching-image-unconditionally-install-t3311564/post68819815

all this i told you so that you know the exact configuration of my phone, and why it is this way.

it never had problems again running any CM (and currently runs latest official lineage). until now...

so yesterday i...

-flashed latest official twrp

-wiped system and cache, and FORMATTED data (e2fs)

-flashed your LOS 15 build

...and the device never finishes the boot animation. it smells like a soft boot loop somewhere. unfortunately i don't know how to add an adb client key to a device that never booted, so i couldn't take a look at logcat.

i went back to LOS 14.1 (boots fine), and i probably will lend this phone tonight to a friend that got his stolen.

but i wanted to report the issue at least. in a few weeks i'll probably get the phone back so i could run more tests. i don't know how much time i've got to run tests today though.

so...

-do you know what could be causing this or anything quick that i could try to fix it?

-or is there anyway i can help you support the GPE?

thank you!