yashsingh1/xdaforums huggingface dataset:
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] jatinkhatri:
--------

addison:/ $ su

addison:/ # fmconfig

fmconfig - FM V4L2 device configuration application

Usage:

<command> <opts..>

enable Open and initialize FM Radio device

disable Close FM Radio device

setfreq <freq > Set Frequency ex. setfreq 93500

getconfig Get Current Configuration

seek <up/down> Seek <dir> ex. seek up

scan <up/down> Scan for list of stations ex. scan up

searchlist Search a list of stations

quit Quit application

>enable

Enabling FM ....

VIDIOC_QUERYCAP returns :0: version: 201247

Driver Version(Same as ChipId): 3121f

qsoc_onpath = fm_qsoc_patches 201247 0

init_success:1 after 1 seconds

emphasis :0

spacing :2

RDS system :1

Band :1

RdsOptions :17

Cmd Status .... 0

>Starting FM event listener

FM enabled

fmconfig - FM V4L2 device configuration application

Usage:

<command> <opts..>

enable Open and initialize FM Radio device

disable Close FM Radio device

setfreq <freq > Set Frequency ex. setfreq 93500

getconfig Get Current Configuration

seek <up/down> Seek <dir> ex. seek up

scan <up/down> Scan for list of stations ex. scan up

searchlist Search a list of stations

quit Quit application

>setfreq 107.3

Setfreq 107.3

Setting frequency .... 107

SetFrequency Receiver entry freq = 107

Cmd Status .... 6

>setfreq 107

Setfreq 107

Setting frequency .... 107

SetFrequency Receiver entry freq = 107

Cmd Status .... 6

>
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] dedraks:
fmconfig - FM V4L2 device configuration application
Usage:
<command> <opts..>
enable	Open and initialize FM Radio device
disable	Close FM Radio device
setfreq	<freq >	Set Frequency ex. setfreq 93500
getconfig	Get Current Configuration
seek	<up/down>	Seek <dir> ex. seek up
scan	<up/down>	Scan for list of stations ex. scan up
searchlist	Search a list of stations
quit	Quit application

>enable
Enabling FM ....
VIDIOC_QUERYCAP returns :0: version: 201247
Driver Version(Same as ChipId): 3121f
qsoc_onpath = fm_qsoc_patches 201247 0
init_success:1 after 0 seconds
emphasis	:0
spacing	:2
RDS system	:1
Band	:1
RdsOptions	:17
Cmd Status .... 0
Starting FM event listener
FM enabled

> setfreq 99100
Setfreq 99100

Setting frequency .... 99100

SetFrequency Receiver entry freq = 99100
Cmd Status .... 0

tuned freq: 99100

> getconfig
Current Parameters ....
Station : 99100
Service Available : 0
Rssi : 0
Audio mode : 0
Rds sync : 0
Mute status : 0
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tomparr:
.

The kernel has support for Qualcomm IRIS FM built-in, but the RSSI signal strength value of 0 indicates that no signal is found.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] DroneDoom:
Why is zram enabled on stock? 3gb of ram doesn't really justify why Moto devs enabled this.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] shrisha:
Got boot loop today with remove forced encryption script and v03 kernel. Had to reflash stock firmware and did all over to setup the phone. TWRP 3.1.0.0 and was some error after wiping user data.

Just leting you know :)
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] DroneDoom:
Technically the last step wasn't finished yet. I also had problems too in TWRP to wipe away encrypted data I used both methods of wipe (advance wipe and data wipe that requires you to type in confirmation) and eventually one of them actually cleared the data partition.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tomparr:
Beats me.

Although it seems to be limited to 512MB, I am gonna remove it and see how it works out.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] epivitor:
In the first post the steps are not that clear for someone who wants to remove forced encryption.

Can somebody please explain with a little more details.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] felipevsw:
Download the zip and flash it using TWRP recovery
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] epivitor:
Thanks for reply but my question is more about when I should do that, before or after flashing F2FS and superSU ?
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] prins29:
Forced encryption remover is not depend on F2fs or SuperSU ..

U just have to flash the zip and clear userdata in fastboot to complete the process
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] epivitor:
So I can first flash f2fs and SuperSU, reboot the phone, and later remove forced encryption and wipe userdata without affecting SuperSU?

Can you please write for me the command I have to run in fastboot to clear userdata?
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tomparr:
Thanks for the hint, I edited the OP to make this clearer. I still run everything encrypted. Since SuperSU is installed on the data partition, it will be deleted when wiping the data partition to remove encryption. The correct steps would be to first remove encryption, then flash the kernel and flash supersu last.

To clear userdata from fastboot use:

fastboot erase userdata
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] DroneDoom:
Delete
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] prins29:
Deleted​
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] heribruc:
Good day.

For remove encription, is "fastboot erase userdata" or "fastboot format userdata" ?. I ask because i try wipe->internal storage in twrp and every time i get a bootlop and aparently lost partition so i recover using script to downgrade to MM, and searching some forums say use format instead erase. I use TWRP 3.1.0 from [MENTION=4480917]Alberto97[/MENTION]. After wiping via fastboot, should I reflash kernel? I'm using Dedraks' Essential ROM with this kernel instaled.

Sorry for mi english
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tomparr:
I always use "fastboot erase userdata". Also try to wipe the data and cache partition only (Wipe -> Advanced Wipe -> Select data and cache).
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] Strait_Hopper:
Thanks so much to [MENTION=4539224]tomparr[/MENTION] for getting root working on the Moto Z Play.

A quick noob question for y'all: if I follow these steps while using the stock ROM, what if anything do I need to "undo" to successfully apply OTA updates? Do I only have to unroot and flash stock recovery, or will the modified kernel prevent OTAs from installing successfully?

If getting OTAs via this method is possible, I assume that to get root back, I just have to re-flash twrp then use it to install supersu again?

Thanks in advance for your help!
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] prins29:
You have to unroot (unroot requires flashing stock boot.IMG) flash recovery and if you made some changes in system than you have to flash systemsparks.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] Strait_Hopper:
Great, thanks. Do I need to use a version-specific boot.img each time (i.e. 7.0N or 6.0MM)?

Just to be clear - would the following be the correct way to get OTA then restore root?

1. unroot (via SuperSU app)

2. fastboot flash stock boot.img and recovery.img

3. boot to system - download and install OTA

4. reboot to system (to let OTA finalise) then back to bootloader

5. re-flash TWRP

6. go to TWRP, re-flash SuperSU

Do I need to wipe userdata?

Do I need to reflash the kernel via TWRP, or is that unaffected by OTA updates?
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tomparr:
Unroot is rather optional, as it gets overwritten when you flash the stock boot.img. Only one file should remain on the data partition which will be overwritten when you reflash SuperSU.

Wiping your userdata is not needed but you need to flash the kernel again because most OTA updates include an updated kernel.

To summarize, the following steps are required:

1. unroot (via SuperSU app)

2. fastboot flash stock boot.img and recovery.img

3. boot to system - download and install OTA

4. reboot to system (to let OTA finalise) then back to bootloader

5. flash TWRP

6. in TWRP, flash kernel

7. in TWRP, flash SuperSU
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] heribruc:
Thanks, I try "fastboot erase userdata" and works very well, backup before. Now storage is decripted, thanks.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tag68:
Is it possible to easily find out if the patch for f2fs loopback device did it into the match 2017 update for nougat Z Play which I read somewhere is being distributed atm?
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tomparr:
Not to my knowledge. The pull request on github is still open, but since Motorola is not releasing the source code of security updates we can't be sure about it. But to be honest, I don't think they included it.

The only way to test I could think of would be to extract the kernel from boot.img and repack it into a TWRP image. Afterwards you could boot the modified TWRP and try to mount an image, e.g. the su.img from SuperSU.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] dedraks:
I can confirm that latest ota (NPNS25.137-24-14) includes f2fs fix.

Edit.

Stock kernel mount loopback devices read only. Magisk hide wont works.

Tomparr's kernel mount those devices writable.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] attack11:
Hi [MENTION=4539224]tomparr[/MENTION] , Can you share your sources please?
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tomparr:
Sure, its over at Github.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] lihanchen:
I flashed NPN25.137-24-1_1 reteu and flash Nougat v3.0 patch and get a boot loop on first screen (the bootloader unlocked page with error msg: bad key)

the security patch level is March, 2017

Anyone know how to fix it

Or anyone has a link of NPN25.137-15 or any other Nougat image that is working?
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] prins29:
https://1drv.ms/u/s!AryUww1_9vvCgushk8EWNRZBQWnXOw

Flashing this boot image will helps you . It's stock nougat boot.IMG.

Flash it via fastboot with

Fastboot flash boot boot.img
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] lihanchen:
Thanks. Do you mean that this kernel will fix the bootloop and get into system or the kernel is compatible with f2fs patch and I can flash this kernel and flash f2fs patch?
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tag68:
Try it out. Flash the kernel, boot. See that it works fine. Boot into fastboot, flash f2fs fix kernel, boot. If it doesn't work, back to kernel without f2fs fix. And please tell us what happens so others don't need to do the same experiences, wasting time with the same actions you did ;)
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] prins29:
It will remove the boot loop .. and I am using this boot.img with f2fs fix .. so try to flash the f2fs fixes kernel after .. once you boot into system .
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] lihanchen:
Thanks guys. It worked.

P.S. I flash f2fs patch and reboot and then flash Magisk 12 this time. Before, I flashed both in the same boot. It might be the reason of the bootloop as well.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] VR25:
Hey [MENTION=4539224]tomparr[/MENTION], I just concluded that right after flashing Magisk or SuperSu over your kernel, the system integrity is broken. So, I can't flash OTAs even though the rooting method is systemless (and even after restoring the stock boot.img). Also, I checked for whether I've mounted /system rw at some point in time, but no, I didn't. For safety, I use no apps that do that without my explicit consent.

When trying to flash OTAs, the recovery says "/system has been mounted rw," along with a count of how many times that happened, and the exact date & time of the last occurrence.

My question is... under a systenless root, isn't /system kept strictly read-only to preserve its integrity?

:confused:
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] prins29:
For installing OTA I have to flash unrooted boot.img back . Even in systemless su ...

But like system su u don't have to flash whole systemsparks
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] VR25:
Yes, that's what I would do, but the problem is /system is reported as modified (mounted rw) upon OTA instalation. Even though I didn't deliberately touch anything that shouldn't be messed with. So, I must reflash the system image as well to be able to install OTAs.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tomparr:
The kernel only touches the boot image so either Magisk or SuperSU modified your system at some point. A recovery.log would be helpful to reconstruct it. The only other possibility I can think of is that you (maybe accidentally) copied/deleted something on /system while in TWRP.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] VR25:
I've repeated the process countless times. So, the TWRP hypothesis is not a possibility. On the other hand, It's hard to think that any of these systemsless root methods touches the system partition, defeating the whole purpose.

I would think that just by mounting /system, even read-only, with something other than the stock recovery, some security switch is triggered.

... But that just doesn't seem to make any sense... or does it?

PS. The other day, I've tried to systemless root after the March security update, under the STOCK kernel. The instalation worked. All the binaries were in place, except there was no root access. I think the stock kernel keeps loopback devices read-only.

The point is, later when I tried to fix the issue by flashing the f2fs-fixed kernel on top of the patched stock boot.img, followed by systemless SuperSU, the script displayed an error... something like "OTA impossible."

I've deleted the stock kernel backup and su.img under /data before the attempt.

The process was successful in rooting though. The "OTA impossible" message came up after SuperSU zip tried to restore the stock ramdisk on top the fsf2-patched kernel during the rooting process.

This right there suggests that the f2fs-patched kernel may have something to do with the /system rw issue that breaks OTAs.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tag68:
Are you sure that this message does not mean that boot is modified? SuperSU usually gets installed on an unmodified boot partition, but here it does not get the original one, but one with a modified kernel, which does make OTA impossible (until original boot is restored). I don't want to say that system is assured not to be modified at this point, but the message is something I'd think could be expected already if boot is modified by f2fs fix kernel install. Why do you think it tells something about system?

Did you get the log from /cache/recovery?
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] VR25:
You've got a point there. Cheers! "OTA impossible," it makes sense for SuperSu to display such a message. No original boot, no OTA. Thanks!

But still, the mystery is not solved. I can't figure out what's mounting /system rw. Next time I go through all this, I'll take a look at the recovery logs.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tag68:
Why not now, seeing the last actions in recovery? Did you do anything else in recovery than the actions you told here? Until you boot recovery again, the logs will stay. Take Total Commander or whatever you prefer, and copy the contents of /cache/recovery somewhere. Then you may have a look at it.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] VR25:
Because I reverted everything to install the latest OTA. I'll go through the root process again tomorrow.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] GryphonBR:
Sorry for barging in, but I need some similar help here. I figured App2SD was the culprit in my case, it modified my build.prop and that caused my "Modified" status on the bootloader (or, at least, my system was reported as unmodified before that). Still, since I applied both f2fs and RemoveForcedEncryption to my phone before installing Magisk, I figured I no longer have the original boot.img around (although, bizarrely, I was pretty sure I took a dump from my boot partition somewhere in my phone...). Either way, I was wondering where I could find a Nougat boot.img to flash on my phone and install the latest OTA (specially because I don't want the annoying notification to stay in my status bar, hehehehe).
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tomparr:
Thanks to [MENTION=4661942]flashallthetime[/MENTION] you can find one here:

https://www.androidfilehost.com/?fid=457095661767138793
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] VR25:
[MENTION=4539224]tomparr[/MENTION], [MENTION=6192363]tag68[/MENTION], I've found something...

TWRP 3.1.0-0 recovery log says the following at the end,

"Renamed stock recovery file in /system to prevent the stock ROM from replacing TWRP."

Recall that I've set it not to modify the system partition!

Now, is that the real deal?

Edit

1. Yes, TWRP is the culprit!

2. OTAs will still install even if /system has been mounted rw, as long as files remain untouched.

Conclusion: TWRP 3.1.0-0 seems to have a bug. It modifies /system even when the user explicitly tells it not to do so. It happens right before reboot. A possible workaround would be to force reboot once all operations are finished by long pressing the power button. This way, the recovery won't perform the action that precedes this message, "Renamed stock recovery file in /system to prevent the stock ROM from replacing TWRP."

[MENTION=4480917]Alberto97[/MENTION], could you verify that?
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tomparr:
Although I have the same message in my log file, the file in question on the system partition is not renamed as it should be according to the source code. Bootloader also states that system is not modified. So I guess the read-only mode from TWRP works correctly and the message is printed by mistake.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] VR25:
In my experience, even with a modified system, the bootloader still says "official." I've tested that several times. So, it is not always an accurate way to tell whether the partition has been modified.

I have confirmed that the file was not renamed... but someting was modified. Now I have a bug myself! :confused:
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] GryphonBR:
Thanks, I'll give that a try and report back.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] karmacoma7:
I dont know what going on.

unlocked BL

flashed TWRP recovery

had to reflash stock since partitions got messed up

now, I get the kernel + root, but then I change data and cache to f2fs I just get plain bootloop!

EDIT:

it bootloops only if I format cache to f2fs...

changing it back to ext4 makes phone boot again...
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] felipevsw:
I removed force encryption yesterday and was wondering if I return to stock it'll be encrypted again... Can anyone tell?
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] prins29:
Yes flashing whole stock rom will encrypt u again.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] sidg2:
[MENTION=4539224]tomparr[/MENTION] After flashing f2fs kernel patch, we have to erase user data partition for f2fs filesystem. It installs new modified kernel in boot.img. Then if we want stock boot.img for ota updates, we have to reflash the stock boot.img. OK, I understand.

Q1. But, Do we also need to erase the user data after installing the stock boot.img to get the old filesystem and to get new OTA updates successfully install? Do we also need to reinstall all system chunk files? Please clarified this.

Q2. If my ROM and Boot.img is stock and I just install removeForceEnc.zip to remove force encryption, does it effect on OTA updates?

Q3 Do I need to re-enable the force encryption in moto z play to get the new OTA updates in future?

Q4. Does practically is there any significant speed benefits by removing force encryption from moto z play?

Please answer all questions step-by-step.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] xxBrun0xx:
1. No

2. Yes, for 2 reasons: for you to install a zip, you have to have twrp (you need stock recovery to take OTAs). And because you need to be encrypted to take OTAs (unless someone has had success unencrypted?)

3. Yes

4. No
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] felipevsw:
I've been asking similar questions myself lately after I removed forced encryption on my ZP and been playing around with trying to install OTAs for a couple of days now. For now, my understanding is that it's impossible to install OTAs if you've removed encryption because for you to remove it some files in the system partition need to be changed (fstab, etc), however the update script within the OTA update file has some checks that check the integrity of the system partition, and if it had changed one single bit you'll receive a "Status 7" error when you try to install the OTA from the stock recovery (assuming you flashed stock recovery back after you removed encryption from TWRP, otherwise it'll fail because TWRP can't install OTAs). More details about the "Status 7" error here http://www.droidviews.com/fix-status-7-error-while-installing-ota-update-or-roms/

So unless we find a way to change the update script within the OTA update file (without breaking it) to remove these integrity checks I don't see a way we can install OTAs having removed encryption...

Performance wise I did notice I slight improvement after I removed encryption, both on stock and LOS. Battery wise I couldn't check much because I was constantly flashing and changing things trying to get it to work so I didn't get a whole charge from 100% to low to see if I have better battery life or not, but if your main goal is to have official OTAs, then do not remove force encryption otherwise you won't get them, or if you're fine with the awesome LOS then do remove it and be happy!
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] sidg2:
After flashing f2fs kernel patch, we have to erase user data partition for f2fs filesystem. It installs new modified kernel in boot.img. Then if we want stock boot.img for ota updates, we have to reflash the stock boot.img and recovery. OK, I understand.

Q1. But, Do we also need to erase the user data after installing the stock boot.img to get the old filesystem and to get new OTA updates successfully install? And after erase user data then Do we also need to reinstall all system chunk files? Please clarified both.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] tag68:
Reason 1 is wrong. Of course you just install some zip after running "fastboot boot twrp.img", never flash twrp. Then you don't need to care about restoring recovery.

---------- Post added at 15:30 ---------- Previous post was at 15:27 ----------

No. f2fs is default on data. f2fs filesystem is working in general without any kernel change. The f2fs fix kernel only repairs the possibility to do loopback device on f2fs, which is mostly used for rooting solutions like Magisk and SuperSU. You don't need to erase userdata, except when you want to switch from encrypted to not encrypted. Switching to encrypted is just setting the parameter that encrypting is enforced and boot ... your data should get converted without loss.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] daniel_m:
Thanks for a fixed kernel for Marshmallow :)

[MENTION=4539224]tomparr[/MENTION] could you add init.d support? I tried Universial init.d, but I am afraid scripts get executed late during the boot process and render some useless.
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] iron maiden:
hello kernel fixed for root in 7.1.1 ? thanks

regards
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] sidg2:
After updating the Moto z play to 7.1.1, will f2fs bug fix? Do we need to install the F2FS fix kernel after updating the Moto Z Play to Nougat 7.1.1 June patch? [MENTION=6192363]tag68[/MENTION] [MENTION=4539224]tomparr[/MENTION] [MENTION=4084215]jatinkhatri[/MENTION] [MENTION=6352375]Yash24[/MENTION][MENTION=4413986]xxBrun0xx[/MENTION]
[Moto Z Play ROMs, Kernels, Recoveries, & Other Dev] jatinkhatri:
Nope you don't need it , but if you need kcal then you must have to I stall that kernel