Flashing Android Froyo in a Galaxy S with Ubuntu and Heimdall

As some of my friends know, I am now a happy Android user. In fact, for about 5 months already… But my phone shipped with ECLAIR version of Android (2.1) and since I’m an Ubuntu user, I would find a way to flash my device and update my firmware to FROYO without Window$ / VirtualBox traditional approach. For my surprise, there are some options to accomplish that and I’ll explain the one that worked for me.

Please Note: These steps worked for me but it’s possible that will not work for you. It’s a very stable procedure but $hit happens. Do follow the steps at your own risk.

UPDATE – The same procedure works with Android 2.3.3 (Gingerbread) firmware. Version I9000BVJJV3 – Jun 2011. Please check samfirmware website to download.

Heimdall

According to their website, here is a description:

Heimdall is a cross-platform open-source tool suite used to flash firmware (aka ROMs) onto Samsung Galaxy S devices.

It has ports for Mac OSX, Linux and even Windows, although most of the Windows users prefer to use Odin to flash their devices or even Samsung Kies.

You can grab heimdall packages for Ubuntu from their website -> http://www.glassechidna.com.au/products/heimdall/

For this tutorial I’m using Heimdall 1.1.1 command line tool. Using the GUI version I’ve got some strange behaviours and some times the GUI just said that Flash happened without any processing.

Android Froyo firmware download

To flash your device you must obtain the firmware version that you’ll apply. You have many options over the web to obtain different versions of Android. Some of them claims to be original ones from operators and some others modified/hacked versions with extra functionalities. I’ll stick with the “original” ones and since I’m in Brazil, my device has digital TV so I need to use a GT-I9000B firmware. Here are two options to download firmwares:

For this tutorial I’m using  Froyo 2.2 (Operator Free):

Procedure

  1. Install heimdall
  2. Uncompress the downloaded firmware package, in my case -> OK – 2.2 – FROYO – BRASIL SEM OPERADORA.rar
  3. Check if you have all the necessary files:

    -r--r--r-- 1 markito markito  13955072 2010-12-11 01:23 cache.rfs
    -r--r--r-- 1 markito markito   4833980 2010-12-11 02:04 zImage
    -r--r--r-- 1 markito markito    716800 2010-12-11 02:04 param.lfs
    -r--r--r-- 1 markito markito 254341120 2010-12-11 02:04 factoryfs.rfs
    -r--r--r-- 1 markito markito  12582912 2010-12-12 22:30 modem.bin

  4. Move or copy the PIT file (s1_odin_20100512.pit) to the same directory you uncompressed the firmware
  5. Put your device in download mode. On a Galaxy S you should hold -> home buttom + power buttom + volume downand wait until you see the Android logo with “Downloading” written below.
  6. Now that your phone is ready to receive a new firmware, plug the USB cable, wait a few seconds and type the following command in the same directory you have uncompressed all the files:

    heimdall flash --factoryfs factoryfs.rfs --cache cache.rfs  --param param.lfs --kernel zImage --modem modem.bin --pit s1_odin_20100512.pit

  7. Now you should wait a few minutes and expected for the best: successful messages. :-)
  8. Your device should boot and will stuck a few moments in the Samsung S logo. That’s normal because it’s the first boot of your new kernel. But your are ready to go now, firmeware updated!

If it worked for you, congratulations. If you had or still have some problems, please take a look at some of the sources that I’ve used to learn and apply to my device, maybe it will help.

Sources:

How to update IPhone 3GS firmware to iOS4 in Ubuntu 10.04

WARNING: By following this tutorial you can make your IPhone stay in a “bricked” state, which will lead into an nonoperative system.  Follow at your own risk.

Requirements:

  • Oracle VM Virtual Box 3.2.1 (.deb)
  • Ubuntu 10.04  64bit (for host OS)
  • Windows XP (for guest OS)
  • ITunes 9.2
  • Setup your Windows guest on Oracle VM Virtual Box.
    Note: You can use any Windows installation, but you need to install the updated Virtual Box Guest Additions.

Steps:

  1. Before start we need to do a set of tweaks in Ubuntu groups configuration
    1. Click on System > Administration > Users and Groups
    2. Select your “current desktop user” and click on Manage Groups
    3. In the group list, look for vboxusers. Select and click on Properties
    4. In the Group Members list, mark your user name and click Ok.
    5. Click on Close in the Group Settings and close on User Settings.
    6. Now to make your session ready, Log-out and Log-in of Ubuntu.  (If you don’t know how to do that, restart your machine)
  2. Now open Oracle VM Virtual Box (Applications > System Tools > Oracle VM Virtual Box)
  3. Select your Windows machine and click on Settings.
  4. With your IPhone plugged, go to USB and verify if the option “Enable USB Controller” is checked and UNCHECK “Enable USB 2.0 (EHCI) Controller”.
  5. Add a USB Device Filter selecting the plus icon on the right side and select your IPhone device from the list. This will make your VM directly bind to the USB port the device is using. After that, when you boot this VM, you’ll not be able to mount/use the device on the HOST machine (Ubuntu), only in the GUEST machine (Windows). That’s exactly what we want.
    USB Filter Virtual Box
  6. Start your Windows VM and install ITunes 9.2. After the installation, proceed with the normal IPhone update steps.
  7. If you see any errors, you can just click Ok and select/deselect the IPhone USB port in USB icon (3rd button from left in the picture below).
    USB button on Virtual Box
  8. After some error messages (3 of them in my case) I’m with the brand new iOS4 in my IPhone 3GS.

Unfortunately, I don’t know another way to do this without using a Windows VM and ITunes. If you do, please share!  :)
References:
http://forums.virtualbox.org/viewtopic.php?f=2&t=18852
http://ubuntuforums.org/showthread.php?t=1318160&page=2