Posted by: reformedmusings | December 12, 2015

Upgrading a rooted Moto X Pure 2015 to Android 6.0 Marshmallow on Linux

I love my Moto X Pure 2015 in daily use. It’s seriously one of the best phones I’ve ever owned. I wrote previously how I unlocked the bootloader, installed TWRP recovery on it and rooted it. The Pure has been a joy to use, and rock-solid stable.

One of the reasons for going with Motorola in this round was their use of almost pure Android and their excellent reputation for keeping phones updated with the latest Android version. Sure enough, last week I had a new icon in my status bar which told me that an over-the-air (OTA) update to Android 6.0 Marshmallow was available. I followed the link to the changes, which proved very informative.

So, I successfully downloaded the OTA update, then smartly copied it from /data/data/com.motorola.ccc.ota on the phone to my 128GB external card for preservation. That was a smart move, as the update failed to install on a rooted phone with a different recovery installed. Time for Plan B, thanks to the good folks at xda-developers.com.

Important safety tip: I spent several days researching the best way to update my rooted Pure from Android 5.1.1 to 6.0, plowing through hundreds of related posts on xda-developers.com. It would be fool-hearty to attempt this task without researching the wisdom of the community and tapping into their vast knowledge. Words to the wise before jumping in with both feet.

I needed a few files to make the OTA update work from a non-rooted Pure 2015, which it requires. Providentially, Shaun5162 provided a set of files to return the Pure to stock. Rooting requires the newer version 2.8.7.1 of TWRP as well as version 2.52 of SuperSU. Lastly, you’ll need a modified boot image provided by DaMadOne that will allow root by bypassing some of the changes in the Android 6.0 kernel.

Once you have all the tools assembled, copy the OTA update file from your external MicroSD card to the root of your internal SD card. You’ll also need fastboot for Linux installed on your PC.

First, extract the files listed in the commands below from the return-to-stock archive, CLARK_RETUS_5.1.1_LPH23.116-18_cid9_subsidy-DEFAULT_CFC.xml_SHAWN5162.zip. Don’t flash the entire return-to-stock archive as that will wipe your device. Since the Moto update file only checks the system partition, and requires a stock recovery partition to run, they are the only areas that need to be brought to stock.

Done correctly, all your apps, data and settings will be preserved, but backup everything with a nandroid backup just in case things to south.

The files that you need from CLARK_RETUS_5.1.1_LPH23.116-18_cid9_subsidy-DEFAULT_CFC.xml_SHAWN5162.zip are:

recovery.img
system.img_sparsechunk.0
system.img_sparsechunk.1
system.img_sparsechunk.2
system.img_sparsechunk.3
system.img_sparsechunk.4
system.img_sparsechunk.5
system.img_sparsechunk.6
system.img_sparsechunk.7
system.img_sparsechunk.8
system.img_sparsechunk.9

You could create a bash file to flash these in batch, but it’s quicker to type them into the terminal because only the last character of 10 of the files is all that changes from line to line.

Ensure that these files and the TWRP image file are ready on your PC, and that the Motorola OTA update file, the modified boot image, and SuperSU 2.52 are all on your internal MicroSD card. If so, you are ready to begin.

My directions assume that you have an unlocked bootloader, TWRP installed, phone rooted, and that your phone is above 80% charged. 100% is always best.

  1. Ensure that the checkboxes next to OEM unlocking and USB debugging are checked in Settings -> Developer options
  2. Hold down the power and down volume buttons together to reboot to the bootloader. Hold the buttons down until the Android character appears on the screen.
  3. On this screen, use the volume buttons to change the selected function on the right side of the screen until Recovery appears next to the power button, then hit the power button. Your phone will reboot into recovery mode (TWRP).
  4. Use TWRP to make a nandroid backup of your phone in its current state. If something goes south, you can restore the nandroid and start over.
  5. Reboot back to the bootloader from TWRP or re-execute step 2 above.
  6. Your phone is now in fastboot mode. Open a terminal on your PC and navigate to where your above file collection resides.
  7. Connect your phone with a data USB cable to your PC. The charging USB cable that came with the Pure will work fine, but not all 3rd party charging cables will work. Your phone should indicate that it is connected at the bottom of the text screen.
  8. Type “sudo fastfoot devices” without the quotes in your terminal. It should return with your device name. That means that you’re good to go.
  9. Type the following commands into the terminal in order. You don’t have to type the last 10 in every time. After typing the second command, arrow up at the terminal prompt to display the last command and change the last character to the match the next file in the list:
    sudo fastboot flash recovery recovery.img
    sudo fastboot flash system system.img_sparsechunk.0
    sudo fastboot flash system system.img_sparsechunk.1
    sudo fastboot flash system system.img_sparsechunk.2
    sudo fastboot flash system system.img_sparsechunk.3
    sudo fastboot flash system system.img_sparsechunk.4
    sudo fastboot flash system system.img_sparsechunk.5
    sudo fastboot flash system system.img_sparsechunk.6
    sudo fastboot flash system system.img_sparsechunk.7
    sudo fastboot flash system system.img_sparsechunk.8
    sudo fastboot flash system system.img_sparsechunk.9
    sudo fastboot reboot
    The phone will respond after each command with the time each flash took and after the last command will reboot to the normal system, but you will no longer be rooted and TWRP will be gone. That’s OK, it is exactly what we want.
  10. Hold down the power and volume down buttons together again until the Android character appears.
  11. Just as in Step 2 above, use the volume buttons to select Recovery and press power to launch recovery
  12. Now press and hold the power, then press the volume up button for a second or so and release both. This will put you into a text screen with a scrollable highlight section at the top. Use the volume buttons to scroll the highlight to Install from SD card and press the power button.
  13. Navigate to the Blur_Version.23.21.18.clark_retus.retus.en.US.zip file and select it with the power button. The OTA update will now check your system and then install. This takes a while, so be patient. When the installation is complete, use the volume keys to navigate to “reboot system now” and press the power button. Marshmallow should appear in its full glory after it installs all the apps. If you don’t want to install TWRP or reroot, then you are done. Note that you will have lost your custom boot image to the nasty unlocked bootloader warning. We’ll deal with that in another post.
  14. To install TWRP, press and hold the volume down keys together until the Android character appears. If your USB cable isn’t plugged in, plug it in now. The bottom row of text on the phone should then indicate that you are connected.
  15. In your terminal on the PC, type:
    fastboot flash recovery twrp.img
    When that completes, use the volume keys to navigate to Recovery on the right side and hit the power key.
  16. The Pure will reboot into TWRP. Make an immediate backup of the current Marshmallow system. In case anything goes wrong after this, you will have a good Marshmallow image to restore.
  17. After backing up in TWRP, navigate back to Install, then select boot_root_mm_clark_retus.zip and flash it, then navigate back to Install, select BETA-SuperSU-v2.52.zip and flash it.
  18. Reboot to the system. If everything worked, and it should have, you now have fully rooted Android 6.0 on your Moto X Pure 2015. Enjoy!

This entire sequence was knit together from a number of posts on xda-developers.com, then additional details added as I thought necessary. This is the exact sequence that I used to obtain a rooted Marshmallow setup on my Pure, and all my apps, data, and settings were perfectly preserved. While it looks like a lot of steps, the process is actually quite straight-forward.

Kudos to Motorola for the Android 6.0 update, and many thanks to the xda-developers community for their collective wisdom, expertise, and experimentation.


Responses

  1. I’ve tried following your directions however I am unable to locate the OTA download on the phone. That data file does not contain the file. Do you have an upload of the OTA update taking off your SD card by chance?

    • No, I didn’t upload it anywhere, but it might be on xda-developers Moto Pure 2015 forum.

  2. […] get root with Marshmallow, which involved flashing a modified version of boot.img (discussed here: https://reformedmusings.wordpress.co…llow-on-linux/ and here […]

  3. Thanks for the great write up! I’ve had the page bookmarked and the files downloaded for about a month and finally had time to do it last night. Now that I have backups of Lollipop and Marshmallow, I think I am going to give CM13 a try on the Moto X!

  4. Does your rooted Moto X Pure 2015 have “always listening” even when the screen is off? I’m running AICP Marshmallow but I really want “always listening”. How do I get there from here? I did make a nandroid when I first installed TWRP and rooted. Can I just flash that first nandroid to get back to stock?

    • I’m not sure what you mean by “always listening.” If you mean Moto Display, yes that works fine on my Pure. You can download Moto Display from Google Play Store at https://play.google.com/store/apps/details?id=com.motorola.motodisplay. As long as you have the hardware, it should work.

      If you have an original nandroid from when you installed TWRP, you can indeed flash your phone back to stock with the nandroid. But it doesn’t look like you need to do that to get Moto Display.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: