Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
BlackOtaku
Old
(Last edited by BlackOtaku; 13th February 2011 at 05:22 PM.) Reason: Steps 7 and 10 links updated, were broken previously. Removed top link to script.
#1  
BlackOtaku's Avatar
Senior Member - OP
Thanks Meter 41
Posts: 197
Join Date: Dec 2009
Lightbulb [GUIDE] Linux Ubuntu: Unlocking Bootloader / Rooting Nexus S

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.
Retired: Motorola Droid 1. You're old and broken now, but you served me well.
Side phone (no service): Nexus S running MIUI.
Main phone: Galaxy Nexus on Verizon. Great phone, hands down.
Tablet: 32GB White Samsung Galaxy Tab 10.1, big thanks to Android Central.

Rooting your Nexus S on Linux? This can help!
The Following 20 Users Say Thank You to BlackOtaku For This Useful Post: [ Click to Expand ]
 
Michael.B.
Old
#2  
Michael.B.'s Avatar
Member
Thanks Meter 7
Posts: 61
Join Date: May 2009
Location: Anaheim, CA

 
DONATE TO ME
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.
Nexus S
The Following 3 Users Say Thank You to Michael.B. For This Useful Post: [ Click to Expand ]
 
nicholasbgr
Old
#3  
nicholasbgr's Avatar
Senior Member
Thanks Meter 17
Posts: 206
Join Date: Jun 2010
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
 
BlackOtaku
Old
#4  
BlackOtaku's Avatar
Senior Member - OP
Thanks Meter 41
Posts: 197
Join Date: Dec 2009
Quote:
Originally Posted by Michael.B. View Post
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.
Retired: Motorola Droid 1. You're old and broken now, but you served me well.
Side phone (no service): Nexus S running MIUI.
Main phone: Galaxy Nexus on Verizon. Great phone, hands down.
Tablet: 32GB White Samsung Galaxy Tab 10.1, big thanks to Android Central.

Rooting your Nexus S on Linux? This can help!
 
theimpaler747
Old
#5  
theimpaler747's Avatar
Retired Forum Moderator / Recognized Developer
Thanks Meter 2519
Posts: 21,291
Join Date: Mar 2010
Location: The Ninth Circle of Dante's Inferno

 
DONATE TO ME
Stuck due to the thread's usefulness
 
nicholasbgr
Old
#6  
nicholasbgr's Avatar
Senior Member
Thanks Meter 17
Posts: 206
Join Date: Jun 2010
I forgot to ask: will this work for 64 bit systems?
 
BlackOtaku
Old
#7  
BlackOtaku's Avatar
Senior Member - OP
Thanks Meter 41
Posts: 197
Join Date: Dec 2009
Quote:
Originally Posted by nicholasbgr View Post
I forgot to ask: will this work for 64 bit systems?
It should work just fine.
Retired: Motorola Droid 1. You're old and broken now, but you served me well.
Side phone (no service): Nexus S running MIUI.
Main phone: Galaxy Nexus on Verizon. Great phone, hands down.
Tablet: 32GB White Samsung Galaxy Tab 10.1, big thanks to Android Central.

Rooting your Nexus S on Linux? This can help!
The Following User Says Thank You to BlackOtaku For This Useful Post: [ Click to Expand ]
 
dirk1978
Old
#8  
Senior Member
Thanks Meter 7
Posts: 179
Join Date: Jan 2010
Location: Bromsgrove, UK
Thanks, got me rooted nice and quickly.
 
confiq
Old
#9  
Member
Thanks Meter 1
Posts: 67
Join Date: Jul 2009
Quote:
Originally Posted by BlackOtaku View Post
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: [ Click to Expand ]
 
Michael.B.
Old
#10  
Michael.B.'s Avatar
Member
Thanks Meter 7
Posts: 61
Join Date: May 2009
Location: Anaheim, CA

 
DONATE TO ME
To confirm, yes it works on 64bit. I am running that
Nexus S

The Following User Says Thank You to Michael.B. For This Useful Post: [ Click to Expand ]
 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...