I've been asked this a few times and I actually had to get help the
first time I tried it, so here's my tutorial on how to flash a ROM or
Radio image using your microSD Card. I personally use this method
because my own computer runs Linux. I could probably boot up to Windows
from time to time, but that would be like cheating on my wife; I just
can't bring myself to do it if I can avoid it at all
A few of us old-timers to HTC are so used to our personal little tricks
we use that we forget that newer users haven't learned them yet. I'm
expecting a few people to say, "Oh yeah, we already knew that!" but
perhaps one or two will instead learn from it and appreciate it.
So, without further ado:
Different chefs use different methods when naming their ROM or Radio
images. You must rename the image to "LEOIMG.nbh", since this is the
only recognized file name the bootloader will accept. (note: Some people
are reporting that the file name must be capitalized, or it will not
work. When named exactly as above, it has always worked for me!)
Place the LEOIMG.nbh on a 8GB or smaller microSD card.
Remove the battery cover and press the Reset button.
Hold the Volume Down and End Call (power) buttons at the same time.
As soon as "Searching..." appears on the screen, release the Volume Down button.
ROM will flash. Be sure to hard-reset afterwards to prevent weird errors (as usual).
Now, in case you are wondering about the specifics:
Remember to put the file on the
"root" of the device. This means you can't put it in a folder. I am
using an 8GB Class 2 card for flashing. I would recommend using a 1GB
Class 6, but it's not necessary. It may be possible with a higher class
16GB card, but I haven't tried. Our Class 2 that came with the phone
never works, though I don't rightly know why. [update]souljaboy
wrote in and said: "it doesn't work because a fat32 is needed and by
default the card is formatted fat, I think you should mention that, it
worked for me!" Thanks, souljaboy!
The reset button is a small red or yellow spot just below the slot
for the microSD card. You could also remove and replace the battery; the
important thing is to shut your phone off and restart it.
Pressing Volume Down and End Call (or Power) is the recommended way
to enter the bootloader. If you press the Volume Up and Volume Down at
the same time, you will enter the "Hard Reset" option instead.
If "Searching..." does not appear, you either do not have a
compatible card in the phone, or you are not holding the right buttons.
If you hold the "Volume Down" button past this point, you will see a
message that says, "Press the Power Button to upgrade your phone."
Releasing the "Volume Down" button at this point may or may not work, I
had to release it before. If you release the "Power Button" now, your
phone will simply reboot without flashing.
ROM flashing via SD is much safer than via USB, since you don't have
to worry about accidentally unplugging the cord or an issue with your
PC, such as a crash or power failure.
---Added 05/21/10 as suggested by zelendel (Thanks for the sticky!)
If you are flashing an "Official" ROM direct from HTC or T-Mobile, you will more than likely over-write your SPL (Second Program Loader).
This means, even if you have HSPL installed now, you could be reverted
back to SSPL, rendering you unable to flash custom ROMs.
To make matters worse, if you flash an ROM higher than 2.10 and you
attempt to install the current (as of 5/21/10) HSPL, you will brick your
phone. Yeah, it's bad.
So, assuming you have flashed an official ROM over 2.10 via the SD card
and you decide you want a custom ROM, follow these simple directions:
(You do not have to have your phone connected to your PC for these steps)
If done properly you should now be able to once again flash custom ROMs. Congratulations!
Hopefully someone will find this useful. If you have any issues, reply
to this thread and I or some other wonderful xda member will try and
sort things out.
Quite a few people have asked about compiling ROMs from source, so here's a guide.
This guide is directed mainly at compiling ICS for the GSM Galaxy Nexus.
It will show you how to set up the building environment really quickly
with a few simple commands in the Terminal, then show you how to sync up
with the repository and compile a ROM.
Here are the steps:
(There are additional things you can do via the link above).
======================
IMPORTANT NOTES:
- For the purposes of this guide, you MUST be running 64-bit Ubuntu.
This can be set up on a VM (it will compile if set correctly).
- If using a VM, ensure you give it at LEAST 2gb RAM and 2xCores (it'll take 3-4 hours at best)
- The source download is approximately 6gb.. you're going to need 25gb HD space for a single build.
To learn how to setup a Ubuntu 64bit VM on your Windows PC, use THIS GUIDE. I recommend using 10.04.
So... let's assume you're running Ubuntu 64 bit for the first time, and start right from the beginning.
NOTE : You're probably better of copying and pasting these commands, as some are quite long! All commands are in RED!
======================
1. Preparing your development environment
The very first thing you're going to need to do, is ensure you're
working in a root terminal. Much like when using your Android phone,
you'll want the # and not the $. In order to do this, open TERMINAL, and
type:
sudo -i
Then type in your password. From this point forward, all of the commands
in this guide assume you have root priviliges (saves typing sudo
*superuser do* before everything!)
Next, we need to add a repository so that apt-get knows where to look for Java JDK:
After that, you'll need to update the repository with the following command:
apt-get update
Now that your repository has been updated, you can proceed with
installing the required packages to make building Android from source
possible. The first thing you're going to need is the Java Development
Kit 6:
apt-get install sun-java6-jdk
Followed by (and this may already be installed depending on which version of Ubuntu you went for):
apt-get install python
Now you're going to need Git. Git is the revision control system.
apt-get install git-core
Now, you're going to pull in all the required packages needed for the
build process. As I have stated already, this guide is for 64 bit ONLY.
Some of these will not work on 32-bit, so if you're using 32 bit, you're
reading the wrong guide (sorry)!
Congratulations; you now have all the required packages to proceed with the next step!
======================
2. Installing and initialising the repo
Now we need to download repo, add it to our path and set the permissions
. Please note that if you close terminal, you'll have to do this again.
Type each command on a new line, pressing enter after each:
You will now be prompted to provide your name and email address. Please
give it real details; that way you can use the gerrit code review tool
if your email is connected with a Google account.
======================
3. Downloading the source (sync)
This is probably the most simple part, but depending on your connection
speed, it could take a while. I am on 40mb download/10mb up, and it took
about 25 mins. If you're on a typical DSL connection, expect to be
waiting 60-120 minutes.
repo sync
======================
4. Obtaining proprietary binaries
New for ICS, Android cannot just be compiled from source code only. It
requires additional hardware-related proprietary libraries to run,
specifically for graphics acceleration (and GSM/LTE).
Each set of binaries comes as a self-extracting script in a compressed
archive. After uncompressing each archive, run the included
self-extracting script from the root of the source tree, confirm that
you agree to the terms of the enclosed license agreement, and the
binaries and their matching makefiles will get installed in the vendor/
hierarchy of the source tree. For example... after extracting one of the
files, you will have 'extract-imgtech-maguro.sh'. Simply run:
sh extract-imgtech-maguro.sh
From your ICS_Source directory.
IMPORTANT NOTE : If you are building for the Nexus S, you will need the Nexus S binaries.
======================
5. It's build time!
If you're a JAVA developer, feel free to have a play with the source and
make any changes you want to make at this stage. Be careful though,
adding rubbish/old syntax code to the source (formatting is slightly
different to gingerbread) will cause the build to fail.
Assuming that you just want to get on with building ICS, set the build environment up with:
source build/envsetup.sh
Next, you'll need to lunch. I don't mean go and have a sandwich, I mean... select which device you're building for.
NOTE - you can add other devices to this list PRIOR to proceeding
with this step. If you're NOT building for the GNexus, go to the bottom
of this guide and look at how to add devices to the list.
As previously stated, we're going to assume you're building for the Galaxy nexus, so type:
lunch
You'll be presented with a number of options (full-eng, etc).
If you're building for the Galaxy Nexus (codename: Maguro), type:
8
(7 for Nexus S and 6 for Nexus S 4G)
and hit enter. Now, we're ready to set the compile in motion, ladies and
gentlemen. There's a lot of debate over the next bit. the -j part of
the below command is technically not needed, but I have had MUCH more
success compiling on a virtual machine with the -j1 added. Could be
random... who knows...
Anyway, to set your build in motion, you now have TWO options. The first
option will output the build as img files. The second option will
output a flashable .zip file. I recommend the latter if you intent to
use CWM over fastboot.
make -j1
or
make -j1 otapackage
Congratulations - in a few hours, you should have a working AOSP build for the Galaxy Nexus!