How to OTA a Moto G6 plus when rooted with Magisk?

bornheim2

Member
Oct 3, 2015
32
12
0
My phone (XT1926-3) offered the July 2018 OTA today. I followed the advice at https://github.com/topjohnwu/Magisk/blob/master/docs/tips.md and did the following:
- Magisk Manager > Uninstall > Restore Images
- Settings > System > System Update

The phone started to download the OTA (about 300 MB), but afterwards said something like "sorry, that didn't work out".
I then did:
- Magisk Manager > Install > Install
and then phone is fine for now.

I can probably catch the download URL for the OTA by using the logcat method. But what would I do with an OTA zip? The OTA is significantly smaller than a complete firmware (about 2 GB).
 

JoeGatto

Senior Member
Aug 7, 2016
224
83
0
My phone (XT1926-3) offered the July 2018 OTA today. I followed the advice at https://github.com/topjohnwu/Magisk/blob/master/docs/tips.md and did the following:
- Magisk Manager > Uninstall > Restore Images
- Settings > System > System Update

The phone started to download the OTA (about 300 MB), but afterwards said something like "sorry, that didn't work out".
I then did:
- Magisk Manager > Install > Install
and then phone is fine for now.

I can probably catch the download URL for the OTA by using the logcat method. But what would I do with an OTA zip? The OTA is significantly smaller than a complete firmware (about 2 GB).
I'm not sure if that's possible, but I wouldn't try it. The best way is to reflash stock and then accept the OTA. Afterwards, you can reinstall Magisk.
 

Xplorer4x4

Senior Member
Mar 12, 2010
1,025
314
113
See if the firmware update has been posted here. In either case do a backup with Titanium Backup first. If the complete firmware update has been posted, flash it with fastboot in the bootloader. If it had not been posted, flash the latest version available and then Ota. After your up to date reflash magisk in twrp.

Sent from my moto g(6) plus using Tapatalk
 

manos78

Senior Member
Jan 17, 2014
808
304
0
Hi,

At time, is no solution to update with OTA with a rooted MotoG6+ with Magisk.

I'm working on a workaround.
Regards.
 

ivailogeimara

Member
Aug 12, 2012
17
2
0
You can also use Lenovo Moto Smart Assistant and "Rescue" your device. It basically downloads the firmware and flashes it for you (wiping everything on the device (excluding External SD). That's what I did.
 
Last edited:

joris1977

Member
Jan 23, 2014
20
3
23
New OTA update arrived today. Is there already a solution for this? I thought that the new systemless Magisk would "fix" this, but OTA update still fails. No clue why. I even ended up in a bootloop, but switching active partition back to b fixed that...

I don't get why we should be excluded from updates, just because we want to be root on the devices we own. It just doesn't make sense.
 

ivailogeimara

Member
Aug 12, 2012
17
2
0
This time I tried removing Magisk and restoring boot and system partition (from backup before installing Magisk) before starting the OTA because someone said that when you start the OTA it switches A_B partitions and restoring from backup doen't restore them in the right place and thats why it might fail (or something like that) BUT same result. OTA fails! I guest every month I'll have to flash stock (losing everything on the phone in the process) -> install OTA -> reinstall everything.

WHY exactly the OTA fails? It shouldn't detect that the partitions are modified because they're not (restored from backup before Magisk).
 
Last edited:

joris1977

Member
Jan 23, 2014
20
3
23
You can also use Lenovo Moto Smart Assistant and "Rescue" your device. It basically downloads the firmware and flashes it for you (wiping everything on the device (excluding External SD). That's what I did.
I have XT1926-3 and Lenovo Moto Smart Assistant says that my device is not supported. Do you have the same device?
 

ivailogeimara

Member
Aug 12, 2012
17
2
0
I have XT1926-3 and Lenovo Moto Smart Assistant says that my device is not supported. Do you have the same device?
I used LMSA when I was running OPW113.89 to update to OPW113.89-2 (via the Recovery option). It asked me to select the product and model of the phone. I selected "Moto G Plus (6th Gen)" for the product and for the "Model Name" I had XT1926-2,XT1926-3,XT1926-5,XT1926-6,XT1926-7,XT1926-8,XT1926-9. The new version of the LMSA has 3 buttons at the top of the rescue screen: "Lenovo Phone", "Lenovo Tablet", "MOTO Phone". Make sure that you select "MOTO Phone"

I'll try it again because I just tried to recover system partition backup (made with TWRP) with TWRP and bricked my phone. And for some reason I can't flash the images from the firmware with fastboot. For some of the images that have A and B partitions it tries to flash them to non existent partitions. For example:
Code:
fastboot flash boot boot.img
or
Code:
fastboot flash system system.img_sparsechunk.0
tries to flash them to boot__b or boot__a or system__b or system__a (with double '_')

The annoying thing is that I don't have Windows outside VM so every time I need to run LMSA I have to create WINTOGO usb just to run LMSA.
 
Last edited:

Coldstream

Senior Member
May 23, 2010
120
45
0
Enschede
I used LMSA when I was running OPW113.89 to update to OPW113.89-2 (via the Recovery option). It asked me to select the product and model of the phone. I selected "Moto G Plus (6th Gen)" for the product and for the "Model Name" I had XT1926-2,XT1926-3,XT1926-5,XT1926-6,XT1926-7,XT1926-8,XT1926-9. The new version of the LMSA has 3 buttons at the top of the rescue screen: "Lenovo Phone", "Lenovo Tablet", "MOTO Phone". Make sure that you select "MOTO Phone"

I'll try it again because I just tried to recover system partition backup (made with TWRP) with TWRP and bricked my phone. And for some reason I can't flash the images from the firmware with fastboot. For some of the images that have A and B partitions it tries to flash them to non existent partitions. For example: or tries to flash them to boot__b or boot__a or system__b or system__a (with double '_')

The anoying thing is that I don't have Windows outside VM so every time I need to run LMSA I have to create WINTOGO usb just to run LMSA.
Why did you try to update with lenovo assist? Was your rom clean as in no Magisk?
What TWRP did you use, and was your device encrypted?

Need much more info to be able to help, also what is your main OS because you don't need windows for fastboot.

Have you tried booting original boot.img through fastboot?
Maybe changed active slot?
 
  • Like
Reactions: weazie

ivailogeimara

Member
Aug 12, 2012
17
2
0
Why did you try to update with lenovo assist? Was your rom clean as in no Magisk?
What TWRP did you use, and was your device encrypted?

Need much more info to be able to help, also what is your main OS because you don't need windows for fastboot.

Have you tried booting original boot.img through fastboot?
Maybe changed active slot?
Uninstalled Magisk from Magisk manager. Device is encrypted. The TWRP I use is from this thread.
The previous time I used LMSA was because uninstalling Magisk (which flashed boot partition backup) didn't help with installing the OTA (it still failed). And flashing the images from firmware with fastboot gave error. It tried to flash them to boot__a or boot__b, system__a or system__b (with double underscore). I was gonna try updating with LMSA again but decided to try flashing images from the firmware manually with mfastboot this time and it worked. It'll be good if in the guide for "how to return to stock" it said that the included fastboot is mfastboot.
I just flashed the stock images (without data,cache) with mfastboot and I'm trying to update again via OTA.
Update: OTA installed successfully!

PS: Can I check if some partition is modified in some way like OTA does?
 
Last edited:

joris1977

Member
Jan 23, 2014
20
3
23
WHY exactly the OTA fails? It shouldn't detect that the partitions are modified because they're not (restored from backup before Magisk).
Yeah I am asking myself the same question. I grabbed a log file and it shows a lot of:

Code:
/system/bin/update_engine: [libfs_mgr]Error finding 'slot' in device tree
I am clueless, but it seems that Magisk somehow disabled the ability for the phone to see slot A. An error that stays even after Magisk is fully removed; I even flashed the untouched boot.img back. But that made no difference.

I also tried sideloading the OTA with ADB on the recovery screen, but that fails too & I see the same error on the screen.

BTW You can grab the OTA with help of this website: http://erfanoabdi.000webhostapp.com/

I am always a bit hesitant in posting log files with a lot of stuff that I don't understand, but as an attachment I add here the lines of the log that contain messages about the update_engine.
 

Attachments

Last edited:

ivailogeimara

Member
Aug 12, 2012
17
2
0
Yeah I am asking myself the same question. I grabbed a log file and it shows a lot of:

Code:
/system/bin/update_engine: [libfs_mgr]Error finding 'slot' in device tree
I am clueless, but it seems that Magisk somehow disabled the ability for the phone to see slot A. An error that stays even after Magisk is fully removed; I even flashed the untouched boot.img back. But that made no difference.

I also tried sideloading the OTA with ADB on the recovery screen, but that fails too & I see the same error on the screen.

BTW You can grab the OTA with help of this website: http://erfanoabdi.000webhostapp.com/

I am always a bit hesitant in posting log files with a lot of stuff that I don't understand, but as an attachment I add here the lines of the log that contain messages about the update_engine.
I think this:
Code:
12-20 13:31:48.480  1134  1134 E update_engine: [1220/133148:ERROR:delta_performer.cc(1099)] The hash of the source data on disk for this operation doesn't match the expected value. This could mean that the delta update payload was targeted for another version, or that the source partition was modified after it was installed, for example, by mounting a filesystem.
12-20 13:31:48.480  1134  1134 E update_engine: [1220/133148:ERROR:delta_performer.cc(1104)] Expected:   sha256|hex = 66305C30BC5570791036FFC5B57E620D516B35664C3EE5B27F97FBFD5E288817
12-20 13:31:48.481  1134  1134 E update_engine: [1220/133148:ERROR:delta_performer.cc(1107)] Calculated: sha256|hex = E2D46DB42162711333E99BF1CBD0224F5867F6E7387FA276D30EC54755AF454B
is where the update fails. I'm not sure though what partitions is the OTA checking.
I flashed every partition listed in servicefile.xml (in the stock firmware files that you can flash) and after that I was able to install the OTA. Next I made backups/images (not restorable though) with dd of all the partitions that are listed in servicefile.xml because clearly one or multiple of those get changed after installing Magisk and that's why the OTA fails. After that I installed magisk and made backups with dd again and compared the two to see what changes after installing Magisk. These are the partitions that were changed after Magisk and are in servicefile.xml:
Code:
bluetooth_b
boot_b
dsp_b
modem_b
oem_b
I guess uninstalling Magisk only restores the boot partition and one of the others fails the check. Probably oem_b.

PS: Well I guess for now the solution will be to flash everything listed in servicefile.xml (except system and system_b) via mfastboot before each OTA.
 
Last edited:
  • Like
Reactions: weazie

joris1977

Member
Jan 23, 2014
20
3
23
Thanks for your informative post @ivailogeimara
Lenovo fixed their Lenovo MOTO smart assistance, so now you can reflash your device. with the help of this app. I just reflashed my device and everything is working as expected.

If you use LMSA it downloads a zip file with the full OS where the new OTA is already included. Probably you can cut off the rescue operation after the full zip has arrived and you can just use that zip to flash the boot partition and that oem_b. partition I didn't try that, because I had limited time, had already backed up all my data and I needed a working phone. This is probably what I will try next time an OTA arrives.

Maybe we should make the magister developers aware about the troubles with the Moto G6 plus. It is probably I bug somewhere that uninstalling Magister does not fully restore the old install.
 
  • Like
Reactions: Gleanfast

FloOGB

Senior Member
Feb 22, 2010
79
13
0
Altenberge
These are the partitions that were changed after Magisk and are in servicefile.xml:
Code:
bluetooth_b
boot_b
dsp_b
modem_b
oem_b
I guess uninstalling Magisk only restores the boot partition and one of the others fails the check.
This is exactly what I get on my phone. For the last two OTAs these are the partitions that fail the checksum verification. As you mentioned this is fixed by flashing the partitions from a known good source.

I used TWRP via "mfastboot boot twrp.img" to dump boot.img, modify it via Magisk-Manger and then flash it using mfastboot. I don't see any way how I would modify the other partitions (except boot, of course) this way.

I looked into the oem-partition and it has its "last mounted" timestamp changed to something very, very recent. This is why I rule out TWRP. My best guess is that Magisk mounts those partitions shortly as rw maybe on boot? That would already be enough to make the hash fail :(
 

axsdenied1

Senior Member
Jun 10, 2013
140
60
48
So basically to be able to install the OTA:
1. after clean stock reinstall (before magisk installation) backup the above mentioned partitions
2. install magisk, etc.
3. later when an OTA update comes restore the backed up partitions + remove magisk and then install the OTA
4. back to step 1

I suppose the partitions can also be restored if you find the firmware that is identical to what the phone is currently running.

Or???
 

FloOGB

Senior Member
Feb 22, 2010
79
13
0
Altenberge
I suppose the partitions can also be restored if you find the firmware that is identical to what the phone is currently running.

Or???
Yes, that's what I did. Never thought to pull a backup of a partition that would only "ever" be changed by the OTA process :rolleyes: I googled a bit for my version number until I found a matching stock ROM.
 

Bizong

New member
Jan 18, 2012
3
0
0
Moto g6 + rooted with twrp and magisk. I have an OTA update.

The OTA gets errored out right after I download the update and it tries to install it.


Phone version: XT1926-7
Using latest twrp 3.2.3
Magisk v18.0 installed.
Successfully enabled root just the other day.

Now I get the OTA update ppw29.116-11 wanting there pie update to rollout, was so happy. Except it keeps saying unsuccessful right after it's done downloading and tries to install I guess.

Has anyone found a safe workout for this?
 

joris1977

Member
Jan 23, 2014
20
3
23
It is outlined in the post just before the one you made...

So
before installing Magisk you should have made a backup from the following partitions:
bluetooth_b
boot_b
dsp_b
modem_b
oem_b



when an OTA update comes, remove magisk and restore the backed up partitions.
then install the OTA
make a backup again.
This should work, but I didn't test it yet.
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone