apply OTA to rooted phone?

nigelhealy

Senior Member
Aug 3, 2012
1,540
444
0
Preston
i have an unlocked rooted but otherwise stock G4P and it has an OTA but fails to install. Is there a full ROM I can apply which won't wipe? Or some other way which is not involving a full wipe?
 

hp420

Senior Member
Jul 31, 2011
2,528
1,418
0
Gainesville, Fl
i have an unlocked rooted but otherwise stock G4P and it has an OTA but fails to install. Is there a full ROM I can apply which won't wipe? Or some other way which is not involving a full wipe?
I tried, failed, and eventually gave up. I haven't had the motivation to do a full wipe/flash, but I tried everything else I could think of before giving up.
 

hp420

Senior Member
Jul 31, 2011
2,528
1,418
0
Gainesville, Fl
Did you tryied reinstall the full stock rom & recovery (through Fastboot) without wipe?
I had a twrp backup of my system partition, which I restored, then fastboot flashed the stock kernel, and wiped caches. Safetynet passed, but the ota would not flash. It said there was an unexpected change in the system, or something to that affect.

I'm not aware of any true, untouched flashable rom zip available. I suppose it wouldn't take long to make one, I just didn't have one available to me.
 

rafaelrgi

Senior Member
Oct 5, 2014
78
26
0
rgisistemas.blogspot.com
I had a twrp backup of my system partition, which I restored, then fastboot flashed the stock kernel, and wiped caches. Safetynet passed, but the ota would not flash. It said there was an unexpected change in the system, or something to that affect.

I'm not aware of any true, untouched flashable rom zip available. I suppose it wouldn't take long to make one, I just didn't have one available to me.
To install the OTA update the stock recovery is required, and Twrp is a custom recovery.... after restore the backup you should reinstall the stock recovery before apply the OTA.
 
Last edited:

hp420

Senior Member
Jul 31, 2011
2,528
1,418
0
Gainesville, Fl
To install the OTA update the stock recovery is required, and Twrp is a custom recovery.... after restore the backup you should reinstall the stock recovery before apply the OTA.
sorry, didn't see you were asking about fastboot. no, I didn't flash the factory image. I didn't want to go that far and didn't really care enough to do a full wipe
 

VR25

Senior Member
Apr 20, 2013
1,753
4,369
153
I had a twrp backup of my system partition, which I restored, then fastboot flashed the stock kernel, and wiped caches. Safetynet passed, but the ota would not flash. It said there was an unexpected change in the system, or something to that affect.

I'm not aware of any true, untouched flashable rom zip available. I suppose it wouldn't take long to make one, I just didn't have one available to me.
A TWRP backup restore doesn't fix the issue. You have to reflash SYSTEM , BOOT(if modified), RECOVERY(if modified), and OEM through fastboot. That is a "block flash," instead of TWRP, which is "file based restore."
 

hamelg

Senior Member
Oct 14, 2013
50
11
28
A TWRP backup restore doesn't fix the issue. You have to reflash SYSTEM , BOOT(if modified), RECOVERY(if modified), and OEM through fastboot. That is a "block flash," instead of TWRP, which is "file based restore."
What about other partitions :
gpt, bootloader, adspso, modem
Must they be restored ?

Just after OTA, is it possible to make a raw image backup with TWRP in R/O mode ?
 

VR25

Senior Member
Apr 20, 2013
1,753
4,369
153
What about other partitions :
gpt, bootloader, adspso, modem
Must they be restored ?

Just after OTA, is it possible to make a raw image backup with TWRP in R/O mode ?
You only need to restore SYSTEM, OEM, BOOT AND RECOVERY images. That's all you'll ever need. NEVER touch other partitions, unless you are upgrading.


To make RAW image backups of SYSTEM and OEM partitions, use terminal in TWRP
Or "adb shell" from your computer (running as root)

adb shell
ls -al /dev/block/platform/soc/7824900.sdhci/by-name

This command will give you the names of the SYSTEM and OEM partitions of your device, Moto G4 Plus. For example, for Moto Z Play (my device), they are mmcblk0p53 and mmcblk0p51 respectively.

So, the commands would be (again, that's an example for MOTO Z PLAY):

Backup
dd if=/dev/block/mmcblk0p53 of=/sdcard/system.img
dd if=/dev/block/mmcblk0p51 of=/sdcard/oem.img

Restore
dd if=/sdcard/system.img of=/dev/block/mmcblk0p53
dd if=/sdcard/oem.img of=/dev/block/mmcblk0p51
 
Last edited:

nigelhealy

Senior Member
Aug 3, 2012
1,540
444
0
Preston
Thanks much VR25.
With your help, I have successfully applied the latest OTA :)
Confused. The VR25 guidance is when you had taken a full backup when stock, how to restore back to stock to then apply the OTA. You are describing how to apply the OTA on a rooted device without a pre-rooted backup?
 

hamelg

Senior Member
Oct 14, 2013
50
11
28
You don't need backups to apply the latest OTA.

Get the stock corresponding to your device.
flash LOGO, SYSTEM, OEM, BOOT AND RECOVERY images.
Apply November OTA
Apply February OTA

I did that without wiping my data.

If you want to avoid reset to stock & apply all OTAs, you must have a binary backup of system partition, not a file based backup (see comment #8).
I asked about this issue here :
https://forum.xda-developers.com/showpost.php?p=72029402&postcount=55
 
  • Like
Reactions: luzbel3821

nigelhealy

Senior Member
Aug 3, 2012
1,540
444
0
Preston
You don't need backups to apply the latest OTA.

Get the stock corresponding to your device.
flash LOGO, SYSTEM, OEM, BOOT AND RECOVERY images.
Apply November OTA
Apply February OTA

I did that without wiping my data.

If you want to avoid reset to stock & apply all OTAs, you must have a binary backup of system partition, not a file based backup (see comment #8).
I asked about this issue here :
https://forum.xda-developers.com/showpost.php?p=72029402&postcount=55
Where is the stock for my device
Where is the OTA for my device

My device is the USA unlocked G4P XT1607
 
  • Like
Reactions: TheEvilVirus

TheEvilVirus

Senior Member
Mar 19, 2008
112
12
0
Where is the stock for my device
Where is the OTA for my device

My device is the USA unlocked G4P XT1607
Exactly this question, but then the XT1602. Flashed the stock parts, but no message of an OTA and they are nowhere to be found. Or does anyone have latest stock version full ROM?
 

nigelhealy

Senior Member
Aug 3, 2012
1,540
444
0
Preston
Exactly this question, but then the XT1602. Flashed the stock parts, but no message of an OTA and they are nowhere to be found. Or does anyone have latest stock version full ROM?
Yeah, others were just saying too high a level to not actually helpful. As I did this last week I'll tell you now is as step by step as I can to actually try to be helpful.

Firstly you need to know you will wipe data, there's no avoiding it, that I could find so backup everything, that can be a mix of TWRP backup of data to SDCARD external, USB OTG, or Titanium backup to online / SD / OTG. In my case I prefer to simply install everything and configure everything from scratch.

Follow this guide to return to stock.

In my case I'm on Ubuntu Linux desktop, fastboot got a "no permissions" type message so I had to sudo in front.

The stock for your device, well look at your device Status page now before you start, Settings -> About Phone -> it says Software Channel "retus" so when I go to the list of ROMs in the above guide go to mirrors.lolinet.com - firmware - moto - harpia - official - then I went to Retus, you'd go to a different one probably.

Note these are old stock ROMs I think from September so there have been one or two updates since then.

Follow the step by step guide, basically lots of fastboot commands.

The step where it says fastboot oem lock it bawks and say fastboot oem lock begin and that will do another wipe, so given a later fastboot oem unlock would do a 3rd wipe I didn't do the oem lock, I left mine unlocked and that worked fine.

Let it boot, setup, you will then be in an old stock ROM, then if it doesn't offer to do an update, go into Settings, System Updates, and trigger it to look. It will then download and apply a stock OTA ontop of the stock ROM. In my case it was 1 OTA, 1 update, then that that complete. You then are on stock current ROMs.

Then root and whatever you want.

But note, to get to the impending N OTA, you'll probably have to right back to the top here because your rooted Moto G4 Play will likely refuse the future OTA as the system is modified, so you'd have to repeat, return to an old stock ROM and then let it go through the 1 or 2 or 3 OTAs to get to that future release.

Hence you'd be doing the return to stock twice.

If the mirrors could be updated to newer stocks it would bypass the OTA. My other phone - the OnePlus3T they offer mirrors of full ROMs, they are far easier to use because if you are rooted you download the full ROM not just the delta incremental of the change of the OTA, and then you can flash in recovery the full ROM and it ignores the system state, and no wiping of data. The fact the mirror site is out of date is causing the need to wipe so the OTAs work on an unmodified system.

Fortunately I have multiple phones so I can use another for the few hours this all takes.
 

luzbel3821

Member
Mar 22, 2015
12
1
0
madison
works great, I just flash it and without wiping data

You don't need backups to apply the latest OTA.

Get the stock corresponding to your device.
flash LOGO, SYSTEM, OEM, BOOT AND RECOVERY images.
Apply November OTA
Apply February OTA

I did that without wiping my data.

If you want to avoid reset to stock & apply all OTAs, you must have a binary backup of system partition, not a file based backup (see comment #8).
I asked about this issue here :
https://forum.xda-developers.com/showpost.php?p=72029402&postcount=55

works great and finally my phone can upgrade the OTA updates:laugh::good:
 

hamelg

Senior Member
Oct 14, 2013
50
11
28
To make RAW image backups of SYSTEM and OEM partitions, use terminal in TWRP
Or "adb shell" from your computer (running as root)
...
Restore
dd if=/sdcard/system.img of=/dev/block/mmcblk0p53
dd if=/sdcard/oem.img of=/dev/block/mmcblk0p51
Here is time to apply the may OTA MPIS24.241-15.3-21.
I restored the vanilla system.img MPIS24.241-15.3-16 with dd, but it didn't work. The OTA failed with the error "system partition has unexpected content" because the sha1sum was incorrect.
Here is the solution :
Before restoring with dd, you must check "Mount System partition read only" is enable in the MOUNT menu of TWRP.
With TWRP 3.1, you need no more to use dd. Now, the feature "system image backup" is available :)
 
  • Like
Reactions: pyrolad