yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] cova_fe:
Firts of all, thanks for this great job :)

Anyway I've run into a small glitch while installing voodoo lagfix on froyo: basically, whiel I'm using the same pit I used for installing JPM (803 from samfirmware), heimdall complains about different pits and won't continue the flashing. Odin can go on without pit file, so I guess that in this case it can be avoided.. oth other hand, I'd like to understand why heimdall complains in the first place.

A couple of remarks, that I noticed while making a ebuild file for gentoo (I can make it available if someone needs it); they are needed only to make life easier for automatic build tools, not really showstoppers.

- configure script is not executable, can you chmod 755 prior to make the source zip?

- it would also be nice that the package is called heimdall-1.0.0.tar.gz and with first level dir like heimdall-1.0.0.

As said, this suggestions are made only to have a more "standard" packaging and make life easier for packagers :)

my ebuild takes care of the actual package, but while you are at it... ;)
[Galaxy S I9000 Android Development] cova_fe:
I know that i can look at the code :), but is there any way to dump the pit file you retrieved from phone, to do a comparison with file on hd to see where are the differences?
[Galaxy S I9000 Android Development] Benjamin Dobell:
The current release of Heimdall will never flash a PIT file to your phone. As far as I can tell you're only required to do so when you repartition, which is something presently not supported by Heimdall as it requires the use of adb.

So when you specify a PIT file all Heimdall does is open the specified file, retrieve the PIT file stored on the phone and then compare the two. If Heimdall discovers the PIT file stored on the device doesn't match the PIT file you're flashing with then it gives the error you've seen.

My guess is that you didn't select "repartition" when you last used the 803 PIT, so Odin never uploaded it to your phone. This is just an assumption, I don't actually know if this is how Odin works but it would make sense.

If that's the case then Odin itself is ignoring the 803 PIT when you flash and is instead using information from the 502 PIT stored on your phone. This isn't at all a problem, it just means that if you want to flash with Heimdall you'll have to specify the 502 PIT.

Will that work? The file permissions are already 755 on my OS X box, however I've transferring to Windows before zipping. Perhaps that's the issue...?

Sorry the reason it is named as such is simply to distinguish between the Windows package and the Source package. On my PC I have the Windows package "Heimdall" and "Heimdall-Source" both stored in the same directory. When I make another release I'll consider reorganising it a bit.
[Galaxy S I9000 Android Development] Benjamin Dobell:
Although Heimdall does retrieve the PIT file there currently isn't an option to dump the retrieved PIT to a file on your hard-drive. I actually intended to implement this functionality but forgot about it, I'm a bit busy at the moment so I don't have time to do it myself.

However here is a quick (hacky) implementation for you:

Add that below line 327:

Your phones PIT file will then be stored in a file called dump.pit. I believe it will always be size 4096 bytes so the file will just be padded out to that length even if the corresponding PIT on your PC isn't that long.
[Galaxy S I9000 Android Development] cova_fe:
Uh, it seems that you are quite on target :)

now I wonder why samfirmware recommends to use 803.pit without repartitioning, but that is another story..

Very likely.. windows and linux/mac permissions likes to fight :)

Thanks!
[Galaxy S I9000 Android Development] Eyalco:
Thanks a lot Benjamin Dobell

Good job Benjamin Dobell!!

now i can finally flash from my linux,

not need to use my sister's laptop with winblows ever again!!

i also tryed with virtualbox, but the flash got stuck in the middle.
[Galaxy S I9000 Android Development] pietro_spina:
That's the issue. windows strips the executable bit.

If it is your preference to pack things up via Windows, I say just include some instructions in the README file.

chmod +x configure
or
chmod 755 configure

the same goes for 'autogen.sh' But if a user is getting involved with that then they can probably figure out to chmod.
[Galaxy S I9000 Android Development] jbrugger:
thank you, thank you, thank you!!!

Using Odin under vista in virtualbox was a disaster (almost bricked my phone)...

Using Heimdall i was able to update the kernel (voodoo version) and get rid of the lag-issue in Froyo.

Installing / compiling was a piece of cake (using ubuntu 10.10 64 bits)

As stated above, chmod +x ./configure to be able to build it, you need sudo rights to install it as well.

So it works fine on my system.

By the way, i own a i9000 ( the European version of the Galaxy in the Netherlands, so that may be on your list of compatible devices as well )
[Galaxy S I9000 Android Development] cmf:
I've been doing fine with Odin via VirtualBox. In fact I also flash my car's ECU (EFILive) via VirtualBox too. Some might think it risky, but ("touch wood") it works fine!

Anyway, what a great job you have done on this software. I will give it a go next time. I am on Ubuntu Maverick x64.

What I really want to know, is whether it works on the Mac now that we mostly all have Froyo. I'm impressed that Samsung answered you on the broken USB bootloader. Communication on such matters with big companies can often be difficult! I don't have a Mac but I enjoyed following the discussion.
[Galaxy S I9000 Android Development] Compintuit:
I know that this thread is highly technical, but as a canadian linux user, could someone inform me if I'll be able to use heimdall to update my phone once Bell releases the update? Thanks a lot - I've been traumatized by going from a ipod touch to android which still is trying to require windows! If Heimdall could, that would reassure me of the power of open source ever so much...
[Galaxy S I9000 Android Development] pietro_spina:
I don't think you will be able to use this to flash the official updates from bell a this tool replaces Odin not Kies.
[Galaxy S I9000 Android Development] ModyCZ:
Packaged for Ubuntu

Hi,

I've made a package of Heimdall for Ubuntu Maverick, I'll add Lucid shortly. Can't post URL so search Ubuntu PPAs for "heimdall".
[Galaxy S I9000 Android Development] Benjamin Dobell:
Excellent! Seems as I'm able to post links, here it is.
[Galaxy S I9000 Android Development] Benjamin Dobell:
If you can get your hands on a copy of the official update then you can use Heimdall to update. Samsung don't make direct links available so you'll probably have to ask someone for a copy.

At some stage I will add functionality to imitate Kies and try download updates directly from Samsung.
[Galaxy S I9000 Android Development] mklappstuhl:
Please don't!

GUIs make things only more complicated I think.

I will try to get it working on my Mac now...
[Galaxy S I9000 Android Development] Benjamin Dobell:
It's alright the gui will be optional. It will be a separate front-end that just calls heimdall itself.

Let me know how you go on your mac.
[Galaxy S I9000 Android Development] razze76:
Hi!

Thanks for a great piece of software, Yesterday I flashed my International GT-I9000 bought in FInland and everything worked smoothly! (OS Linux Gentoo 64). Another device can be added to the compability list, and a small donation is on it's way...
[Galaxy S I9000 Android Development] Aery:
Nice work.

Testet on GT-I9000 and Ubuntu 10.10 x64
[Galaxy S I9000 Android Development] ashwinds:
Do update on how it goes with the mac.. were you able to get the device recognized?
[Galaxy S I9000 Android Development] razze76:
A question/feature request/whatever: Odin has to my understanding the possibility to do a repartition (total wipe?). Is this something that is already available in Heimdall, or do you even have plans to add this feature sometime?
[Galaxy S I9000 Android Development] mklappstuhl:
I got Heimdall running on my mac now.

"make install" doesnt work but at least it's built.

Did I get that right that I have to flash the Froyo update first via Odin to be able to use Heimdall?
[Galaxy S I9000 Android Development] Benjamin Dobell:
It was initially my intention to include repartitioning functionality, there are still references to repartitioning in code actually. However after doing some investigation it turned out that the repartitioning is handled by a different protocol used when the device is in recovery mode (not download mode). I'm assuming it's done by ADB however I'm really not certain. If anyone has any ideas then I might look a bit further into it.
[Galaxy S I9000 Android Development] Benjamin Dobell:
Actually it does look like "sudo make install" did work. As long as heimdall has been copied to to /usr/local/bin then it should be fine.

Unfortunately yes, and even then that's yet to be verified. I'm just going off what Samsung told me.
[Galaxy S I9000 Android Development] eltommi:
Good job. Tested many times with success on my Chakra (arch) x86_64 with a I9000 8GB.

Goodbye Odin in a virtualized XP.

Thanks a million
[Galaxy S I9000 Android Development] mklappstuhl:
Oh, you are right. It did work.

I just thought it didn't because there was no completion.

I will build a formula for homebrew.

And please put it on Github! ;)
[Galaxy S I9000 Android Development] SaMsA:
If a fedora user don't know what he needs to install here is everything he will need:

yum groupinstall "Development Tools" "Legacy Software Development"
[Galaxy S I9000 Android Development] TheJunx:
Compiling Heimdall on OSX

Install fink or macports (you should have one already, lets be honest)

# Prefix for fink: /sw/lib

# Prefix for ports: /opt/local/lib

#To quickly determine if you are using ports or fink:

which pkg-config

#/sw/bin/pkg-config - fink

#/opt/local/bin/pkg-config - ports

mkdir src;cd src

#Download libusb from sourceforge

# Download Heimdall from their webpage

#I can't post links

tar xf libusb-1.0.8.tar.bz2

unzip heimdall-1.0.0-source.zip

cd libusb-1.0.8

# Here is where you use the prefix - for ports its /opt/local for fink its /sw

./configure --prefix=/sw

make

make -n install

# Make sure it says the correct prefix for the install commands, for example "/usr/bin/install -c -m 644 $files "/sw/lib/pkgconfig" || exit $?; \"

sudo make install

## Heimdall is easy, it just seems to be looking locally for the libusb headers, so we copy them in place

cd ..

cd Heimdall-Source

cp -R ../libusb-1.0.8/libusb libusb-1.0

chmod 755 configure

chmod 755 *sh

./configure

make

sudo make install

Done
[Galaxy S I9000 Android Development] zpon:
Just flashed my I9000 from denmark, seems to be working fine
[Galaxy S I9000 Android Development] Benjamin Dobell:
As I can see people have been compiling Heimdall on OS X with no issues, that should hopefully have been working from day one.

However, have people been using OS X to flash successfully (with a Froyo phone) or just Linux?
[Galaxy S I9000 Android Development] ashwinds:
Does compiling on OSX imply that the device now gets recognized by OSX?
[Galaxy S I9000 Android Development] zpon:
You mention the re-partition task is done from adb in recovery-mode, is it possible to this by hand? I have been searching a bit for an answer, but without any luck, any pointers will be appreciated.
[Galaxy S I9000 Android Development] Benjamin Dobell:
No, heimdall has always compiled and ran on OS X. The issue is the Galaxy S itself not properly registering itself as a USB device.

Sorry I have zero idea at the moment.
[Galaxy S I9000 Android Development] Akrilee:
So, sorry, I'm back again. At the moment, I have tons of work, but as soon as there is time, I could work on a gui. My first Idea would be to just boldly copy the odin gui :). Suggestions are appreciated. BUT: This probably won't happen before my XMas holidays. Same thing with the fedora package /rpm package. Unfortunately, university is a heck of a lot of work. I will post back if I get start crackin' (xcept, ben is faster at pushing out a suitable gui).

So long.
[Galaxy S I9000 Android Development] TheJunx:
I'll be trying a flash from OSX over the weekend, can't afford to have my phone out of commission during the week for any length of time. I have a Windows 7 box with Odin on it, should my flash fail.

I'm starting from Froyo, so hopefully I'll have success.
[Galaxy S I9000 Android Development] zpon:
I have created a simple GUI for hiemdall in GTK and python which can help the user extract PDA, PHONE and CSC and create the resulting command to be executed by heimdall.

In the future it may be usefull to hide the interaction with heimdall from the user all together, however at this stage it is very alpha may contain loads of errors, so I found it usefull for the user to verify the command before executing it.

The source is available at github.com/zpon/gheimdall (cant post regular links :/)
[Galaxy S I9000 Android Development] ashwinds:
Good luck and do share your results... i am eagerly waiting to get rid of ODIN and the boot into windows every time i want to flash.
[Galaxy S I9000 Android Development] sztupy:
Isn't repartition nothing but flashing the pit file to /dev/block/bml2 and possibly reseting the wear level data on the other block devices?
[Galaxy S I9000 Android Development] Benjamin Dobell:
Flashing the PIT file to the phone isn't a problem but anything beyond that requires the use of a different protocol.
[Galaxy S I9000 Android Development] ashwinds:
Mac OSX, Froyo, vmware and odin

Just came to post that Odin now works on vmware fusion. Maybe after the JPA flash - not sure. Will now try Heimdall.. anyone has an OSX binary? Or is compile from source the only option?
[Galaxy S I9000 Android Development] TubeShaped:
Odin works on Vmware Fusion? really?
[Galaxy S I9000 Android Development] ashwinds:
Yes it does!
[Galaxy S I9000 Android Development] Benjamin Dobell:
Yes Heimdall now works on OS X? That's excellent news.

Would you mind sharing what firmware your secondary bootloader is from as I would like to relay this information on the Heimdall download page.
[Galaxy S I9000 Android Development] ashwinds:
Benjamin - I havent tried Heimdall yet - is there an OSX binary? If not, I will try to compile and try it soon. But the device is recognized in Odin now. LEads me to believe, it will be recognized in Heimdall too.
[Galaxy S I9000 Android Development] Benjamin Dobell:
Sorry there's not a OS X binary. The OS X binaries that I've been compiling myself aren't statically linked so they're not suitable for redistribution. If someone is able to verify Heimdall is working correctly with new firmware then I'll definitely release a OS X binary in the next couple of days.
[Galaxy S I9000 Android Development] ashwinds:
Sure - I will give it a shot soon as I have the pre-requisites xcode, macports etc installed ... perhaps tomorrow.
[Galaxy S I9000 Android Development] Benjamin Dobell:
To save you downloading it, xcode is not required. Just the GNU build tools (in particular GCC and make) which can be grabbed from macports.

EDIT: Don't forget libusb-1.0 version 1.0.8.
[Galaxy S I9000 Android Development] ashwinds:
macports refuses to install without xcode ... Heck... let me try now :)
[Galaxy S I9000 Android Development] ashwinds:
Following the guide here

Installed all the pre-requisites. libusb compiled just fine. Now after ./autogen.sh (which went fine) and ./configure, I get the error:

sh-3.2# ./configure

./configure: line 1935: syntax error near unexpected token `DEPS,'

./configure: line 1935: `PKG_CHECK_MODULES(DEPS, libusb-1.0 >= 1.0.8)'

I have copied libusb folder from the compiled libusb 1.08 to Heimdall src directory. pkgconfig was installed from macports. I wonder if I have to set path environment somewhere in Mac... can anyone help?

Update: Figured it out - basically had to copy the entire libusb source directory into Heimdall Source instead of just libusb directory within it. Now trying to get Heimdall going...

Update 2: way too confused - ignore me for a while :D
[Galaxy S I9000 Android Development] ashwinds:
Update 3: got heimdall to compile. But the flash fails. I do see the device in system profiler on Mac OSX though:

Gadget Serial:

Product ID:	0x6601

Vendor ID:	0x04e8 (Samsung Electronics Co., Ltd.)

Version:	2.1b

Speed:	Up to 480 Mb/sec

Manufacturer:	SAMSUNG

Location ID:	0x26200000

Current Available (mA):	500

Current Required (mA):	50

Also, heimdall --verbose reports:

length: 18

device class: 2

S/N: 0

VID:PID: 04E8:6601

bcdDevice: 021B

iMan:iProd:iSer: 1:2:0

nb confs: 1

interface[0].altsetting[0]: num endpoints = 1

Class.SubClass.Protocol: 02.02.01

endpoint[0].address: 83

max packet size: 0010

polling interval: 09

interface[1].altsetting[0]: num endpoints = 2

Class.SubClass.Protocol: 0A.00.00

endpoint[0].address: 81

max packet size: 0200

polling interval: 00

endpoint[1].address: 02

max packet size: 0200

polling interval: 00

Failed!

Claiming interface...

Any suggestions? Do you think heimdall is not hooking up to libusb to claim the device? Sorry if I am way off target - I am way out of my depth here :)
[Galaxy S I9000 Android Development] Benjamin Dobell:
Okay that's great news. The issue now is simple to resolve, I just need to write a codeless kext so that Heimdall is able to claim the interface from the kernel. I'll put together a OS X binary with the kext included.
[Galaxy S I9000 Android Development] ashwinds:
Awesome - thats good to hear. Do let me know if you need help testing it.
[Galaxy S I9000 Android Development] Benjamin Dobell:
I've just uploaded some OS X binaries to the usual place. I statically linked heimdall with libusb-1.0 so hopefully it just runs! As I don't own a copy of a working Sbl.bin I'm unable to test out the codeless kext but hopefully everything is all peachy.

Let me know :)
[Galaxy S I9000 Android Development] Benjamin Dobell:
Fantastic!

ashwinds, thank-you very much for doing all that testing!
[Galaxy S I9000 Android Development] ashwinds:
Sir - it was a pleasure - thanks for your code which made the Testing... "Uneventful".

I will flash a whole ROM sometime today and let you know if I run into anything, but I believe rest of the code has been tested fully and dont expect issues there :)

Update: Flashed a Full JPM ROM to test this completely. No issues whatsoever.

Macintosh:JPM_JPM_U_JPM ashwind$ heimdall flash --pit s1_odin_20100512.pit --factoryfs factoryfs.rfs --cache cache.rfs --param param.lfs --kernel zImage --modem modem.bin

Heimdall, Copyright (c) 2010, Benjamin Dobell, Glass Echidna

http://www.glassechidna.com.au

This software is provided free of charge. Copying and redistribution is

encouraged.

If you appreciate this software and you would like to support future

development please consider donating:

http://www.glassechidna.com.au/donate/

Claiming interface... Success

Setting up interface... Success

Beginning session...

Handshaking with Loke... Success

Downloading device's PIT file...

PIT file download sucessful

Uploading factory filesytem

Factory filesytem upload successful

Uploading cache

Cache upload successful

Uploading param.lfs

param.lfs upload successful

Uploading kernel

Kernel upload successful

Uploading modem

Modem upload successful

Ending session...

Rebooting device...

Guess we are all done here :)

SUGGESTIONS:

1) Mac doesn't beep or show anything when a device is recognized - so its a nervy moment before the flash commences. Can we have a switch (like heimdall --status) which will show diagnostics alone - i.e. connected, identified, ready-to-flash status? Should be able to run it without any parameters to just see if the device is "flashable".

2) Non verbose mode is ... too silent. Can we have some basic progress indicators .. even .... would suffice to know that the flash is in fact in progress?
[Galaxy S I9000 Android Development] Benjamin Dobell:
I might add a "--detect" option, however for now you can use:

heimdall close-pc-screen --verbose

"close-pc-screen" just connects to your phone in download mode and reboots it. So if you use it in conjunction with --verbose it will be reasonably informative.

I'll see what I can do. I still do intend to create a user interface, which will include a progress bar and what-not.
[Galaxy S I9000 Android Development] ashwinds:
Well, even if the UI is coming, it'd be nice to have it on the command line. Thanks again - really appreciate your work.

Is there a to-do for Heimdall? Repartition perhaps? Would it work if my present fs is ext4?
[Galaxy S I9000 Android Development] huxflux2003:
Do you think that Heimdall could work within a VirtualBox vm? I am having troubles getting the guest see the usb device.
[Galaxy S I9000 Android Development] Benjamin Dobell:
I'm not quite sure how the partitioning works yet. I know how to transfer the PIT file to the phone. However, after a flash the phone reboots into recovery mode and Odin/Kies send some more data/instructions using a different protocol, so I'm not sure how much control we'll have over the repartitioning process.

I'm not quite sure what you mean. Heimdall runs natively on Windows, OS X and Linux so there should be no need for a virtual machine.

What OS are you trying to run it on? If your using OS X and it's not working it's because you're not using the fixed secondary bootloader provided by Samsung. Unfortunately that means you first have to flash the fixed secondary bootloader via Linux or Windows.

EDIT: If you're running a Linux or Windows virtual machine with OS X as the host operating system and you're not using the updated secondary bootloader then it still won't work. This is because virtual machines still rely on the USB functionality of the host operating system.
[Galaxy S I9000 Android Development] huxflux2003:
I am on a Windows host with a linux guest, where I compile the kernel and I was wondering if I can use the guest to run heimdall and flash directly from there, instead of transfering the zImage to the host (windows) and use Odin or Heimdall from there. But I seem to have some problems with the USB support of VirtualBox.
[Galaxy S I9000 Android Development] Benjamin Dobell:
My guess is that VirtualBox isn't properly making the USB connection available to the Linux guest. I'm not sure how VirtualBox works but perhaps the Windows Galaxy S drivers are causing issues. It might be worth giving it a go with the Windows drivers uninstalled.

If you do get the device recognised there might still be issues however. Heimdall makes use of libusb and there is a weird bug report in regards to virtual machines on the libusb trac, http://www.libusb.org/ticket/69.
[Galaxy S I9000 Android Development] tkienzle:
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for DEPS... configure: error: Package requirements (libusb-1.0 >= 1.0.8) were not met:

Requested 'libusb-1.0 >= 1.0.8' but version of libusb-1.0 is 1.0.6

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables DEPS_CFLAGS
and DEPS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Hello just found out about heimdall and i've been working on it i install the libusb-1.0.8 manual and that seems to have go worked without a hitch now it keeps giving me this error/problem is there anything i can do. thanks...
[Galaxy S I9000 Android Development] Benjamin Dobell:
That's been asked a couple of times actually. I might stick up a FAQ somewhere. Anyway it appears libusb-1.0 1.0.8 isn't installed properly. If you can't get it to install try the following:

Make sure you have libtool installed. Edit configure.ac, replace the line:

PKG_CHECK_MODULES([DEPS], [libusb-1.0 >= 1.0.8])

with:

PKG_CHECK_MODULES([DEPS], [libusb-1.0 >= 1.0.6])

then run:

./autogen.sh

before running ./configure, make, sudo make install as usual.

The requirement is by default 1.0.8 as that's what version I've performed all the testing with. However numerous Linux users have reported 1.0.6 works fine.