yashsingh1/xdaforums huggingface dataset:
[X Style (Pure) Android Development] randomblame:
This is unofficial lineageos 16 for Motorola Clark. It is only compatible with nougat firmware - you must have the nougat bootloader and modem flashed on your device.

Tons of thanks to hashbang for all of his work

Kernel Source-

https://github.com/randomblame/android_kernel_motorola_msm8992

Device tree-

https://github.com/randomblame/android_device_motorola_clark

Current status of rom-

Daily Driver

Broken-

Camera post processing- rotation is not accounted for in hal with latest round of hacks credit to AgathosAnthropos for fixing image capture by disabling the calls to pp, hold device in landscape for photos

Tethering - it works but device will soft reboot when tethering stops

Dual sim variants are NOT supported! I do not have the hardware to test and fix at this time - bugreports appreciated

Working - everything else?

Try it yourself (Requires Nougat Firmware and as always wipe data+cache)

Latest Releases:

1/12/2020 https://www.androidfilehost.com/?fid=4349826312261700035

8/1/2019 https://www.androidfilehost.com/?fid=6006931924117928331

Don't forget to grab a compatible version of gapps for 9.0

https://opengapps.org

Once again this rom REQUIRES that the stock nougat firmware was properly flashed to work correctly... It will check before installation that you have the correct modem version installed.

*If your radio does not work you may have the wrong modem

*If you can not switch lockscreen to pin or pattern you may have the wrong modem.

*Modem flashes fail quietly sometimes please make sure you have properly flashed it before reporting issues.
[X Style (Pure) Android Development] josuearisty:
Great! [emoji6]

Enviado desde mi Nexus 5X mediante Tapatalk
[X Style (Pure) Android Development] xabr3:
I'll be happy to test once there is a working rom :)
[X Style (Pure) Android Development] randomblame:
I've been updating op, it seems to just be getting shorter as I fix things. The rom now compiles with default manifest only needs device tree and kernel source now. something is failing quietly and preventing boot. I'm just working the problem slowly getting it sorted out.
[X Style (Pure) Android Development] Unistar:
Can't wait to see more from this
[X Style (Pure) Android Development] mostafasalimi:
We wait impatiently.
[X Style (Pure) Android Development] randomblame:
Spent a couple more hours going through init narrowing it down failure happens just before zygote startsI currently have my pure propped up in charging position so I can work more on it it's had a hard life
[X Style (Pure) Android Development] Moto X Pure XT1575:
Thank You so much

I have been searching and search for lineage OS roms for my XT1575 but the bootloader is Ax052 which is not supported by 14.1 Lineage. I Hope you find a fix for this.
[X Style (Pure) Android Development] Brylex:
Hi, I have the Lineague 14.2 installed. What I did to eliminate the bootloader check was to edit the uptader-script
[X Style (Pure) Android Development] randomblame:
Fixing error caused by missing taskstats kernel feature
[X Style (Pure) Android Development] ResistanceIsFutile:
Hi randomblame,

A quick review please, could you tell us the intended purpose of your project.

Meaning like I'm thinking it's for a "Moto X Pure 2015 (clark)" device isn't it?

Would that be for everyone on this XT1575 device which has upgraded to a stock Nougat kernel and modem?

Or could/would others benefit from it as well with your research here - other moto's?

Any and all answers - thoughts are welcome in understanding the project...

Thanks for the lady power on XDA,

RIF

This device can have a new future. Think about it !
[X Style (Pure) Android Development] randomblame:
I will look into bootloader incompatibility once I get it running seems like it shouldn't be a big deal. I'm also toying with the idea of a new kernel 3.18 seems like low hanging fruit considering Motorola was kind enough to give us good searchable git history on GitHub of both kernels and the 3.18 source for the Moto z seems to have most of the msm8992 support still. My next step is going to be a new device tree starting as bare bones as possible and populating it properly to figure out this issue. I'll throw up a PayPal link again later a less broken device would be helpful USB port is bad and this is probably the fourth screen I've installed on it but touch only works when it feels like it lol
[X Style (Pure) Android Development] ResistanceIsFutile:
I'm trying to follow along with your posts best as is possible for me - but, so sorry I and as well many others are lame to understand the under-the-hood workings of Android.

Are you saying in such a way that the Moto Pure XT1575, will maybe and with your research efforts move forward to a true PIE OS possibly?

Maybe I'm reading to much into your words.

But, as I follow your posts, you'll advance us Pure device owners beyond the Nougat kernel - or at least try too?

Or yet with your efforts will this yield something like HashBang did for the XT1575 device when a Nougat OS wasn't even a thought of possibility from Motorola for us.

Back then, HashBang had worked the Nougat OS on the Marshmallow kernel and modem - I'm very green to all of this - but that's what I understood.

Still that's good none the less if that will come here from you with PIE on Nougat internals...

Beings Motorola support is dead for our device for anything future of an OS update - not to mention security patches.

If you would spell it out better as any interested XT1575 owners now could grasp the concept here in your efforts - create a buzz for a greater community following. More MXP owners to jump on board as gained support from well wishers.

Is it to early yet for that? Is there a fear that someone could steal it out from under you? Unexpected negativity, or is it just the way you wish to present this to us for the present.

I'm still going to watch and support this project with high hopes no matter what may come in the end...

Could you benefit knowledge from a LineageOS 16 for Moto Z. download?

https://www.cyanogenmods.org/forums/topic/download-moto-z-lineage-os-16-android-9/

For people like me,

Device Tree = https://source.android.com/devices/architecture/dto

and on XDA

https://xdaforums.com/android/software/guide-how-to-make-device-tree-phone-t3698419

As for any active developers still left for the XT1575 a big thank you to you all, seems to me like a daunting task to crawl inside of android moreless understand things once your there...
[X Style (Pure) Android Development] randomblame:
Kernels are only loosly linked to Android versions, Google maintains the Android-common kernel repos which are usually quite far behind mainline Linux, and caf who maintains Qualcomm specific kernels are further behind in general. Literallyany feature required by Android can be backported to an old kernel I'm sure 2.6.27 could run pie but it would need so many patches it would be an unrecognizable mess. It will become progressively more of a nuisance as time goes on to keep patching up 3.10 Pie "requires" 4.4 for new devices but only needs kernel features from 3.18 which I've backported to 3.10. with each new version of Android more assumptions are made about how modern the devices kernel is and what features it has so moving to a newer kernel would be nice and like I said 3.18 seems doable but it will still be quite a bit of work.
[X Style (Pure) Android Development] ResistanceIsFutile:
Thank you [MENTION=1776875]randomblame[/MENTION] I was able to grasp most of that...

Maybe it's too early but, how does Googles Android security patches figure into this - if they are possible to bring us forth from Oct 2017?

Remembering I'm a laymen to the nuts and bolts of android.

I understand your post #16 - :D Super !
[X Style (Pure) Android Development] randomblame:
Security patch version is irrelevant when you are building from the latest source
[X Style (Pure) Android Development] randomblame:
Obnoxiously after a few builds the dedicated 250gb SSD is full and I have to make clean which takes ages, I nooped every thing but the basics didn't include telephony or wifi, ril, audio, Bluetooth GPS nfc etc and left it to build overnight will test after work trying to narrow down the problem
[X Style (Pure) Android Development] randomblame:
Surface flinger is the culprit
[X Style (Pure) Android Development] kellerman40:
I have the device laying around and getting no use. Will sure donate some $$$. Seeing a los16 with all working hardware would be great.
[X Style (Pure) Android Development] randomblame:
Only got a couple hours to work on it this weekend, there is an issue where /system/vendor is not symlinked to /vendor early enough and calls for things in /vendor fail thus the issue, since we don't have a physical /vendor partition it can not be mounted immediately via the kernel. Tis annoying. I can change the calls to /system/vendor or maybe make it symlinked earlier when I get a chance
[X Style (Pure) Android Development] moviefirst:
Hopefully you'll fix it.

Thanks again for your effort! :good:
[X Style (Pure) Android Development] kelleton:
I am currently using the ROM stock 7.0 and would like to know if it is possible to run that ROM in multiboot with it, so if at some point I need the camera I would like to use it in my current one.
[X Style (Pure) Android Development] pdm2007:
I used fastboot to manually wiped storage, flashed the latest twrp; bootloader.img fastboot flash modem NON-HLOS.bin, fastboot erase modemst1 , fastboot erase modemst2 from the stock image.

Sim card don`t want to work.
[X Style (Pure) Android Development] randomblame:
Did you get confirmation of a good flash of modem from fastboot? It fails often. There are detailed guides for flashing stock nougat firmware find the one for your model and follow the instructions to the letter.
[X Style (Pure) Android Development] randomblame:
Front camera sort of working it's saving really low quality images now, video recording works fine defaults to 4k instead of 1080p which needs fixed
[X Style (Pure) Android Development] moviefirst:
Certainly good news that the front camera is working a sort of :).

You will undoubtedly succeed! ;)
[X Style (Pure) Android Development] Easy Lamer:
Thanks for your work! I wish you success! :good:
[X Style (Pure) Android Development] randomblame:
[MENTION=4630246]Hashbang173[/MENTION] welcome back ?
[X Style (Pure) Android Development] randomblame:
He's active on GitHub at least, I may have just spoiled his dramatic entrance
[X Style (Pure) Android Development] moviefirst:
Great team:good:
[X Style (Pure) Android Development] randomblame:
Finally someone to clean up after my messes ?
[X Style (Pure) Android Development] Hashbang173:
Using the OSS camera HAL may never work. It doesn't fully function on 14.1 so probably needs more work.

This was needed just to begin to make it compatible with our blobs: https://github.com/HashBang173/andr...5c5960d#diff-dd6d2dcc679d12b9430a9787bab45b33
[X Style (Pure) Android Development] randomblame:
What about the old wrapper? I wasn't around during the transition to 8.0 so I missed the underlying reason for transitioning to the oss hal. Was it from blob incompatibilities? We can whitelist them if it's a binder restriction like text relocation or double destroyed mutex and use the old camera API or was there something else?
[X Style (Pure) Android Development] Hashbang173:
Wrapper had front preview working on 8.0 at least. OSS HAL was an attempt to get everything working and to have more flexibility in the future. Many other devices were having success with it (including many msm8992 based devices). Unfortunately though, unlike other devices, OSS camera is not a drop in replacement with little changes. The current OSS implementation has hacks for compatibility with our blobs, but is still not 100% functional, even on a Nougat based ROM.
[X Style (Pure) Android Development] randomblame:
I need to dig up the blobs and get the wrapper working at that level at least, oss hal was able to capture very low quality images from the front camera at one point during my experimentations and video recording was working at 720p. Kernel was complaining it was unable to read the eeprom of the back sensor I'm not sure how far back that issue goes or if it's simply from the camera service starting sooner on pie also can patch the kernel to skip that and bring the sensors up without calibration this is stuff I've already tried with the oss hal but not the wrapper
[X Style (Pure) Android Development] Hashbang173:
Video recording worked with the wrapper in 8.0 with the front camera. I think this was the main thing that was needed to get front preview up: https://github.com/HashBang173/andr...72f0aee#diff-dd6d2dcc679d12b9430a9787bab45b33
[X Style (Pure) Android Development] randomblame:
I'm going to hope that solving the eeprom read will result in the rear sensor working at the same level on the wrapper as the front camera then the issue will be image capture
[X Style (Pure) Android Development] xabr3:
Is NFC fixed too? :D

Good luck on the camera :good: :fingers-crossed:
[X Style (Pure) Android Development] Hashbang173:
NFC should be fixed with the changes I added
[X Style (Pure) Android Development] randomblame:
Yep I put a build up in the op with his nfc fixes, let us know if anything else is borked gonna try to make some time this evening to play with camera holiday distractions are happening
[X Style (Pure) Android Development] kadopt:
I've done a clean install and stuff works as expected with a few issues though...

Memory management seems kinda messed up (after using 3 apps or more previous apps some times get reloaded, like nova launcher) and I have no camera app, if I install other camera app it says that it cannot connect to camera, yes I know it didn't work but I could use the preview for other stuff like Whatsapp web login. Also System app hangs after boot and it has to be force closed at least once for the device to work properly. Anybody else experiencing similar stuff?

I restored settings from a google backup btw. Thanks

[edit]Also the initial device setup keeps crashing after WiFi is configured, a reboot fixes the issue and I've flashed 18th build, 18th nano Open GApps, and Magisk v18.0.[/edit]
[X Style (Pure) Android Development] moviefirst:
I can't set a screen lock pattern or password, it returns to the menu.

No flaslight.

Can't set phone language in the settings, have to do a clean flash to set language from set-up wizard.
[X Style (Pure) Android Development] kadopt:
I was able to change from pin to pattern, to password and back to pin again fine.

Since camera does not work neither will the flashlight as it depends on the camera.

I can change languages fine, and add or remove languages as well.
[X Style (Pure) Android Development] randomblame:
Haven't seen this before

12-20 16:55:50.375 root 0 0 E [ 13.752517,0] msm_camera_pinctrl_init: 1247 Getting pinctrl handle failed

12-20 16:55:50.375 root 0 0 E [ 13.752535,0] msm_camera_power_up: 1288 Initialization of pinctrl failed

12-20 16:55:50.375 root 0 0 E [ 13.752544,0] msm_camera_request_gpio_table: 596 invalid gpio_tbl 0000000000000000 / size 0

12-20 16:55:51.482 root 0 0 E [ 14.857400,0] msm_camera_request_gpio_table: 596 invalid gpio_tbl 0000000000000000 / size 0
[X Style (Pure) Android Development] moviefirst:
What does it means?
[X Style (Pure) Android Development] randomblame:
Camera provider service starts before anything is ready for one this is an odd error though it shouldnt be here kernel should be able to set up the devices at it's own pace I don't think anything in userland could interfere with this particular process

May need to rebase the kernel on the last known working set of commits for Los 14 and just add the minimum set of needed changes for 16 to see if it's still failing there
[X Style (Pure) Android Development] muelo1000:
could you put bootloader ver. 0xA048 on whitelist? Thank you
[X Style (Pure) Android Development] randomblame:
Does it work? Remove the asserts from the zip and test. It's not really the bootloader that's the problem so much as the modems. I'll whitelist if it works with the modem version that is supposed to be paired with it.

It's a bit arbitrary to block bootloaders based on what modem they came paired with officially but it's really the best we've got ?
[X Style (Pure) Android Development] Hashbang173:
It is possible to do an assertion using strictly the modem, but it is more complex to implement. I chose to do bootloader assertion due to simplicity and (thought) ease to get compatible bootloaders. I'll try to dig up where I saw a device doing assertion using modem version.

Edit: Here is what I'm talking about

https://github.com/LineageOS/androi...ts/lineage-16.0/recovery/recovery_updater.cpp

https://review.lineageos.org/c/LineageOS/android_device_xiaomi_sdm845-common/+/234420
[X Style (Pure) Android Development] randomblame:
That would solve the "why isn't my ril working" issue from failed modem flashes
[X Style (Pure) Android Development] Hashbang173:
I'll look into it in more detail later. From a quick strings search on the modem image I'm getting "2017-08-29 01:47:55" and many other similar dates. Could probably make something search for a string in a date format and make the assertion work if it is newer than 2017-8 or something
[X Style (Pure) Android Development] Hashbang173:
Here is what I've got currently: https://github.com/HashBang173/andr...mmit/665425b184a5173e361a7bd0ad4c33c896fcd99b

Seems to work so far. Offset and minimum modem version may need to be adjusted for different compatible modems
[X Style (Pure) Android Development] randomblame:
is there any incompatibility associated with the bootloader itself? Should that assert be retained as well?

this is the commit I was talking about regarding the eeprom read issue

https://github.com/randomblame/android_kernel_motorola_msm8992/commit/c8a11b9216b72dc1e2a40ac53157fd33b73c9ca4 best to slow down the camera service instead of reverting this though it may be a useful test

currently trying to pin down camera breakage in kernel, but soon I will have to start fortifying the house to defend against robot santa.
[X Style (Pure) Android Development] pdm2007:
I used this tutorial: https://xdaforums.com/moto-x-style/general/guide-return-to-stock-relock-bootloader-t3489110

After I returned to stock Android from Motorola, wiped cash+dalvik - I was able to test your build (finally!). Simcard works, hello NFC and bluetooth.

My advise for begginers/dilettantes/layman/amateur #sayonara (like me):

1) to use Motorola`s drivers https://motorola-global-en-aus.custhelp.com/app/answers/prod_detail/a_id/86934

2) to use ADB installer to play with Fastboot commands https://xdaforums.com/showthread.php?t=2588979

I couldn`t relock the bootloader so used this commands to make it work:

fastboot oem fb_mode_set instead of fastboot oem lock begin

fastboot oem fb_mode_clear instead of fastboot oem lock

Well, what can I say. It`s alive! Android Pie, I mean. It looks lovely, I think Moto X Pure will have a new life after death.

I feel it still buggy, but usable and beautiful (I can handle it). Tried to encrypt through security settings - and the phone data was corrupted. TWRP factory reset THANK YOU - it works, and it helped to start from the beggining. Reinstalling apps and stuff now...

Battery usage is huge now. Will be monitoring, I'm curious how much the system battery usage.

I think the best launcher to use for now - is the default browser - works good, almost not buggy. I`ll play with the settings menu to figure out how stable settings work. I need more time.

Great respect for random blame - While reading this forum thread I learned a lot about ROMs development in general.

Let`s rock!
[X Style (Pure) Android Development] Hashbang173:
I don't know of any incompatibilities with old bootloaders, though it is possible.
[X Style (Pure) Android Development] randomblame:
hmm f2fs is broken when backing up to old kernel source I'll test from another angle

slowly downloading an old copy of los14 for nougat fw to test with this zimage I just want to confirm that the camera driver has not been compromised within the kernel since it was last working
[X Style (Pure) Android Development] Hashbang173:
Downgrading to an older kernel with a different F2FS will likely need a format of userdata (not TWRP wipe which excludes /sdcard). We upgraded to whatever the current was probably during the L or M bringup and all was good. https://github.com/HashBang173/andr...6a6190a#diff-bc7b36fe4d2924e49800d9b3dc4a325c

https://review.lineageos.org/c/LineageOS/android_kernel_motorola_msm8992/+/92717

Later on when I was rebasing the kernel for Nougat, I merged in the latest F2FS changes, but it required a custom version of TWRP and caused corruption issues when swapping between ROMs which was not ideal for the user so I eventually reverted to the F2FS tree that was known working and used in the ship of cm-13.0 and cm-14.1 for clark. https://github.com/HashBang173/andr...ac6a381#diff-bc7b36fe4d2924e49800d9b3dc4a325c

So my rebased cm-14.1 kernel (for Nougat based blobs, never shipped lineage officially with it though) and lineage-15.1 kernel have that tree of F2FS if you are wondering.
[X Style (Pure) Android Development] randomblame:
Ok, tested and confirmed current los16 kernel is working fine with nougat, camera is fully functional too.

At least there aren't any regressions there
[X Style (Pure) Android Development] josuearisty:
So, it means that the kernel is not the problem to make the camera work. Am I right?

Enviado desde mi Nexus 5X mediante Tapatalk
[X Style (Pure) Android Development] randomblame:
Nothing wrong with the kernel I was just checking for my sanity
[X Style (Pure) Android Development] Marco275:
Great! Thank you very much! But i'll keep waiting until everything works, because the Style is my everyday device.

---------- Post added at 02:33 PM ---------- Previous post was at 02:07 PM ----------

Hi randomblame,

I Just discovered this forum and your efforts. Thank you for your work. I'm from Holland thus I own aan European version of the moto X. XT1572 (Style). Is your version also compatibele with thuis device?
[X Style (Pure) Android Development] kadopt:
Yes it is, I'm also using a EU Moto X Style XT1572, you need to be on stock Nougat to update to this rom or at least have nougat bootloader and modem.
[X Style (Pure) Android Development] Marco275:
Ah, great. Thanks for the info. My device is running on Nougat.
[X Style (Pure) Android Development] Marco275:
Deleted
[X Style (Pure) Android Development] xdafan15:
Looking for updated ROM for XT-1575

[MENTION=1776875]randomblame[/MENTION], thanks for all the work you've put into this. We all really appreciate it!

Same to [MENTION=4630246]Hashbang173[/MENTION]!

Forgive my ignorance, but just asking to be sure- As of today (December, 2018), is this the only option for someone looking for a security-patched ROM to resurrect a Moto X Pure? In other words, all other ROM development projects have gone dormant?
[X Style (Pure) Android Development] obsolete1:
That's a pretty accurate statement. I haven't built anything new in months and this is about the only active thread we've got. Wish everyone the best of luck with getting Pie functional and I wish I could help but this is all way over my head.
[X Style (Pure) Android Development] randomblame:
Sorry for the holiday slowdown peeps I'll try to get on the computer this weekend.
[X Style (Pure) Android Development] kadopt:
Found a bug, call audio does not work with Bluetooth, nothing is heard, multimedia audio works fine.

Also my device was getting kinda slow so I cleaned all temp files with SD Maid pro then trimmed all flash partitions (with Trimmer (fstrim)) and is now quite better.

Apps are still being reloaded while multi tasking...