yashsingh1/xdaforums huggingface dataset:
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] nighthawk676:
Greetings!

Hoping this is the correct forum to ask about putting LineageOS on my Moto X4.

The X4 is on the device list for LineageOS and MicroG, so I felt confident about doing this based on that fact.

Running into a problem right away - as I'm not able to unlock the bootloader on my device.

On Moto's website, at the unlock page and after entering my unlock codes, I get a popup that states my phone isn't able to be unlocked...

When I reboot into fastboot, it displays the model as XT1900-1

The current OS is Android9.

From my research it looks like there are other people out there that have been able to unlock similar models.

I read some other posts about there being an amazon version and a "normal" version of this device, but in my reading it looked like the amazon version was a diff model #...

Wondering if anyone has any thoughts or suggestions for unlocking as well as possibly helping to confirm that I am trying this on the correct model device?

Thanks!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] JimDandy68:
@nighthawk1986, I have an XT1900-1 with bootloader unlocked. But, read this. Firmwares are different. I never had Alexa or Amazon ads, etc. I wonder if you can use one of the stock images (e.g., RETUS from lolinet) and either Lenovo's tool or one of the bootloader flashing scripts to get rid of Amazon's firmware?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] nighthawk676:
Thanks @JimDandy68 - I've looked at the info you provided and it looks like you cant even use a custom script without the bootloader unlocked. I had a motorola chat session going earlier today and someone there advised that even though my model was xt1900-1 that based on other bootloader info it was the amazon version, which they will not unlock.

Going to try to return this now. Thanks for the help!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] JimDandy68:
@nighthawk1986, sorry that wasn't an option. Hope you can return it. I was actually happy to find with mine that not only should I be able to use LOS, but I've currently flashed it as a FI version, which brings me up to stock Pie with October 2020 security updates.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] JimDandy68:
I've tried every variation of LOS installation I can think of, but I cannot successfully retain mobile data. If anyone who has faced this issue has any tips, I'd love to know.

I also have found that I cannot boot the LOS recovery from fastboot, so I have to at least temporarily boot into TWRP from stock to do the rest of the steps, as suggested in the OP. I thought maybe using only the LOS recovery would be worth trying, but no luck.

Thanks
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] cannondale0815:
I can now confirm myself that a dirty flash from LOS16 to this version worked fine on a XT1900-1 (Android One Fi version). Only wrinkle was that I had to flash GApps again (I chose OpenGApps Stock), otherwise it would complain about corrupted data and wouldn't boot.

I installed Open Camera on my mom's LOS17.1 Moto X4, and it recognizes both cameras and works very well. It also lets you select a different storage location, although I noticed that the integration with Google Photos (tapping on previews in camera app) doesn't work well when the storage location is changed.

Yes, I flashed the altered bootloader.img from this post here, which successfully hides the verity message on my XT1900-1. In case flashing that bootloader results in a boot loop (can happen if the bootloader is incompatible with the rest of your system, depending on which stock ROM you were on last), find your original bootloader somewhere here to get back to normal.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] cannondale0815:
Regarding adoptable storage, I found this old breadcrumb buried in this long thread. Is adoptable storage confirmed to be fully working when verity & file based encryption are completely disabled? I only saw @Online Gravy comment on the success, but no one else.

P.S.: And I assume the edits to the fstab need to be manually repeated after each LOS update, as mentioned here, correct?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] ThE_MarD:
Heyyo @JimDandy68 , tbh I haven't tried magisk on payton and I probably won't as it isn't officially supported by LineageOS, so I'm unsure if that could somehow cause issues for us? I'd recommend trying without magisk.

@mikedeaster , the stock camera app only supports the primary rear camera. If you want to use the secondary rear camera? You will need to use a gcam mod by wichaya which works perfectly with all three cameras, or the Motocam2 modified versions.

wichaya's gcam mods:

https://www.celsoazevedo.com/files/android/google-camera/dev-wichaya/

Motocam2 for payton:

https://sourceforge.net/projects/nemesisteam/files/MODs/Moto-Camera-2/List-N1/

@cannondale0815 , For our 4.4 kernel? It is correct that file-based encryption for us on our main storage is not compatible with adaptable storage for our microSD Cards. I'm not too familiar with the issue so tbh I'm unsure if it's something we can easily fix on payton... I've added it to my payton to-do list though to see if it is something in the future we can resolve.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Priddles:
Hi! I followed all the steps and can successfully boot into Lineage OS, but I'm stuck in an infinite boot loop.

Spoiler content hidden.

If the phone is not connected to my computer via USB, it reboots after 3-10 seconds. Next, it boots straight into Lineage's recovery and suggests a factory reset. After resetting, it boots successfully into Lineage OS and then the cycle repeats.

This is almost identical behaviour to this Reddit post. According to them, their bootloop was because they didn't confirm that their device was on the latest Pie firmware, and fixed it by flashing a stock ROM. In my case, I made doubly sure I was on the latest update, so that is probably not it. I even flashed the stock ROM from motostockrom.com and confirmed it was working, before trying to install Lineage again. No luck.

Any idea why this is happening? How could I fix it?

Thanks.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] SyberHexen:
Did you flash copypartitions.zip after restocking?

If not...

boot twrp and switch slot to A (or use fastboot command)

Reboot to to recovery and flash the copypartitions.zip
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Priddles:
I flashed copypartitions.zip both times. Hard-brick warnings are not to be ignored 🙃
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] JimDandy68:
@ThE_MarD, thanks, but last couple of times I tried, I didn't even install Magisk. I did reboot to recovery each time and install OpenGapps nano, but that's it.

I'm now seeing these problems other people are having. I wonder whether anyone who's successfully flashed from stock can precisely detail the steps they used.

For instance, last time I tried, it was like this:

Boot to bootloader

fastboot boot twrp.x.x.img (I have not succeeded doing this with the LOS recovery img, so just using latest TWRP img)

Within TWRP, sideload copy-partitions.zip (here's where I'm not sure I might have messed up - e.g., needed to check my slot from within the Reboot menu, and maybe installed TWRP zip and rebooted to recovery before installing copy-partitions.zip)

Again within TWRP, either sideload from computer or directly install LOS zip from extsd

Reboot to recovery and install gapps (sideload or directly from extsd)

Reboot, get to setup (this goes fine, but I always lose mobile data)

There are many variations I could try after fastbooting the TWRP img. For instance,

I could nstall TWRP or skip that step (I know it will get overwritten by LOS recovery after that's installed).

I could directly install copy-partitions vs sideloading, and same with other steps.

I could check my slot before installing copy-partitions, confirm that I'm on A, then reboot to recovery before performing copy-partitions (again, I feel like maybe here's where I'm messing up)

I could reboot after copy-partitions and before flashing LOS.

You get the point. I feel like others know the exact details of what to do in each step, and that I must be missing something. I think the official instructions, either in the OP or on LineageOS's site, aren't quite this prescriptive.

Thanks to everyone for the help.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] ThE_MarD:
@JimDandy68 I think I'll try and make a flashable zip that will update the device firmware on both slots to the recommended ones. I Can do it for reteu, fi, retin, retail as I know those four are the main ones... or is there other variants I should also do?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] JimDandy68:
@ThE_MarD, that would be awesome, thanks. RETUS or FI would work for me. I'm not even sure whether the firmware is different with regard to data on T-Mobile. I chose to update to FI since it's still getting security updates, but might return to RETUS before going to LOS again if it makes more sense.

I still wonder what I'm doing wrong, but if you can throw together something that will help with dual-slot firmware issues, that would be great.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] wkn000:
All necessary stock firmware you could find here: https://mirrors.lolinet.com/firmware/moto/payton/official/

Also you may have a look in this thread: https://xdaforums.com/t/guide-video-text-how-to-flash-official-factory-firmware-moto-x4.3808348/
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mikedeaster:
front camera only 4MP in any camera app (in specs 16mp)
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] wkn000:
@mikedeaster

I use this one on my Moto X4 (XT1900-7): https://apk.support/app/com.motorola.camera2

Switch between 4MP and 16MP for front camera in options possible.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] JimDandy68:
I should also have said, if what you were thinking of was basically a modified version of @munchy_cool 's flash-all script(s), I could edit my own if I knew which operations to keep in and which to remove. I know I've read that non-HLOS.bin may be the key file, but that's a really uneducated guess as to what I'd need to re-flash after installing LOS, if I have data loss.

Thanks again
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] HulkSmashBurgers:
I'm trying to flash for the first time and I'm getting a reboot shortly after booting into Lineage. It boots to the "Just a sec..." screen, then shows the "Connect to WIFI" screen, then I see Powering Off and it reboots to TWRP.

I followed the guide here, except I'm using TWRP to flash.

Install LineageOS on payton | LineageOS Wiki

wiki.lineageos.org

I made sure to wipe data and flash everything in the correct order.

It's the Fi/One model and is up to date.

Lineage 20201222

TWRP 3.4.0-1-payton

opengapps-arm64-10.0-nano-20201223

edit: Flashed Lineage and nothing else using TWRP and didn't re-flash TWRP. Got the Lineage loading screen, then it rebooted to Lineage recovery.

Can't load Android system. Your data may be corrupt... blah blah.

E:Failed to bing mount /mnt/staging/emulatedmedia/0 to /storage/emulated: No such file or directory

E:emulated failed to bind moount /mnt/staging/emulated/media/0 on /storage/emulated: No such file or directory.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] ThE_MarD:
Heyyo @unknownsoldierx , what was the stock ROM you had last installed before trying LineageOS?

I haven't had time yet unfortunately to try and make device firmware installer zips as I'm at work meow... Hopefully I'll have time one of these nights though
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] HulkSmashBurgers:
I'm not 100% sure since I didn't check before flashing, but it was up to date, so I assume it would be the same ROM that Restore and Smart Assistant put on there.

PAYTON_FI_PPWS29.69_39_6_12_subsidy_DEFAULT_regulatory_DEFAULT_CFC
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] pamau:
Hi @Priddles, hi all,

I have exactly the same issue with my Moto X4 and Lineage OS 17.1. I installed everything rgarding the description of Install LineageOS on payton.

After the installation I could start my X4 device and setup everythin as long as USB is connected. When I dissconect USB the devices power down and start ino the RECOVERY mode with the followin massage:

Can`t load Andorid system. Your data may be corrupt. If
you continue to get this message, you may need to perform
a factory data reset and erase all user data stored on
this device.

When I connect USB again, I could start and use the device as long as USB is connected

When I disconnect the USB, I could start the device but after complete bootup, it power down again

after reinstallation of the stock ROM from motostockrom.com I could also confirm that everything is working fine, but when I reinstall Lineage OS 17.1 again I got the same issue

I always did the Step "Pre-install instructions" of Install LineageOS on payton description to copy the contents of slot a to slot b

before I started with installaiton of Leneage OS, the latesed version of Android Pie was installed

I don´t think this is an issue of slot a/b installation because I could boot the device completly. It crashs after boot sequence is completed or when I disconnect the USB cable. For me it looks like that Lineage OS 17.1 has an issue.

Device Product/Variant: payton XT1900-7 32GB P4

Has anybody an idea how this issue could be solved?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] pamau:
Hi @Priddles, Hi @unknownsoldierx,

I think all three of us having the same issue. We running into a reboot shortly after booting into Lineage.

See:

Post #1,819 from Priddles

Post #1,823 from unknownsoldierx

Post #1,826 from me (pamau)

I did some tests with different versions but without success. Here are my tested version:

Tested recovery images:

lineage-17.1-20201229-recovery-payton.img

lineage-17.1-20201201-recovery-payton.img

twrp-3.4.0-1-payton.img

Tested LineageOS versions

lineage-17.1-20201229-nightly-payton-signed.zip

lineage-17.1-20201201-nightly-payton-signed.zip

Tested with and without installation of Open Gapps

Installed android version before I started the installation of LineageOS 17.1:

Android Version: 9

security patch level: 1. September 2019

Baseband-Version: M660_7045.36.01.100R PAYTON_EMEADSDS_CUST

Kerel-Version 4.4.153-perf-g3ff98f3

Build Number: PPWS29.69-37-5

Hi all,

is a server available where I could found older nightly builds of LineageOS 17.1 for Moto X4 payton?

Or does anybody could name a well-known version that worked?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] frazazel:
I'm experiencing this same issue. The phone works fine until I disconnect the USB cable, whereupon it very soon powers down. It won't see the internal storage until I plug the USB cable in again, either. This was with the 2020-12-29 nightly. Downloading the 2020-12-15 nightly to test to see if it does the same.

I also think I goofed up the gapps install, where I let the phone fully boot up before installing it.

Edit: So, it didn't fix the behaviour. I notice that when it powers down, it reboots but fails and gives a message about corrupt data in the recovery app. When choosing to try again, it successfully boots, but powers down after a short time.

Other information: I'm using a 128GB micro SD card that is configured as adoptable storage.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] pamau:
Hi @Priddles, Hi @unknownsoldierx, Hi @frazazel,

for your information, I found two issues on LineageOS GitHub server which describing the same issue.

Issue #2854

Issue #2884

Also interesting is this thread: Link

Hi All,

could somebody provide a image version via file hoster with build date 20201124 or older? It seams that an old image could be used a a work arround and update this via OTA.

Best Regards
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] holovin:
Finally, I understood why the system was not updated, for me this is a strange phenomenon. When I inserted the SIM into the phone, the system was updated to Android Pie o_O
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] frazazel:
The issue tracker says this issue is fixed for the next release. It was MotoActions that was the culprit.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] ThE_MarD:
Heyyo, anyone having the reboot issue, can you please send me logcat from boot? I've seen on gitlab issues there's some logcat but not from boot.

The reboot issue might stem from persist partition having wrong sehash which should have been fixed, but for some reason it seems some devices aren't getting fixed.

I also need the result of this command from anyone with this issue:

ls -l -a /mnt/vendor/persist
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] NTICompass:
I was going to install this ROM, but the download page is 404! https://download.lineageos.org/payton

It was working like an hour ago... where can I get the builds?

EDIT: I guess I should've read this thread and seen the bug reports...
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] pamau:
Good Morning @ThE_MarD,

it is strange, but I couldn´t reproduce the reboot issue again. Yesterday I installed a PixelExperience ROM for testing. This PixelExperience ROM didn´t show any reboot issues. It seams that after this step also new LineageOS installations doesn´t bring-up the issue again. Also a pre-installation with the Motorola PAYTON_RETAIL_9.0 couldn´t bring back the issue.

The good thing is that I have a second device. Maybe I could reproduce the issue on this device again.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] pamau:
Hi @ThE_MarD,

my second device also showing the reboot issue. It looks like that I couln´t reproduce the issue on my first device after installing PixelExperience ROM. Attached you will find the requested logs. One directly after installation and one after the first reboot. If you need more logs or test, please let me know.

Result of commend: ls -l -a /mnt/vendor/persist

>> ls: /mnt/vendor/persist: Permission denied

Additional Information regarding open System --> Advanced --> Moto Gestures:

1st device => I could open the setting

2nd device which is showing the issue => I can´t open the settings, app crashing

Best Regards and thank you for your support!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] ThE_MarD:
Thanks @pamau I'll try to review your logcat

For persist you will need root for that command. You can use a PC with the command "adb root" and then adb shell to get the result of that command
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] pamau:
Hi @ThE_MarD,

thank you for your annswer. Sorry I did´t know that root is required (and also how to do this was new for me ;)). Here is the resut of my 2nd device which showing the issue.

Best Regards

Microsoft Windows [Version 10.0.19042.685]
(c) 2020 Microsoft Corporation. Alle Rechte vorbehalten.

C:\platform-tools_r30.0.5-windows\platform-tools>adb root
* daemon not running; starting now at tcp:5037
* daemon started successfully
restarting adbd as root

C:\platform-tools>adb shell
payton:/ # ls -l -a /mnt/vendor/persist
total 132
drwxrwx--x 32 root system 4096 2020-12-29 04:13 .
drwxr-xr-x 4 root root 80 2020-12-29 04:13 ..
drwxrwx--- 2 system system 4096 1970-01-01 01:01 alarm
drwxr-xr-x 2 vendor_mot_pwric vendor_mot_pwric 4096 2018-02-10 21:36 batt_health
drwxrwx--- 2 bluetooth bluetooth 4096 1970-01-01 01:01 bluetooth
drwx------ 2 root system 4096 1970-01-01 01:01 bms
drwxr-xr-x 2 vendor_mot_tcmd bluetooth 4096 1970-01-01 01:01 bt
drwxr-xr-x 7 vendor_mot_tcmd vendor_mot_tcmd 4096 1973-03-07 13:38 camera
-rwxrwx--- 1 root root 12 1970-01-01 01:00 captouch_basedata.bin
drwxrwx--- 2 system system 4096 1971-02-25 14:11 chargeonly
drwxrwx--- 2 root root 4096 1970-01-01 22:07 coresight
drwx------ 5 system system 4096 2017-10-26 21:20 data
drwxrwx--- 2 system graphics 4096 1970-04-17 23:34 display
drwxrwx--- 2 system system 4096 1970-01-01 01:01 drm
drwxr-xr-x 5 vendor_mot_tcmd vendor_mot_tcmd 4096 1970-01-01 01:03 factory
drwxrwx--- 3 vendor_rfs vendor_rfs_shared 4096 1970-01-01 01:01 hlos_rfs
drwxrwx--- 2 root system 4096 1971-02-25 14:11 hvdcp_opti
drwxrwx--- 2 system system 4096 2020-12-29 04:13 iar_db
drwx------ 2 root root 4096 1970-01-01 01:00 lost+found
drwxrwx--- 2 radio radio 4096 1970-01-01 01:01 mdm
drwxrwx--- 2 system system 4096 1970-01-01 01:01 misc
drwxrws--- 2 vendor_mot_tcmd vendor_mot_tcmd 4096 1970-01-01 01:01 paks
drwxr-xr-x 11 vendor_mot_tcmd vendor_mot_tcmd 4096 1971-02-25 14:11 public
drwx------ 2 system system 4096 1970-01-01 01:01 qti_fp
drwx--x--x 6 vendor_rfs vendor_rfs 4096 1970-01-01 01:01 rfs
drwx------ 2 root root 4096 1970-01-01 01:01 sds
drwxrwx--- 2 system system 4096 1970-04-17 23:34 secnvm
drwxrws--- 2 drmrpc vendor_mot_tcmd 4096 2017-10-26 21:19 security
drwxrwxr-x 2 system system 4096 1970-01-01 01:01 sensors
drwxrwx--- 2 system system 4096 2017-12-27 11:25 time
drwxrwx--- 2 media media 4096 1970-04-17 23:34 vpp
drwxr-xr-x 2 vendor_mot_tcmd vendor_mot_tcmd 4096 1970-01-01 01:01 wifi
drwxrwxr-x 2 vendor_mot_drm vendor_mot_drm 4096 1970-01-01 01:01 wmdrm
payton:/ #
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] ThE_MarD:
@pamau thanks man I'll review that and what we have in init.qcom.rc and try and figure out what's going on.

By chance do you know the exact version of the stock ROM that was on that payton before flashing custom ROMs? Usually this bug seems to be triggered when coming from pie stock ROM to custom, but I tested with the latest Fi build for Payton straight to LOS 17.1 and it was working for me, so I'm unsure if there's a different variants of stock ROM doing different changes.

Can you also please use this logcat command?

adb logcat -B all -d > logcat.log

That will force logcat to dump all lines as the regular logcat command won't show shell executions, which is what the force wiping of sehash is trying to do
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] pamau:
Hi @ThE_MarD,

I added the requested logcat information to this post. I wrote down the versins numbers of the stock ROM before I started the installation of LOS 17.1. I hope you don´t need more information, because this is all I have and I don´t think there is a possibility to readout this information after LOS 17.1 installaiton :( .

Please let me know, if you need more log information.

Installed android version before I started the installation of LineageOS 17.1:

Android Version: 9

security patch level: 1. September 2019

Baseband-Version: M660_7045.36.01.100R PAYTON_EMEADSDS_CUST

Kerel-Version 4.4.153-perf-g3ff98f3

Build Number: PPWS29.69-37-5

Thank you and Best Regards
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] JimDandy68:
@ThE_MarD, thanks, don't sweat it. Right now, I'm staying put with Pie FI.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] pomdp:
I can confirm that installing LineageOS after installing and booting into PixelExperience fixes the problem for me, for now. If any other information is needed, I am happy to provide it.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] chainzuck:
Hello there, can someone tell me why there are no builds available do download on lineageos.org for payton? Lineage still lists the device but says no downloads available. Did I miss something in this thread? Is there no more official release?

Thank you in advance!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] pamau:
Hi @chainzuck

I think the power down issue is the reason why there are no more images available. All builds for Motorola with sdm660 are removed.

See here: https://xdaforums.com/t/rom-official-lineageos-17-1-nightlies.4076569/post-84208825

Hi @ThE_MarD,

I think the following post could be also interesting for you. Especeally the commit form @Jleeblanch with the potential solution for Moto G7. Maybe this is also the solution for Moto x4.

Link: https://xdaforums.com/t/rom-official-lineageos-17-1-nightlies.4076569/post-84209831 or https://xdaforums.com/t/rom-official-lineageos-17-1-nightlies.4076569/post-84210541

Best Regards