[Motorola Photon Q 4G LTE] xaelith:
Hey all. Had a few issues trying to unlock and root my own phone on my Linux box, so I decided to post what I learned in the process in case anyone else visiting the forums runs into the same problem.

First, a little background on me, since I'm fairly new here at the xda forums (let alone to the Photon Q).

My foray into the Android world started with the OG Droid. The moment I held that baby in my hands, I knew I wanted to be a part of the community the Android platform would spawn. With the OG and the Droid3, I didn't do much more than help others find certain settings options, or explain how to perform a specific task. However, I learned some of the basics of theming during the last few days I had my D3 before I (sadly) traded it in when I switched from Verizon to Sprint.

When I switched carriers, I picked up the Samsung Transform Ultra, and I've been a major contributor in that arena, particularly over at the phone-specific area of androidforums. I've learned a lot in the time I've had the device, especially with creating flashable zip files and theming. I now look forward to seeing what all I will learn while contributing to the Photon Q community. :)

Now, before we get into the actual instructions, the obligatory Disclaimer:

I AM IN NO WAY RESPONSIBLE FOR WHAT MAY OR MAY NOT HAPPEN TO YOUR PHONE WHILE FOLLOWING THESE INSTRUCTIONS! FOLLOW THIS GUIDE AND ANY HELP I OR OTHERS GIVEAT YOUR OWN RISK! THIS

WILL

VOID YOUR WARRANTY!

These instructions assume you are starting with a new phone (meaning it hasn't been unlocked or rooted yet), are relatively familiar with root, are using Linux on your machine, and are fairly comfortable navigating your way around both the phone and PC. As of this writing (5-18-2013), I am running Ubuntu Linux 13.04 on my system, and am basing my instructions on such a setup. Also, the Android SDK and the 'tools' and 'platform-tools' portions from the SDK must be installed and up-to-date.

With all that out of the way, let's get into the guide, shall we? :)

To ensure the best chance for success, make sure the following applies:

USB debugging is on and the MTP option in "USB computer connection" is selected. This ensures that 'adb' and 'fastboot' will recognize the phone.

Unless otherwise noted, the instructions below assume the phone is connected to your computer via USB, and said computer has its own internet connection independent of the phone.

Before we begin, make sure to have the SuperSU zip downloaded to the root of the SD card (phone or external card), and the preferred recovery image downloaded and moved to the same location that 'adb' and 'fastboot' are in ("/home/user/androidSDK/platform-tools", for example).

CAUTION: If any other Android devices are plugged into your computer in addition to your phone, the 'adb' and 'fastboot' commands will affect ALL devices connected at the time!

To make the guide a little easier to follow, commands that need to be typed will be marked like this. Text to look for will be formatted this way.

Part i: Required tools and downloads:

Depending on which recovery you want to use, I recommend using the SuperSU made available at that recovery's thread. In the event that a SuperSU zip isn't made available, download one from one of the other recovery's threads, then download the recovery img you prefer.

TWRP v2.5.0.0 - thread/SuperSU - here recovery img - here

CWM v6.0.1.0 - thread/SuperSU/recovery img - here

OpenRecovery v2.05 - thread/recovery img - here

PART A: Unlocking the Bootloader

1. Follow instructions #1-6 on the how-to found here.

Open a Terminal window and type lsusb, then look for a line with Motorola PCS; copy down the ID number to the left of Motorola PCS because we will need it shortly (it should look something like 12ab:cd34, though your numbers will be different).

Using Terminal, type sudo gedit /etc/udev/rules.d/51-android.rules. "gedit" can be replaced with your preferred text editor if you don't want to use it or don't have it installed.

Enter your sudo password, and add this line to the file: SUBSYSTEM=="usb", ATTRS{idVendor}=="12ab", ATTRS{idProduct}=="cd34", MODE="0666" GROUP="androiddev", SYMLINK+="android%n", changing "12ab" to match the left part of the ID number you copied down earlier, and "cd34" to the part to the right of the colon.

Save the changes made to the file, then close the text editor. Type sudo service udev restart to ensure both computer and phone recognize the changes that have recently been made (you may not need to re-enter your sudo password if you made the changes to "51-android.rules" quickly enough).

Now go back to the DroidLife (DL) How-To, and pick up at step #8. The only difference is that your Terminal window will look more like this:

(bootloader) 0123456789ABCDEF#0123456789ABCD

(bootloader) EF0123456789ABCDEF01234567#0123

(bootloader) 456789ABCDEF0123456789ABCDEF012

(bootloader) 34567#0123456789ABCDEF012345678

(bootloader) 9ABCDEF

Helpful Hint: the first fourteen numbers on the first line are also your IMEI/MEID (0123456789ABCD in the example above), so if you need that, now's a good time to copy it down as well. ;)

When entering the number in on Motorola's website, it's VERY IMPORTANT no white spaces are included in the number. Using the above example, the number should look like

0123456789ABCDEF#0123456789ABCDEF0123456789ABCDEF01234567#0123456789ABCDEF0123456789ABCDEF01234567#0123456789ABCDEF0123456789ABCDEF[/COLOR][/FONT]

[*]After following the rest of the DL guide, your phone will reboot normally.

PART B: Installing recovery and obtaining root:

Before beginning this part, make sure your phone's battery has at least 20% (or there-abouts) charge remaining, or 'fastboot' will refuse to flash the recovery.

Open Terminal (if it's not already), navigate to where 'adb' is installed, then type fastboot reboot-bootloader or adb reboot bootloader to get the phone to reboot into the bootloader.

Once the phone is in the bootloader, type fastboot flash recovery <your-recovery-filename-here>.img, replacing <your-recovery-filename-here> with the name of the recovery you would like to use. For example, if you wanted to use TWRP, the above command would look like: fastboot flash recovery openrecovery-twrp-2.5.0.0-asanti_c.img. If the recovery installation was successful, you will get the following lines:

(bootloader) Variable not supported!

target reported max download size of 31457280 bytes

sending 'recovery' (7084 KB)...

OKAY [ 0.563s]

writing 'recovery'...

OKAY [ 1.823s]

finished. total time: 2.386s

Note that the first line says "Variable not supported!". As long as "sending 'recovery'..." and "writing 'recovery'..." say "OKAY" beneath them, then this so-called error can be ignored in most cases.

While holding the Volume-up and Volume-down buttons, press the power button on the phone to reboot it and exit out of the bootloader.

When the options menu comes up, press the Volume-down button until "Recovery" is selected, then press the Volume-up button.

Once in recovery, make a backup of your phone, should you ever need to return to stock for any reason (such as an insurance exchange ;) - since the first half of the guide voids the warranty :p). Once that finishes, then flash the SuperSU.zip and reboot the phone.

If everything went well, there will be a super-user app in your app drawer, and root checkers will tell you that your device is rooted. Congratulations! :D

(Optional) After granting root access to a few apps that require it (such as Terminal Emulator when su is typed in, Titanium Backup or other app backup utilities, Root explorers, etc.), reboot the phone into recovery, and make a second backup of your now stock-rooted phone...mostly just for posterity, but also to keep from having to do it again in the future, should you ever choose to return to stock but want to keep root. :p

PART C: Wall of Glory

This guide would not be possible if not for the following people and their contributions:

Solust for his guide on the same process on a Windows machine.

arrrghhh for porting TWRP over for our phones, and his thread.

Skrilax_CZ for porting Open Recovery for our phones and his thread.

Shabbypenguin for porting CWM, his thread, and the SuperSU zips.

ChainsDD for the SuperSU app.

Motorola for the Photon Q!

Google for the Android mobile Operating System.

Droid Life for the guide on unlocking the Photon Q's bootloader.

If I've forgotten anyone or made any other mistakes, please PM me and I'll be sure to make the change.

Thanks for playing along! Hope others find this handy; I ended up having to figure most of this out the hard way. :rolleyes: Either way, it's been a fun ride figuring out a new phone. :)