This weekend I took on the project of getting Ice Cream Sandwich installed onto a Samsung Galaxy S phone, the Verizon branded Fascinate. Getting the Fascinate to comply with what I believed to be a reasonable request was made difficult by some annoying traits of the hardware itself, but that is a story for another time. The real hero of the day was Benjamin Dobell’s Heimdall, without which I would have been completely lost.
If you’ve ever worked with the Samsung Galaxy S line of phones, you are probably aware of the Norse theme the recovery method and software employs. The software which runs on the phone itself and receives the firmware images to flash is known as Loke, and the software you run on the computer is called Odin.
Odin is, as its name suggests, a very powerful piece of software. It allows the user to flash new ROMs or individual partitions to their Galaxy S device, even if it’s not otherwise bootable. This recovery capability is used by Samsung and its authorized parties to update and repair Galaxy S devices, though it’s equally useful to those of us who wish to modify our phones. Odin makes it possible to recover your device in even the most dire of software situations, meaning it’s nearly impossible to damage a Galaxy S device to the point it can’t be repaired (outside of physically smashing it, at least).
But Odin has a serious problem, and it’s not Ice Giants; Odin is leaked software from Samsung, and can’t be legally distributed. The only versions of Odin you are going to find online were stolen from Samsung and have been floating around on random shady sites for untold amounts of time. This is about the worse source of software you can possibly use, and in fact, many of the Galaxy S guides will actually tell you to turn off your anti-virus software before downloading and running Odin due to “false positives”. Yeah…I’m good.
Though even if Odin was freely available, I don’t own the prerequisite Windows computer to run it on in the first place. Software which has the capability of easily destroying my hardware is not the kind of thing I like to run in WINE or even a VM either. So what is a non-Windows having, software license obeying, guy supposed to do?
Heimdall is a fully open source and portable replacement for Odin, with binaries available for Windows, Linux, and Mac OS. Heimdall is a command line tool, easily integrated into scripts, but also includes a GUI front-end designed to make the task a bit easier for the less technically inclined.
Heimdall simultaneously solves all of the problems with Odin (well, maybe not the Ice Giants). It’s open source, so the community can be sure it’s not a virus or malicious software out to destroy phones, it’s cross-platform so those of us without Windows don’t have to suffer, and you never have to worry about tracking down a leak of the latest version because you can just grab it from the site.
If there was any downside I found of Heimdall, its that nearly every guide or forum post you find online about recovering or working with a Galaxy S device will be focused on Odin. This can be a bit confusing, as the interface of Heimdall-frontend (assuming you even installed it) doesn’t match up with the instructions given for the Odin interface.
Moreover, it doesn’t appear that Heimdall can directly handle the types of firmware image files that seem to be commonly posted online. Firmware images for the Galaxy S devices, including the stock images, are distributed with the extension .tar.md5, which Heimdall completely chokes on no matter where you attempt to load it within the frontend. The secret is to extract the .tar.md5 image into its principle parts, and load that into Heimdall. For example, you can see the files contained within one of the stock firmware images for the Fascinate here:
bash$ tar tvf CI500_VZW_EH03_GB_CM.tar.md5 -rwxr--r-- cw50_jung/cw50_jung 765952 2011-11-02 21:45 param.lfs -rwxr--r-- cw50_jung/cw50_jung 1310720 2011-05-19 00:43 Sbl.bin -rwxr--r-- cw50_jung/cw50_jung 262144 2011-05-19 00:42 boot.bin -rwxr--r-- cw50_jung/cw50_jung 5411928 2011-11-02 21:45 recovery.bin -rwxr--r-- cw50_jung/cw50_jung 5411928 2011-11-02 21:45 zImage -rwxr--r-- cw50_jung/cw50_jung 325054464 2011-11-02 11:39 factoryfs.rfs -rwxr--r-- cw50_jung/cw50_jung 1376256 2011-11-02 11:39 dbdata.rfs -rwxr--r-- cw50_jung/cw50_jung 1245184 2011-11-02 11:39 cache.rfs -rwxr--r-- cw50_jung/cw50_jung 113998336 2011-10-31 08:32 movinand.bin -rwxr--r-- cw50_jung/cw50_jung 16252928 2011-10-29 00:45 modem.bin
These individual files can then be loaded up into Heimdall-frontend’s “Flash” tab (as the previous image showed), or flashed with Heimdall right on the command line with the following syntax, substituting the appropriate partition switch and filename as needed:
bash$ heimdall flash --recovery recovery.bin
It’s important to realize that not all of the individual partition image files are required for the flashing operation. The previous command could be used with a .bin file for the latest ClockWorkMod Recovery to install everyone’s favorite recovery without needing root (or even having to boot the phone up). In fact, that’s exactly how I got the process of installing ICS started on the Fascinate. You could also flash just the radio baseband, or only the kernel; whatever the recovery situation requires.
After using Heimdall to great effect over the last few days, from getting ClockWorkMod installed to recovering the phone to stock when I had trouble provisioning it on Verizon once ICS was installed. It’s an excellent recovery tool, and completely fills the role of Odin without any of the logical problems.
What I’d love to see now is more people embrace Heimdall, and start including it in their guides and tutorials. If more people are instructed in how to properly use Heimdall, the community could start weaning itself off of shady illegal software. I would also like to see more people make firmware images available in Heimdall’s particular package format. This capability is a real boon to ROM developers, but I’ve seen very few of them actually making use of the function.
With the release of Heimdall 1.3.2 just a few days ago, now is a great time to give this excellent piece of software a shot and put Odin to sleep, for good.