FORUMS
Remove All Ads from XDA

[HOWTO]Unlock, Root, and install CWR Galaxy Nexus with Ubuntu Linux or Linux Mint 12

508 posts
Thanks Meter: 179
 
By loveubuntu, Senior Member on 20th February 2012, 02:45 AM
Post Reply Email Thread
warnning: any damage you do to your phone following these directions is your responsibility. Assume you warranty is void if your are rooted.

I used the information koush provided here and info birdman provided here and adopted it in Ubutnu Linux 11.10. I hit some bumps along the way using my Linux box so I decided to write this for those of us not using OS's made by the darkside This should also work with Ubuntu 12.04 LTS just fine.

All this should work with Linux Mint 12 also.

1- Set up Android SDK, adb, and fastboot in Ubuntu Linux using the links in my signature. I can't stress how useful and easy it is to set adb and fastboot in your "path" so you can easily use it from any prompt. The links explain it. Take your time with that and it will payoff for all your devices. Here is the guide I wrote http://forum.xda-developers.com/showpost.php?p=19446284&postcount=62

STOP NOW! EVERYTHING INCLUDING YOUR PERSONAL FILES, PICTURES, AND VIDEOS WILL BE ERASED WHEN YOU UNLOCK/ROOT THIS DEVICE. It does not have a physical SD card. Very annoying. Use Dropbox or Google+ to backup everything.

2- on your phone, go to settings/Developer Options and check the box for USB Debugging

3-connect your phone, fire up a terminal, and type:

Code:
adb devices
You should get the serial number of your device appear. If not, unplug, reboot phone, re-attach the phone to your computer and try again. If you still do not get your device's serial number, go back to step 1 and make sure everything is setup correctly.

4- Now download Clockwork Recovery from here
http://download.clockworkmod.com/rec...5.0.4-toro.img

(make sure it's the CDMA one (toro). The GSM one is called maguro and steps should be the same)

and su.zip from here

http://download.clockworkmod.com/test/su.zip


5-Turn the phone off, hold both Volume up and Volume Down and press the power button. You should come to a screen that has a big arrow and some writings at the bottom (fastboot). Last line should say Locked state.

6- Connect your phone to your computer, fire up a terminal and type:

Code:
fastboot devices
your phone and its serial number should appear just as it did using adb above. adb will not work here of course. If you don't see your device, go to step one. I guess you can download the fastboot for linux and cd to that directory and do it but I like to have it setup on my computer.

STOP NOW! EVERYTHING INCLUDING YOUR PERSONAL FILES, PICTURES, AND VIDEOS WILL BE ERASED WHEN YOU UNLOCK/ROOT THIS DEVICE. It does not have a physical SD card. Very annoying. Use Dropbox or Google+ to backup everything.


7- Now for the stuff that voids your warranty: Type

Code:
fastboot oem unlock
and enter. Look at your phone now, use the Volume up to choose YES and press the power button to accept. It should say that you are unlocked and fastboot is in good state.

9-use the volume up to change the value appearing in the arrow to recovery and press the power button to accept. You are taken to laying down android with a red triangle. This is the stock recovery. Now carefully press the volume up, volume down, and the power button to get to a menu. Choose wipe data and factory reset. 2 things: I had a hard time getting to the menu. Do it a few times and try pressing the power button JUST a fraction of a second earlier than the 2 volume buttons. Also wiping and resetting takes a few minutes, be patient.

10-you are now unlocked. Turn the phone off ( I pulled battery), go to fastboot screen by holding volume up, down and power button. Connect your phone to your computer and make sure it is recognized by typing:

Code:
fastboot devices
If it is, change directory to where you downloaded clockwork recovery. If you didn't change it, it should be the Download directory (remember it's case sensitive):

Code:
cd Downloads
11- Time to re-write your recovery:

Code:
fastboot flash recovery recovery-clockwork-5.5.0.4-toro.img
Please make sure you use common sense here when it comes to file names. If the file you downloaded has a different name or version, change it in the code above. I guess you can put the fastboot file in that location also to be used if you do not have it setup as in step 1. I'm not positive how and if that would work. Downloading and installing the wrong file is a mistake that may cause harm to your phone.



12- Use the vol up/down to point the big arrow toward recovery, push the power button to get to Cloclwork Recovery. Once you confirm you have CWR, reboot the phone normally and let Android OS create all the folders it needs. Once at start up screen, pull the battery to turn phone off, and then get to bootloader by holding vol up/down and power button in. Use the vol up/down to point the big arrow on sceen toward recovery. While in recovery, make sure your terminal prompt still shows the Downloads directory (or where the su and recovery files were downloaded to). Now type: (note the space between zip and /data)

Code:
adb push su.zip /data/media
this will put the su.zip file in the root of your virtual sd card.

You are still in recovery, reboot into recovery to refresh the file list by typing this

Code:
adb reboot recovery
Now go ahead and install su.zip through clockwork recovery's menus. Pretty self explanatory (choose zip from sd card). The su.zip should be now in the root of your virtual sd card.

That's all. You are now unlocked and rooted. Reboot. Make sure you install the paid versions of rom manager, titanium backup, and update superuser app.

13- Download Rom Manager and flash the recovery again (top choice). This will erase the install-recovery.sh file and keeps your CWR at each boot. You do not have to do step 14 if you do this. I will leave step 14 here just in case someone needs it.


14-When you are back in the fastboot screen. DO NOT reboot the phone here. There maybe a file that re-writes the recovery to stock if the phone is rebooted. Your phone may or may not have this file. of the two GN I have, one did and one did not at this step(may have been erased). The file is reovery.sh and is located in /system/etc/ . You need to either rename it or delete it.

While in fastboot and after you flashed CWR, use the Volume up and Down to change the arrow's value to recovery and press the power button. You should now see the familiar Clockwork recovery. In recovery, you can use adb (you can't in fastboot of course). You need to rename that file, use these steps in terminal: (If you see no file/folder found message, you know you do not have this file)

Code:
adb shell
Code:
mount -o rw,remount /system
Code:
mv /system/etc/install-recovery.sh /system/etc/install-recovery.bak
step 1 fires up adb, step 2 allows you to change permissions and read and write, and step 3 renames it. You can now unplug the phone.

Again, you can also get rid of this file by flashing the clcokwork recovery in Rom Manager or using the paid app root explorer to rename the file.



Once again referrence links:

http://rootzwiki.com/topic/12013-wel...lock-and-root/

https://plus.google.com/103583939320...ts/1Jsh9xPwnQP
The Following 15 Users Say Thank You to loveubuntu For This Useful Post: [ View ] Gift loveubuntu Ad-Free
 
 
27th April 2012, 02:27 AM |#2  
Member
Thanks Meter: 3
 
More
thank you so much this is exactly what i was looking for. cant believe im the only one to comment on this. it is very detailed even some one new to Ubuntu could figure this out.
28th April 2012, 09:04 PM |#3  
Account currently disabled
Thanks Meter: 7
 
More
I've been using it too for a while but never posted so THANK YOU! Very easy to follow. Great work.
29th April 2012, 02:32 AM |#4  
loveubuntu's Avatar
OP Senior Member
Thanks Meter: 179
 
More
you're welcome. I find it ironic that a Linux based OS such as Android has so many HOWTOs for Windows but not enough for Linux. #powerofmonoply
The Following 4 Users Say Thank You to loveubuntu For This Useful Post: [ View ] Gift loveubuntu Ad-Free
16th May 2012, 07:03 AM |#5  
ual4720's Avatar
Member
Thanks Meter: 42
 
Donate to Me
More
I find I need to run fastboot commands with sudo or su into root before it will work. Same for you, or misconfig on my side?

Sent from my Galaxy Nexus using XDA
26th May 2012, 02:05 PM |#6  
loveubuntu's Avatar
OP Senior Member
Thanks Meter: 179
 
More
Quote:
Originally Posted by ual4720

I find I need to run fastboot commands with sudo or su into root before it will work. Same for you, or misconfig on my side?

Sent from my Galaxy Nexus using XDA

I'm not sure. How did you setup your adb and fastboot? I did not have to sudo for fastboot commands. What OS are you running?
2nd June 2012, 03:58 AM |#7  
Member
Flag Detroit
Thanks Meter: 1
 
More
Hey loveubuntu, I have a question.

I'm at Step 12, and I'm in recovery and when I run adb push su.zip /data/media, it isn't finding any devices. When I run adb devices, the device isn't listed.

Any advice?
2nd June 2012, 02:43 PM |#8  
loveubuntu's Avatar
OP Senior Member
Thanks Meter: 179
 
More
Quote:
Originally Posted by AndroidSparty

Hey loveubuntu, I have a question.

I'm at Step 12, and I'm in recovery and when I run adb push su.zip /data/media, it isn't finding any devices. When I run adb devices, the device isn't listed.

Any advice?

were you able to see the device in the previous steps 3, 6 and 10 and now you don't?

Things that come to mind is:

1- Do you have the usb debugging checked?
2- unplug and replug the device and see if it works.
3- don't forget the samsung recovery file install-recovery.sh. If the phone is rebooted you may have re-written your recovery and have to start over. Then reboot the phone and go to rom manager and reflash the recovery (first option). This will take care of the install-recovery.sh file.
2nd June 2012, 07:06 PM |#9  
Member
Flag Detroit
Thanks Meter: 1
 
More
Quote:
Originally Posted by loveubuntu

were you able to see the device in the previous steps 3, 6 and 10 and now you don't?

Things that come to mind is:

1- Do you have the usb debugging checked?
2- unplug and replug the device and see if it works.
3- don't forget the samsung recovery file install-recovery.sh. If the phone is rebooted you may have re-written your recovery and have to start over. Then reboot the phone and go to rom manager and reflash the recovery (first option). This will take care of the install-recovery.sh file.

3, 6, & 9...check.

I rebooted my phone by pulling the battery and I still can't get adb to see the device. The install-recovery.sh? I don't remember reading anything about that.

In step 12 it says to let the phone reboot into the Android OS, but it's now back at factory reset, as that's what we did earlier in the instructions. As soon as it boots into the Android OS, adb lists the device.

At that point, since I'm in the AOS, I downloaded Astro File Manager and tried to put su.zip in the /cache folder, I think that's the folder that the clockwork recovery mod folder sees, and I don't have permission. I was hoping I could cheat and just drag & drop instead of pushing it. BUT...I did try the command adb push su.zip /media/play and I get permission denied. I'm guessing I don't have permission, even as sudo, to move the file to /data/media.
2nd June 2012, 09:28 PM |#10  
Member
Flag Detroit
Thanks Meter: 1
 
More
Okay I finally got it!

I didn't wait long enough for the Android OS to boot up. I finally was able to move the .zip file, but I couldn't find where /data/media was. So I let the OS boot up, removed the battery, went back into recovery, moved the zip file, and it was finally listed.
1st July 2012, 04:28 AM |#11  
Senior Member
Flag Leuven
Thanks Meter: 13
 
Donate to Me
More
Ordered a Galaxy Nexus too, will definitely be using this guide. Windows guides are confusing.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes