yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] jscurtu:
Ohh, well thats right, it could work if you create a udev rule.. it could look like this:

#Galaxy S
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="04e8", SYSFS{idProduct}=="6601", ACTION=="add" MODE="0666"

Open a editor with su rights, like gksu gedit, then copy and past that from obove ..

Save it under /etc/udev/rules.d as 70-heimdall-galaxys.rules

Restart udev with: sudo service udev reload

Tell me if it worked :-)
[Galaxy S I9000 Android Development] mali100:
Doesn't work :(

I tried

SUBSYSTEM=="usb_device", SYSFS{idVendor}=="04e8", SYSFS{idProduct}=="6601", ACTION=="add", MODE="0666"

and

SUBSYSTEM=="usb_device", SYSFS{idVendor}=="04e8", SYSFS{idProduct}=="6601", ACTION=="add", MODE="0666", GROUP="users"

but I always get a Permission denied from libusb

Edit:

with this rule I'm able to flash without sudo

SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", SYSFS{idProduct}=="6601", MODE="0666", GROUP="plugdev"

But the first time I tried I got an error:

Claiming interface... Failed. Attempting to detach driver...

Claiming interface again... Success

Setting up interface... Success

Beginning session...

Handshaking with Loke... Success

Downloading device's PIT file...

PIT file download sucessful

Uploading kernel

Failed to send file part packet!

Kernel upload failed!

Re-attaching kernel driver...

Don't know if this is related or if it is my crappy front-USB

Thanks to jscurtu for his help and to Benjamin Dobell for this great App!
[Galaxy S I9000 Android Development] Benjamin Dobell:
What type of USB port is this, is it USB 1.1/Full-Speed or 2.0/High-Speed? That error might be related to using a Full-Speed or Low-Speed USB port as it failed on the first bulk transfer.

PS. I'm the maker of Heimdall.
[Galaxy S I9000 Android Development] mali100:
That could be the reason, as the SGS was connected to an internal Card-Reader with an USB-HUB.

Thank you, sorry for confusing that!
[Galaxy S I9000 Android Development] gnac:
So I'm having a similar problem. I have been able to successfully use a previous verions of heimdal before, but with 1.0 I'm getting:

Claiming interface... Failed. Attempting to detach driver...
Claiming interface again... Success
Failed!
Setting up interface...Re-attaching kernel driver...

And then after that, just

Claiming interface... Success
Failed!
Setting up interface...
[Galaxy S I9000 Android Development] Benjamin Dobell:
Did you get the version you're using from my website (the Glass Echidna website) or did you get it from somewhere else? Because I haven't changed anything related to claiming the interface. Also that seems odd that it says Success then Failed! Rather than just saying Failed! printing both results could be a bug, I'm not home at the moment so I can't check.

But yeah that seems a bit odd. What phone model are you using? Also what it the product ID of your phone when it is in download mode? It should be 6601.
[Galaxy S I9000 Android Development] jscurtu:
I created ubuntu packages which includes udev rules for flashing without using sudo.. Benjamin, will this be officialy supported? Or will this be something distributors will have to patch?

-Jason
[Galaxy S I9000 Android Development] Benjamin Dobell:
Yeah I just had a look at the source and that output log that you've posted isn't possible. Make sure you're running an official release, perhaps try download the source code directly and compile it yourself.

Let me know how you go. Also if you were using a version that you got from a third party and the version from my website works then it might be worth letting them know that their release is broken.
[Galaxy S I9000 Android Development] Benjamin Dobell:
I might as well support it, should make it easier for everyone involved. I'll include it in the 1.1 release.
[Galaxy S I9000 Android Development] gnac:
Yep, got the source from the Glass Echidna website yesterday. Built it with no problems.

I am using however a Samsung Captivate. Currently has the Cognition 2.2beta5.5 rom on it.

I don't see a product id when in download mode. Just the yellow android working sign and text that says not to turn off the target. Perhaps I am getting into download mode incorrectly. When phone is off, I am holding down both volume keys as I plug in the USB.
[Galaxy S I9000 Android Development] Benjamin Dobell:
On Linux you can retrieve the download mode product ID by typing "lsusb" in terminal when your device is connected (and in download mode). However Heimdall should work fine with your Captivate.

Ah I think I just realised how you got that output. It's a bit jumbled up because I was printing to stdout for positive/normal results but stderr when things go wrong. I meant to change that but clearly forgot. So it looks like it's failing at "Setting up interface". I'll add better error reporting in the next release but if you want help before then, insert the following line after line 272 of BridgeManager.cpp:

printf("ERROR CODE: %i\n", result);

So the whole if statement will look like:

if (result != LIBUSB_SUCCESS)
{
fprintf(stderr, " Failed!\n");
printf("ERROR CODE: %i\n", result);
return (false);
}

then recompile, run Heimdall and post the new output.
[Galaxy S I9000 Android Development] gnac:
output of lsusb appears to verify device id is 6601 :

Bus 001 Device 047: ID 04e8:6601 Samsung Electronics Co., Ltd Z100 Mobile Phone

adding the lines to BridgeManager.cpp now gives me the following output:

Claiming interface... Failed. Attempting to detach driver...
Claiming interface again... Success
Failed!
Setting up interface...ERROR CODE: -99
Re-attaching kernel driver...

subsequent attempts give me

Claiming interface... Success
Failed!
Setting up interface...ERROR CODE: -99
[Galaxy S I9000 Android Development] eep2378:
where are the readme files for mac??
[Galaxy S I9000 Android Development] dgovil:
Hi Guys,

I just had a question that I couldn't see an obvious answer to, so forgive the question.

I'm on a Bell I9000M Vibrant running PDA: JP6., Modem:JPM and CSC: JP4. Build is 2010.10.

I'm planning to install CM6 Beta 1 on it, and one of the steps is:

Flash initial kernel "CM-GalaxyS-Kernel-initial.tar" as PDA via odin (no pit, no repartition).

What command would I put in the terminal to flash just that, without flashing modem and without repartitioning?

I guess it would be

heimdall flash --kernel CM-GalaxyS-Kernel-initial.tar

Is that it? Or would I need something else?

Thank you very much!

Edit: Also, I should say, I tried looking at the help files but heimdall help in terminal says heimdall doesn't exist?
[Galaxy S I9000 Android Development] Benjamin Dobell:
It's included with the Mac binaries on the official download page. The even if you want to compile from source on Mac you should download the binary release as it contains a codeless kext that needs to be installed.

Heimdall doesn't flash archives, it flashes individual files. So if you extract that tar inside will be the kernel file (probably called zImage). Then you can flash like so:

How did you install Heimdall? If "heimdall help" isn't working then heimdall has been installed to a location that isn't in your PATH.

What version of libusb-1.0 is installed on your system? Because that error is very weird, it corresponds to LIBUSB_ERROR_OTHER. I just had a look through the libusb source and that's an unusual internal error. To get more information I need output from libusb itself.

To do that, after line 113 (again in BridgeManager.cpp):

Add line:

Then also run Heimdall again as usual, but also include the --verbose flag. The combination of verbose output from Heimdall and debug output from libusb should let me know what's going on. All I can think is that for some reason your device doesn't have any "usb interfaces", which is very odd. --verbose will list that info however.
[Galaxy S I9000 Android Development] gnac:
I have libusb-1.0.8 installed. It also appears that I have a libusb-0.1.12-r5 installed. but the header file mentioned below is associated with 1.0.8.

I did that, but I get an error

source/BridgeManager.cpp: In member function ‘bool Heimdall::BridgeManager::Initialise()’:
source/BridgeManager.cpp:114: error: invalid use of incomplete type ‘struct libusb_context’
/usr/include/libusb-1.0/libusb.h:542: error: forward declaration of ‘struct libusb_context’

It appears that libusb_context is declared as a simple struct (In BridgeManager.h), and the file at /usr/include/libusb-1.0/libusb.h only defines it as a typedef. libusb10.h (found on the intertubes) has a complete definition including the debug attribute, but I can't find it on my system.
[Galaxy S I9000 Android Development] gnac:
It appears I may just have a bad usb hub. I had been using the USB connections on the front of my pc, and they have always been flakey with the Captivate, i.e. adb can't always detect the device, or it detects it one moment, and then loses it. I tried plugging into a usb port on the back of the pc, and unmodified heimdall ran/worked fine.
[Galaxy S I9000 Android Development] Benjamin Dobell:
Based on the type of error you were getting I'd say that's almost definitely the case.
[Galaxy S I9000 Android Development] dgovil:
Ah, I'll open up the .tar.

And I'm following the instructions in the tar (which off memory) include navigating to the folder with Heimdall and invoking sudo ./install.sh

In this picture I've already previously invoked sudo so it didn't ask for the password, but here's what I'm getting.

If it helps any, I'm on a 2008 Macbook Pro with a Core 2 Duo with Mac OS X 10.6.5

Thanks for the assistance. Otherwise, I'll wait for the next CM6 fix and Boot Camp Windows for a day.
[Galaxy S I9000 Android Development] zurchpet:
heimdall

not

Heimdall
[Galaxy S I9000 Android Development] dgovil:
Still doing the same. Sorry, I was just trying capitalization in this one to see if maybe it was case sensitive, but either way no luck.

I think it maybe the chmod error. I'll try again by creating a folder for heimdall in bin and see if that fixes it.

No luck, I can get to usr/local and there is a bin file there, but I don't know what it does and I can't create a folder there with that name. I'll look into it, but if anyone has any ideas I'd be grateful. I really hate installing Windows.
[Galaxy S I9000 Android Development] zurchpet:
I remember that I've moved the heimdall executable to ~/bin (which I added to my PATH in ~/.profile) since then I can enter the heimdall command from everywhere in the Terminal.

Using OS X 10.6.5 here. You can contact me via PM if you need more assistance.

And don't forget. You MUST update the bootloader and secondary bootloader for OS X to recognize your Galaxy S in download mode.
[Galaxy S I9000 Android Development] dgovil:
Sweet. Moving it to /bin made it work. Just going to try a flash in a bit and see if it works.

Hopefully I have a good bootloader

EDIT: That was relatively painless and a hell of a lot faster than flashing with Odin
[Galaxy S I9000 Android Development] zurchpet:
if you don't, you have to flash (for the last time ever ;-)) with Odin on Windows JPJPA (http://www.multiupload.com/U8BRA0UTZH). complete with repartition.

You'll lose any data, but it contains the corrected bootloader and secondary bootloader that works on Mac.

Then you can flash any ROM you like with Heimdall/Clockwork Recovery/Odin as you want. The most ROMs (especially the custom ROMs) don't contain bootloader and secondary bootloader, so the new corrected one will never be overwritten.
[Galaxy S I9000 Android Development] CamonZ:
awesome

it's really cool you're doing this. Would you post some docs on how the sgs communication protocol works??
[Galaxy S I9000 Android Development] mike.sw:
Hmm, First try didn't go so well:

C:\Users\michaels\Desktop\heimdall-alpha-1>flash.bat

C:\Users\michaels\Desktop\heimdall-alpha-1>Heimdall -pit s1_odin_20100512.pit -factoryfs factoryfs.rfs -cache cache.rfs -dbdata dbdata.rfs -boot boot.bin -sbl Sbl.bin -param param.lfs -kernel zImage -modem modem.bin
Product: "Gadget Serial"
Serial No: "?"

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

Claiming interface... Success
Setting up interface... Success
Handshaking with Loke... Success
Downloading device's PIT file...
PIT file download sucessful
Uploading factoryfs...
Failed to send file part packet!
Failed to upload factoryfs!

Turning back on the device gives me the exclamation sign.

Going to flash back with odin now ;)

EDIT:

I want to clarify that I think the problem was with the PC I did the process on.

After I bricked it and went to restore with odin, it just got stuck in the "do not power off target" step.

Just came home and flashed it on my home PC with odin, everything is back to normal.

Probably some USB drivers issues?

Anyway, I think I will try Heimdall again tomorrow on my laptop. Don't want to mess up drivers on the only PC that odin works property in case of another emergency ;)
[Galaxy S I9000 Android Development] Benjamin Dobell:
Thanks for testing, it's immensely helpful. I personally had never had problems at that exact step but this is why testing on other PC's is required. The exclamation mark is a sort of recovery mode that happens when a flash fails. It's not really bricking as the phone can still be flashed but clearly not the desired outcome.

Your PC and phone seemed to be talking fine as in order to handshake and download the device's PIT file data needs to be transferred in both directions multiple times. The things that seems to be significant about that error is that it failed on the first file part packet, which is the first packet of 131072 bytes. All the previous packets were 1024 bytes or less.

In saying that in one USB Packet; I'll make a distinction between Heimdall packets and USB Packets, you can't actually transfer more than 512 bytes in one go, which is what your USB driver has output.

endpoint[0].address: 81
max packet size: 0200
polling interval: 00
endpoint[1].address: 02
max packet size: 0200
polling interval: 00

However the Heimdall packets are meant to be automatically split up into these smaller packets when being transmitted. Perhaps 131072 bytes was still too large for your system.

I'll make an update that spits out the exact error code that the driver is giving.

What version of Windows were your running at the time?
[Galaxy S I9000 Android Development] Benjamin Dobell:
I might if there is enough interest. However the source code is nicely laid out C++ which should be reasonably easy to follow for anyone whom is interested.

EDIT: Also thank you very much to the couple of people who have donated. It's always good to know that people are supportive of my work. On a related note the Glass Echidna website was playing up slightly in how it handles donations. The donations works fined but the donor wall (if you opted to be displayed) wasn't working. If you donated or donate in the future and you want to be displayed (and aren't) let me know.
[Galaxy S I9000 Android Development] insty:
If you ever need a test phone in Melbourne feel free to pm.

Essendon if you're close.
[Galaxy S I9000 Android Development] Benjamin Dobell:
Thanks for the offer, unfortunately I'm on the other side of the city (Pakenham). However if you've got a Windows installation anywhere and you would like to give it a go please do.
[Galaxy S I9000 Android Development] insty:
Definitely a bit of a distance then. Have to re-flash this afternoon so will let you know how it goes.
[Galaxy S I9000 Android Development] Benjamin Dobell:
I uploaded alpha 2 which just contains some minor updates. In particular the exact error if a packet fails to be sent or received. However I also fixed up the README slightly and changed the name of the driver from "Galaxy S Flash Driver" to "Heimdall Galaxy S Driver".
[Galaxy S I9000 Android Development] mike.sw:
Hey Benjamin,

Thanks for the in depth expansion for the process, I learn a lot.

OS was 7 x86 ent.
[Galaxy S I9000 Android Development] insty:
"Windows encountered a problem installing the driver software for your device".

Won't let me get past that.
[Galaxy S I9000 Android Development] Benjamin Dobell:
What version of windows and what type of Galaxy S is your phone?

Also would you mind pasting the hardware IDs for your device. They can be found in the Details tab of the Samsung composite driver.
[Galaxy S I9000 Android Development] insty:
Windows 7 32bit.

Phone: Optus Galaxy S. Has the 3 button mode.

Hardware ID:

USB\VID_04E8&PID_681C&REV_0400

USB\VID_04E8&PID_681C
[Galaxy S I9000 Android Development] Benjamin Dobell:
Well I guess now we know there is officially at least one minor difference between the international and Australian phone. Try the .inf file in the attached archive instead of "Drivers/libusb.inf".

EDIT: Actually that will only work to install the drivers. Heimdall won't be able to detect your phone. I'll add another update.
[Galaxy S I9000 Android Development] Benjamin Dobell:
I have updated the first post with alpha 3 as well as details on how the community can help out with hardware IDs of Galaxy S devices.

Alpha 3 should now recognise international and Australian (Optus) phones.
[Galaxy S I9000 Android Development] ikenley:
Is it at all possible to flash a firmware without loosing all the phones settings and apps?
[Galaxy S I9000 Android Development] Benjamin Dobell:
Using just the protocol provided by Loke, no not that I'm aware of. Although if someone were to write a custom secondary boot loader it would be possible. It could also be done in two steps using an app with root permissions by first transfering the data to PC. Once I get my hands on a working Galaxy S again I will look into it though.
[Galaxy S I9000 Android Development] Benjamin Dobell:
Updated the first post with alpha 4 and a list of recognised devices.

Unfortunately I found out today that I have to send my phone back to the United Kingdom to get it repaired so I won't be able to test anything myself for at least a week. So if anyone would like to test and report back here please do so.
[Galaxy S I9000 Android Development] mike.sw:
I would like to help you keep testing this thing. However I need to backup my current setup. I guess I should use Clockwork?
[Galaxy S I9000 Android Development] nandihno:
ok so any ETA for Mac OS?

was looking at the readme.txt and so my question is..

what is the process?

1) put the pone in download mode...

2) you update the drivers...

3) u reboot the machine

4) (the phone is it still in download mode??)

4) you then download the rom and 512 pit and open up to get the 3 tars... put them in the same directory.

5) then run flash.bat

is that it??
[Galaxy S I9000 Android Development] Benjamin Dobell:
Yeah Clockwork mod should work nicely. Heimdall won't touch the sdcard so anything stored there, Clockwork backups, music, documents etc. shouldn't be lost. I regularly try backup everything important on PC as well (not just when flashing). I can't check with a working Galaxy S but I think you can copy whole Clockwork backups onto your PC.
[Galaxy S I9000 Android Development] dgovil:
Thank god I had the right bootloader :-)

I was about to pull out the windows disc and sit through that godawful install.

Out of curiosity, is the correct bootloader needed for heimdall under linux? If I had the wrong one, hypothetically, would a liveCD work?
[Galaxy S I9000 Android Development] zurchpet:
I dont't know. Never tried. It might work.
[Galaxy S I9000 Android Development] dirk1978:
You could just use a live CD with the older bootloader yes.
[Galaxy S I9000 Android Development] Dan_Brutal:
Does this softwere work with a ppc mac running os x 10.5? And if so, please, I need a how-to on the install.
[Galaxy S I9000 Android Development] Benjamin Dobell:
The corrected bootloader is only required for OS X. Heimdall should work fine on Windows and Linux regardless of what bootloader is installed.

Theoretically yes. I've added code to account for the big endianness of PPC. You will have to compile from source though and after running ./configure you will need to ensure that PPC is defined. To do that just open config.h and add the following line:

Then continue to compile as usual.
[Galaxy S I9000 Android Development] mcord11758:
I apologize as I realize my questions will be very newbish for this thread. I have a samsung captivate. currently I have no issues and I am running a custom Rom. I am a Mac owner and this appears to be my only way to flash stock software. I read the read me in the download package but have to admit it is still over my head. it says to open a terminal ad navigate to the intall.sh what commands would I use to do so? for example? Where would i find the pit and tar files for my device in order to install them?

from reading this tread I can see that those who post here know allot more then I do. If you can advise it would be appreciated. if not i understand as well.
[Galaxy S I9000 Android Development] luismanson:
no auto reboot maybe?
[Galaxy S I9000 Android Development] zurchpet:
@mcord11758

You can PM me and we'll walk trough, to get heimdall running on your Mac.
[Galaxy S I9000 Android Development] Benjamin Dobell:
Just thought I'd drop in and let everyone know that I've basically finished the Heimdall 1.1 update which includes Heimdall Frontend.

I've tried to make the user interface simplistic for Odin users. Here's a quick peek:

NOTE: "Download Firmware" is not available in this release, it requires Gjallarhorn which is still in the very early stages of development.

Heimdall 1.1 Changes:

- The inclusion of an optional user interface, Heimdall Frontend.

- Galaxy Tab support.

- Simplified driver install mechanism for Windows (zadig.exe).

- Better flashing progress feedback for non-verbose mode.

- Repartitioning

- Removed the PIT file requirement when not repartitioning.

- Fixed the flashing progress bar on the phone/tab itself.

- Added the ability to flash the EFS, recovery partition and the backup copy of the secondary bootloader. It is intentional that only the recovery partition is available from Heimdall Frontend.

Heimdall Frontend (and Heimdall itself) try to take care of some common flashing mistakes, i.e. Repartitioning but not including all the necessary replacement files. Heimdall Frontend also checks file extensions to try and stop people accidentally flashing archives instead of files.

I still need to setup the Linux and OS X distributions so they won't be available for at least a few hours. I'm not particularly familiar with building Linux packages. Someone suggested to me via e-mail (which I really should respond to) that I build by OpenSUSE build system. However the Qt library is huge and takes about 4 hours to build so I don't think that is going to work in this instance.

Assuming I'm using Ubuntu what's the best way to create packages that will target as many Linux distributions as possible?
[Galaxy S I9000 Android Development] frandromeda:
My advice: crowd-source. I'd be happy to create rpms for RHEL5_i686, RHEL5_x86_64, and openSuSE_11.2_x86_64. (I can probably cross compile for 32 bit too...) I'm sure there are others on this thread/forum that will happily create packages for various other linux distros.
[Galaxy S I9000 Android Development] BigArea:
+1 for frandromeda's advice. Rpm and debian packages should cover most of those who are incapable of compiling this themselves.

That said... Ill throw in a pkgbuild for archlinux. Where's the code?
[Galaxy S I9000 Android Development] BigArea:
Also, i cant seem to find a heimdall flashable version of the stock rom...does one exist or is it even possible to make one?
[Galaxy S I9000 Android Development] razze76:
All roms for Odin are flashable with Heimdall as well, you just need to extract the files.