FORUMS
Remove All Ads from XDA

[GUIDE] Linux Ubuntu: Unlocking Bootloader / Rooting Nexus S

198 posts
Thanks Meter: 41
 
By BlackOtaku, Senior Member on 22nd December 2010, 02:26 AM
Post Reply Email Thread
One thing I've noticed is there isn't a lot of documentation for getting set up and unlocking your bootloader on a Linux OS. Setting up your machine to get adb and fastboot to recognize your device takes a tiny bit of extra work on a Linux operating system, but what exactly needs to be done may not be clear to everyone. Whether it's because you're new to the Android SDK/adb, somewhat new to Linux, or can't simply can't seem to find the Vendor Code for the Nexus S. (For those who are looking specifically for this, it's '18d1', and I assume will be the same on all Nexus devices to come; If this means nothing to you right now, read on.)

Disclaimer: I take no responsibility if something goes wrong (if it does, it should be fixable though), Unlocking your bootloader voids your warranty (but you can lock it back), Unlocking the bootloader will wipe your entire phone, including USB Storage; so make a copy of all those family photos and other files you may have put onto the USB storage if you want to keep them.

For the sake of sanity, this guide assumes you are using Ubuntu. If you're using something else (or different applications), there are terminal commands offered, and you probably have an idea on how to adapt the given instructions to your Linux OS.

Preparation: Installing the Android SDK, ADB, Fastboot & Setting Up Your Nexus S to be Recognized

1. Download the Android SDK for Linux: http://dl.google.com/android/android...8-linux_86.tgz

2. Save it in a folder of your choice. I chose to keep it in my Downloads folder, myself. If you'd like, you can rename it to the simpler name of 'AndroidSDK.tgz'. The rest of the guide will assume that you did, because I'm lazy, and it makes things simpler; it will also assume you saved it in Downloads. If you feel that you have the intuition to rename and edit the path names based on your own choices, then fine; but if you're utterly lost here, just stick with what I'm doing; download to 'Downloads', rename to 'AndroidSDK.tgz'.

3. Now that you have it, navigate to the folder you downloaded it to, right-click, and click 'Extract' to unzip it. If for some reason you cannot do this, open up a terminal and try this command:
Code:
tar zxvf /home/<your-user-name>/Downloads/AndroidSDK.tgz
You may have to adjust the command if you didn't save it under Downloads or didn't rename the file to AndroidSDK.tgz.

4. Now, we'll install adb and some other software packages by starting up the Android SDK and AVD Manager. Start it either by:

- Navigating to your AndroidSDK folder, going to the 'tools' folder and double-clicking the file called 'android'; if a popup opens asking you what you want to do with it click 'Run'.

- Using this command:
Code:
/home/<your-user-name>/Downloads/AndroidSDK/tools/android
5. In Android SDK and AVD Manager, click on "Available packages". Check the box next to "Android SDK Tools, revision 8" and "Android SDK Platform-tools", and click on "Install Selected" then "Install". When prompted click "Yes" to restart ADB.

6.You should now have a folder in /home/<your-user-name>/Downloads/AndroidSDK/ called "platform-tools".

7. Download fastboot here: http://developer.htc.com/adp.html
- Save it to the aforementioned platform-tools folder.
- Now, navigate to the file, right click it, click 'Properties', go to the 'Permissions' Tab and check 'Allow executing file as program'. Alternatively, run this command:
Code:
chmod +x /home/<your-user-name>/Downloads/AndroidSDK/platform-tools/fastboot
8. Now to set things up so adb and fastboot recognize your Nexus.

- Type this command into a terminal:
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
- Paste this into the blank file:
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
- Click save and close.
- Then, type the following terminal command:
Code:
sudo restart udev
9. Almost done with preparations! Run this command:
Code:
gedit .bashrc
And add this line to the top of the file:
Code:
#AndroidDev PATH
export PATH=${PATH}:/home/<your-user-name>/Downloads/AndroidSDK/tools:/home/<your-user-name>/Downloads/AndroidSDK/platform-tools
Then save the file and close.

10. Download this file and save it to /home/<your-user-name>/Downloads/AndroidSDK/platform-tools: http://www.mediafire.com/?4pe5y906zr67nfh

10.We're ready to go!

Unlocking the Bootloader on your Nexus S and Rooting

Once again, unlocking your bootloader wipes everything on your device, including USB storage. Make a backup of any files you want to keep.

1. On your Nexus S, go to Menu>Settings>Applications. Select "Development" and check the box next to "USB debugging"

2. Power off the phone, and then hold down the Volume Up button and the Power button simultaneously to get into Bootloader/Fastboot mode. Connect your Nexus to the computer via USB.

3. Run this command to unlock your bootloader: (Once again WIPES EVERYTHING!)
Code:
fastboot oem unlock
Hit Enter and on your phone you will be prompted to confirm the action. (Use Volume +/- buttons to choose, power button to confirm choice) Confirm. At this point you will have an unlocked bootloader.

4. Copy/paste the following into the Terminal window:
Code:
fastboot flash recovery /home/<your-user-name>/AndroidSDK/platform-tools/recovery-clockwork-herring.img
5. Use the Volume +/- buttons to choose the Recovery option, then press the power button.

6. In Recovery, go to 'mounts and storage' and choose 'mount USB storage'.

7. Go to this page: http://forum.xda-developers.com/showthread.php?t=682828

About 1/5 of the way down on that page, find the link for "su-2.3.6.1-ef-signed.zip", which is the link for the Froyo version of Superuser. Control-click (right click) on that link and choose "Download Link As..." Save that file to your desktop and then copy it to the main directory of your mounted phone.

8. Click 'Unmount'. Go back to 'mounts and storage' and choose 'mount /system'. Then Go Back and choose 'install zip from sdcard'>'choose zip from sdcard'>su-2.3.6.1-ef-signed.zip

9. When it's finshed installing, reboot. You are now rooted.

Special Thanks
Amin Sabet; I used your Mac guide as a reference and copy/pasted some things for convenience.

Koush; For first posting the unlocking information, developing ClockworkMod Recovery, and ROM Manager. You should probably hook him up with a donation. https://www.paypal.com/us/cgi-bin/we...06282818e091d0

Michael.B.; for suggesting adding the platform-tools folder to the .bashrc file.

Linus Torvalds; Without which we'd have neither Android nor Ubuntu.

Feel free to leave your comments on the guide below.
The Following 20 Users Say Thank You to BlackOtaku For This Useful Post: [ View ] Gift BlackOtaku Ad-Free
 
 
22nd December 2010, 08:49 AM |#2  
Member
Flag Anaheim, CA
Thanks Meter: 27
 
Donate to Me
More
Good guide for beginners, I would throw in how to update their path so they can just type adb or fastboot

Quote:

On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ and platform-tools directories to it. If you don't see a line setting the path, you can add one:
export PATH=${PATH}:/home/<your-user-name>/Downloads/AndroidSDK/tools:/home/<your-user-name>/Downloads/AndroidSDK/platform-tools

Be sure to update your username above.
The Following 3 Users Say Thank You to Michael.B. For This Useful Post: [ View ] Gift Michael.B. Ad-Free
22nd December 2010, 03:25 PM |#3  
nicholasbgr's Avatar
Senior Member
Thanks Meter: 19
 
More
Thanks a lot man, great guide. I didn't get my NS yet but this is gonna be very useful soon

ps: someone please stick this
22nd December 2010, 05:21 PM |#4  
BlackOtaku's Avatar
OP Senior Member
Thanks Meter: 41
 
More
Quote:
Originally Posted by Michael.B.

Good guide for beginners, I would throw in how to update their path so they can just type adb or fastboot



Be sure to update your username above.

Thanks for the tip. I added your tip and instructions for marking fastboot as executable.
22nd December 2010, 06:14 PM |#5  
theimpaler747's Avatar
Retired Forum Moderator / Retired Recognized Developer
Flag The Ninth Circle of Dante's Inferno
Thanks Meter: 2,773
 
Donate to Me
More
Stuck due to the thread's usefulness
22nd December 2010, 06:32 PM |#6  
nicholasbgr's Avatar
Senior Member
Thanks Meter: 19
 
More
I forgot to ask: will this work for 64 bit systems?
22nd December 2010, 06:55 PM |#7  
BlackOtaku's Avatar
OP Senior Member
Thanks Meter: 41
 
More
Quote:
Originally Posted by nicholasbgr

I forgot to ask: will this work for 64 bit systems?

It should work just fine.
The Following User Says Thank You to BlackOtaku For This Useful Post: [ View ] Gift BlackOtaku Ad-Free
22nd December 2010, 08:46 PM |#8  
Senior Member
Flag UK
Thanks Meter: 7
 
More
Thanks, got me rooted nice and quickly.
22nd December 2010, 09:10 PM |#9  
Member
Thanks Meter: 13
 
More
Quote:
Originally Posted by BlackOtaku

It should work just fine.

Yes but don't forget to install 32 libs.

Thanks for guide
Useful !
I'm waiting for cyanogen ROM so i'll able to install
Cheers
The Following User Says Thank You to confiq For This Useful Post: [ View ] Gift confiq Ad-Free
22nd December 2010, 09:14 PM |#10  
Member
Flag Anaheim, CA
Thanks Meter: 27
 
Donate to Me
More
To confirm, yes it works on 64bit. I am running that
The Following User Says Thank You to Michael.B. For This Useful Post: [ View ] Gift Michael.B. Ad-Free
22nd December 2010, 09:47 PM |#11  
nicholasbgr's Avatar
Senior Member
Thanks Meter: 19
 
More
Thanks for the confirmation, guys
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