Contrary to my normal inclinations not to buy anything but Stock Android phones I ended up with a Sony Xperia Z2 in a hurry over the weekend (it’s a long story…). It appears to be quite a decent handset (with a pretty good camera actually) and one of the main reason to choose this over the other options was that is was one of the few high-end devices which already had a CM snapshot rather than just nightly releases. However similar to their colleagues at Samsung the Sony people also opted to stuff all sorts of crap-ware bloat onto the Android base OS. It appears not to be as bad as the Samsung (who are the kings of crap) mods, but for somebody used to the clean Android experience it’s just very annoying. So I opted to flash it straight to CyanogenMod.

Sony Xperia Z2 2 by epct414, on Flickr
Creative Commons Creative Commons Attribution-No Derivative Works 2.0 Generic License   by  epct414 

Prerequisites

You need the Android SDK installed and on your Path – see one of my other posts on how to do this.

Get Bootloader Unlock Code

Another annoying step which is not required with Google Nexus series.

http://unlockbootloader.sonyericsson.com/instructions

You will need to enter and confirm your email (WTF?) and need your IMEI number and at the end of the process you will get an update key that is required below.

Put phone into bootloader (fastboot) mode

Insert one end of the USB cable into your PC. Turn off the device and wait at least 5 seconds. Press and hold the Volume Down button and plug the other end of the Micro-USB cable in to your device.

fastboot devices
#should display the ID of the connected phone
fastboot -i 0x0fce oem unlock 0xKEY

Download CyanogenMod Release

Extract the boot.img file from the downloaded ZIP file via https://download.cyanogenmod.org/?device=sirius

fastboot -i 0xfce flash boot boot.img
fastboot -i 0xfce reboot

This should boot into Clockwork Mod Recovery and you can use the Volume +/- to navigate and On/Off button to choose.

Select the “Wipe data/factory reset” option

Note: this part was not in the CM Wiki or anywhere else and took me a while to get past. If you see an error “Error Mounting /sdcard/.android_Secure!” during the factory reset procedure you need to format the data partition manually. If you do not do this step the CM install will still work but you will not be able to boot the phone (it gets stuck at the Boot Animation).

Mount /data
Format /data

After the manual format procedure do the “Factory reset” again.

Install CyanogenMod

Choose the “Install zip from sdcard –> Install from sideload” option

adb sideload cm-11-20140804-SNAPSHOT-M9-sirius.zip

After the install has finished choose the “Reboot system now” option.

CM Wiki Entry: http://wiki.cyanogenmod.org/w/Install_CM_for_sirius

Leo Gaggl

ict business owner specialising in mobile learning systems. interests: sustainability, internet of things, ict for development, open innovation, agriculture

This Post Has 3 Comments

  1. Nic

    Same thing happend to me. This post came after I tried random things for 3 hours last night. I wanted to kiss you when this worked. However,”mount/data” and “format /data” didn’t work for me. I had to select “format /data and /data/media (/sdcard)” first. Thanks for your help.

  2. Dmill

    Ditto for me. Had to choose the same option as Nic, but this blog post saved my arse!! Thank you! This was for a Samsung Galaxy S3 on Tmobile USA.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.