yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] Benjamin Dobell:
I've uploaded Beta 2, as usual the link is in the first post of the thread.

Changes:

- Reorganised the code slightly (still some work to do).

- Added support for partial flashes (e.g. Flashing just the kernel).

- Added a --close-pc-screen option which makes a simple attempt to get rid of the screen displaying the "connect to PC" logo.

- New argument syntax.

Bug Fixes:

- Fixed Linux compilation issues (hopefully).

- Added "touch *" to configure.

Notes:

- I have added partial flash support which will allow you to chose exactly which files you want to flash. Fiddling with this too much isn't necessarily recommended however I did verify that a kernel only flash can be safely performed.

- The close pc screen functionality is mostly a developer thing. It is useful if for some reason a flash fails or is stopped after the Loke handshake but before any files have been transferred (mostly a developer thing).

- This release is still missing the visual studio projects but Windows binaries are included again.

I still haven't had a chance to actually compile and run Heimdall on Linux myself so hopefully this release works without the need to manually change something. I would have tested already but I can't find a Linux distribution around the house. I used to own handfuls of Ubuntu distributions but I have no idea what happened to them.

For those of you having trouble installing the drivers on Windows, I haven't had a chance to really look into it properly. At the moment all I can suggest is trying to uninstall Samsung's Composite Device Driver from Device Manager. Then click Action -> Scan for hardware changes from the menu bar. This will probably reinstall Samsung's drivers but you might be able to cancel it. Then try follow the instructions again:

Driver Installation Instructions

1. Put your Samsung Galaxy S into download mode by holding Volume Down + Home + Power.

2. Plug your phone into your PC.

3. Open up Device Manager on your PC (Control Panel -> System -> Device Manager).

4. Under Universal Serial Bus Controllers right click on the Samsung composite driver and chose Properties.

5. Go to the Driver tab and select Update Driver.

6. Chose to browse your computer for the driver.

7. Browse to the directory where you extracted Heimdall, select the Drivers folder press "Ok".

8. Click Next and follow follow the prompts, if you're asked to restart your PC then do so.

9. Done
[Galaxy S I9000 Android Development] pietro_spina:
Thanks for all the tips guys. :-D

Maybe it's a little early for this but what I was trying to do was get a read on what some of the problems people are going to have if they come here and compile their first program...

The OP mentioned no intention to package .deb or .rpm files so... will we be writing out a detailed how to? or maybe we as a community can maintain a collection of Linux binary for our favorite distros?

Ubuntu is about to release 10.10 but there will be plenty of people still on 10.4 for the early stages Benjamin's project. (so I expect at least a handful of people to have some issues like the one above) I would love for this to a well documented tool. (I'm always quite surprised to see how little explanation is around the Odin project.)

Ideally a well documented flashing tool will lead to more people taking control of their devices which might push the market toward providing devices that are intended to be controlled by their owners.

And yes this means I am offering some time to help with the documentation. Amateurish as it might be.

-p
[Galaxy S I9000 Android Development] pietro_spina:
RE: beta2

In Ubuntu 10.10rc Maverick

configure went fine

make exited with the following warnings (see below)

and I used 'checkinstall' instead of 'make install' and it built the .deb no problem.

make[1]: Nothing to be done for `install-data-am'.
make[1]: warning: Clock skew detected. Your build may be incomplete.
make[1]: Leaving directory `/home/pietro/HeimdallBeta2'
make: warning: Clock skew detected. Your build may be incomplete.
[Galaxy S I9000 Android Development] techmik67:
Finally got the drivers installed in windows7!! Same procedure, update diver, did not have to uninstall, but this time i did not get an error.

The error i got when flashing is "failed to open file factoryfs.rfs". Will try other packages.

edit: Tried to flash just a kernel this time, and it was a different one at that. Same error.

edit: this time i EXTRACTED the files from the tar for the kernel, rather than just putting the tar in place. Only attempted kernel. Error is "Failed to open file "boot.bin". Will attempt extracting all 3 tars into the directory and try again.

edit: same error.... Failed to open file "boot.bin"
[Galaxy S I9000 Android Development] Akrilee:
Before I forget it. Is it really necessary to use libusb-1.0.8? I didn't try to patch the code to 1.0.6 and test it. It's a bit inconvenient, because even the more or less bleeding distros are using libusb-1.0.6. How about adding it to the Heimdall sources and build it, in case it isn't already on the system? Something like that.

Ok, sorry you are right. The fact that you didn't figure out what these numbers are till now came to mind a few minutes after I wrote this rushed post.

Unfortunately, I don't really have experience with reversing (except playing around with buffer overflows), which I thought it would be a good start to try on Odin. But then, you already laid some major groundwork.

If you didn't, this would be the right time to change my bachelor thesis/internship to developing an odin alternative.

What tools do you use for reversing, or .. what material did you use to learn this rather specialized skill?

Front End developing :). I hated every single university course up until now, where I had to include a (simple) front end. Java Swing is a real *****. But then, you used C/C++, and I haven't tried wxWidget, which shouldn't give me too much of a headache because of its crossplatformyness (what a made up word).

And.. Git .. grrrrrr. We didn't get git to work for our last group assignment, so we switched back to svn (we had time pressure).

Guess, a java port would be the ultimate goal. Damn, I'm getting ideas where I need to have much more time on my hands than I can afford atm.
[Galaxy S I9000 Android Development] Benjamin Dobell:
You really aren't having the best luck. Kudos for persisting!

My guess is that the particular firmware you're trying to install doesn't come with boot.bin, sbl.bin and perhaps param.lfs. This is sometimes the case. What you'll have to do is run heimdall from command-line and pass the parameters manually (same as what Linux users have to do). Command line is usually foreign territory for most Windows users which is why I chose to include flash.bat, unfortunately it will only work under very specific conditions, i.e. all files must exist and the filenames must match.

Here's an example of using command prompt (in my case heimdall is installed to "H:\android\Heimdall Beta 2"):

This example will just flash the kernel, when you flash specify all the files included in the ROM you're trying to flash. In this example the pit file and each ROM file is required to be stored in H:\android\Heimdall Beta 2\bin\windows.

On Linux 1.0.6 might suffice, 1.0.8 is mentioned as the requirement because I know that version works. I've actually been compiling with the latest git checkout (not quite version 1.0.9 yet) as it's required for Windows compilation.

If you want to give it a try 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.

Keep in mind you do need the developer package to compile not just the libusb-1.0 binary package.

I didn't have any major experience with reverse engineering either. I've used projects that stemmed from reverse engineering but never really started a project myself. I used a usb sniffer to monitor Odin's communication. After starring at the 1s and 0s fly by I slowly started to piece things together. No real learning material required, just persistence.

The tool I used most was actually the trial version of USBlyzer for Windows. I used another one originally but it caused crashes. My trial has expired now and I was going to purchase a copy until I realised it was $200. Fat chance, I won't even be charging that much for my game engine, and that comes with source. Whilst the software was fantastic to use I was thinking something more along the lines of a $20 price tag.

Yeah, I personally hate interface development. Originally I thought every programmer did however I've recently encountered quite a few that prefer it over anything else... crazy ;)

I'm also new to git, I've only ever checked-out and certainly never setup a repository. However it is quite popular and I figure what better time to learn than now. Don't worry once I work it out I'll give you instructions, I also come from a SVN background.
[Galaxy S I9000 Android Development] techmik67:
"You really aren't having the best luck. Kudos for persisting!

My guess is that the particular firmware you're trying to install doesn't come with boot.bin, sbl.bin and perhaps param.lfs. This is sometimes the case. What you'll have to do is run heimdall from command-line and pass the parameters manually (same as what Linux users have to do). Command line is usually foreign territory for most Windows users which is why I chose to include flash.bat, unfortunately it will only work under very specific conditions, i.e. all files must exist and the filenames must match.

Here's an example of using command prompt (in my case heimdall is installed to "H:\android\Heimdall Beta 2"):

C:\ > H:

H:\ > cd "H:/android/Heimdall Beta 2/bin/windows"

H:\android\Heimdall Beta 2\bin\windows > heimdall

PIT file not specified

Usage:

heimdall --pit <file> [--factoryfs <file>] [--cache <file>] [--dbdata <file>]

[--boot <file>] [--secondary <file>] [--param <file>] [--kernel <file>]

[--modem <file>] [--delay <milliseconds>] [--verbose]

heimdall --close-pc-screen [--verbose]

H:\android\Heimdall Beta 2\bin\windows > heimdall --pit s1_odin_20100512.pit --kernel zImage
​

This example will just flash the kernel, when you flash specify all the files included in the ROM you're trying to flash. In this example the pit file and each ROM file is required to be stored in H:\android\Heimdall Beta 2\bin\windows."

[SIZE=+1]IT WORKED!!! Flashed from Cognition (Froyo mod), UCJI6. Followed your instructions EXACTLY, from the directory (/bin/windows). Only thing you didn't specify was milliseconds, so i used 10ms. I only pointed to the files i had. Excellent! I was just testing, so i flashed back to UCJF6 with your software. Will try other kernels too.... Congratulations!!

[/SIZE]
[Galaxy S I9000 Android Development] dzl:
just dealt with this. make sure you have the libusb1 and libusb1-devel packages installed. They are in the base repos.
[Galaxy S I9000 Android Development] rmorrisonva:
Question...

If I flash just the recovery using heimdall should it (in theory) leave everything else alone (ie. not wipe my device)?
[Galaxy S I9000 Android Development] Benjamin Dobell:
Yes, just flashing the recovery will leave everything else totally untouched.
[Galaxy S I9000 Android Development] Umeaboy:
Download-link to Heimdall on github isn't working anymore. I'm being redirected in Windows to my router's main setup-page.

Hmmmmmmmm. I clicked on the link to get the source & then the github-page for Heimdall worked. Weird.
[Galaxy S I9000 Android Development] || Acer ||:
Does this actually work on OS X? Everytime I try it, it never seems to work.

I have an epic 4g.
[Galaxy S I9000 Android Development] nmcc89:
The latest one works for me on OS X. I used to have problems, but since 1.3.0 it's been flashing fine. I'm using OS X 10.6.8 (the latest snow leopard) and I've got a GT-I9000
[Galaxy S I9000 Android Development] || Acer ||:
I'm using OS X 10.7.1 so I'm not sure if that would affect anything.

Have you been able to recover a soft bricked phone though?
[Galaxy S I9000 Android Development] nmcc89:
I've not used it to recover a soft brick but I have flashed kernels and a rom with it (I don't flash that often because I need the phone to be working)
[Galaxy S I9000 Android Development] jerome.d:
Probably a stupid question, but anyway...

When I flash a new firmware, I usually flash the stock one (all the files except "data.img" to avoid wiping my data), then boot up my phone. It is only after an initial boot that I go into download mode to flash the CF-Root kernel associated with the firmware.

I was wondering if I shouldn't rather, to spare some time, directly flash CF-Root kernel with the rest of the files coming from the firmware (i.e. I would take boot.img, Sbl.img, cache.img, etc. from the stock firmware but zImage from CF-Root and I would flash all these files at once).

Do you think it would create any issue? Should I boot up once with the complete unaltered stock kernel before flashing a CF-Root kernel, or is it safe to directly replace the zImage from the stock kernel with CF-Root's? I would say it's safe...
[Galaxy S I9000 Android Development] jerome.d:
I answer my own post: yes, it seems to work fine this way...
[Galaxy S I9000 Android Development] brfsa:
I love heimdall

Thank you very much for this software. IT's amazing.

I love it! I dont know why people still use ODIN.

Heimdall works so perfectly, nice and fast.

I flashed so many galaxies with heimdall from friends and coworkers.

here is a small tutorial I did for flashing Stock JVS then DarkyRom JVS beta.

http://www.darkyrom.com/community/i...97-darkyrom-jvs-base.5427/page-63#post-113399

Thank you very much for this amazing piece of software!
[Galaxy S I9000 Android Development] jakTomas:
ERROR

iam getting this error

ERROR: Failed to access device. libusb error: -12

y is that
[Galaxy S I9000 Android Development] jerdog:
Yeah I am getting the same thing on Windows 7 64
[Galaxy S I9000 Android Development] AdamOutler:
Install the new libusb drivers? The driver version changed.
[Galaxy S I9000 Android Development] jakTomas:
how can i do that ??
[Galaxy S I9000 Android Development] AdamOutler:
Single user report: Heimdall Close-PC-Screen formats SDCard on SGS-II based devices. This is simply a point of interest at this point. This report came from a user testing One-Click UnBrick on his SGS-II device in Download Mode. Possibilities: User-Error, Isolated Event, Detected as flashing a custom rom and formatted device.

And here's my own report after using Heimdall 1.3 for a while now...

Extremly Low priority Feature Request for Heimdall 1.4 suite: Add Notes section to "Create Package" for Heimdall Tar.GZ format/XML. A notes section would allow a developer to add in things like "Beta only, not for use on a production device", or "If errors are encountered after flashing, you must enter recovery mode by holding VOL+, VOL- and Power, then perform Factory Reset". This would reduce problems on the user end and make Heimdall more friendly and more appealing to use for developers.
[Galaxy S I9000 Android Development] cad_2011:
downloaded 1.3.0, installed on OSX Lion

put my SGS2 into download mode

start console and run "heimdall detect"

and have this error:

"Failed to detect compatible download-mode device"

any ideas?
[Galaxy S I9000 Android Development] beekay201:
Thank you, heimdall has worked flawlessly for me many times, just seen the thread thought it would be proper to say thanks for this great piece of code.

Dont even need X to recover my phone. Awesome.
[Galaxy S I9000 Android Development] Benjamin Dobell:
This used to happen with several second generation (Epic 4G, SGSII etc.) when user performed a non-flashing action (i.e. print PIT) and perhaps when a flash failed to go through (I'm not certain though). This has been fixed for non-flashing based actions. It's obviously not something Heimdall was telling the device to do, it would just occur if we didn't request a bit of device specific information after hand-shaking with the device. However, if this does happen if a flash fails then that's definitely not a good thing. Unfortunately I'm not sure there's a whole lot that can be done about it. Realistically the secondary bootloader should not even have that functionality built in!

This sounds like a good idea, I'll have to see if I can find some room for notes in the user interface.
[Galaxy S I9000 Android Development] Benjamin Dobell:
Some Galaxy S II devices shipped with a bad secondary bootloader that prevents the device being detected on OS X. Unfortunately the only solution is to update the bootloaders on the device using Linux or Windows. However as long as you never change the bootloaders again your device will then always be recognised in OS X. My signature contains a link to a thread with some more information and a list of firmware that works.

NOTE: A Linux or Windows virtual machine running inside OS X will also not work. You need to run the OS natively, bootcamp works fine.
[Galaxy S I9000 Android Development] cad_2011:
yup, found the hard way, created a bootcamp partition and rooted it successfully with CF-Root.
[Galaxy S I9000 Android Development] AdamOutler:
I'm having a problem... Im trying to create a Samsung Fascinate recovery package. This is a GalaxyS device with a MoviNAND. I don't know how to use a MoviNAND file. Its not specified in the PIT and heimdall detects two IBL+PBL on the Samsung Fascinate. Any suggestions on how to make this movinand file work with 1.3?
[Galaxy S I9000 Android Development] Benjamin Dobell:
Hmm, if the movinand not specified in the PIT file then it's unflashable by both Heimdall and Odin (as far as I know). Perhaps something weird is going on and you're seeing two IBL+PBL rather than one IBL+PBL and a movinand. If not then two identically named partitions could be a bit of a problem for Heimdall. Although in saying not there's nothing stopping you from modifying the the PIT file yourself.
[Galaxy S I9000 Android Development] Benjamin Dobell:
Heimdall 1.3.1 binaries are finally available. I'll update the product page and make a proper announcement on my blog tomorrow. For now you guys can get them a day early directly from Github.
[Galaxy S I9000 Android Development] AdamOutler:
I saw the same problem with MoviNAND and IBL+PBL initially on the Droid Charge... I didn't pay much attention to it because it was not branded SGS and I figured that it may have something going on which I didn't comprehend. However, now I'm sure that Odin can flash the MoviNAND, because it is part of the Odin Package.

Let me take a minute to break down the flashes... so everyone can follow.

The Processor/OneNAND are a Package-on-package chip. the OneNAND exists on top of the System-on-a-chip. The OneNAND is designed to be a system storage area. It contains bootloaders, kernel, system, dbdata and data partitions

Samsung came up with a great idea and partitioned the SDCard to extend out the data partition. Most SGS devices have the /Data/ partition on the internal SDCard. This makes things slower, but makes the partitions bigger. It was a hacky way to do it, but it worked.

Then Samsung came up with the MoviNAND. The MoviNAND works as a faster, more expensive alternative to SDCard storage. I'm not sure of its exact usage, but I believe it may contain "hidden" partition and MoviNAND partition.

MoviNAND is present on Droid Charge and Fascinate. These two devices have files in Odin which are not used by Heimdall. This does not hinder recovery or flashing of a device as these partitions are generated by the system automatically... Though, I'm not sure if they are actually linked over to the MoviNAND itself, or into the smaller OneNAND, or on the slower SDCard by the system...

It would appear that MoviNAND is a non-PIT related flashing device though and the dual IBL+PBL partitions exist on both of these devices, meaning there may be a separate bootloader to initialise the MoviNAND.

Hope this gives a better insight, even if inaccurate, to what's going on... I'm not totally sure of how the MoviNAND is used, or how to test if it's being used. I've never seen a stock device operating properly with a MoviNAND.

I will tell you that the Internal SDCard does not appear to exist on this Samsung Fascinate... It is not mountable... I'm not sure if it's just not present or not initialised properly.
[Galaxy S I9000 Android Development] SkOrPn:
Any pre-requisites? Or can I just install over the top of 1.3.0? Thanks again
[Galaxy S I9000 Android Development] Benjamin Dobell:
You should be good just to install over the top.
[Galaxy S I9000 Android Development] SkOrPn:
Yeah I found out it works just fine. Thanks...
[Galaxy S I9000 Android Development] Benjamin Dobell:
Adam, sorry I find those logs really difficult to read. Is there any chance you'd be able to use heimdall directly from command line on Windows and send me the command and the exact logs output via Heimdall as well as the exact steps you followed so I can try reproduce the problem (although I'd rather not brick my device ;)). I just need a minimum reproduction case so I can try sort out what is going on (so no Heimdall one-click etc.)

Also what device is this you're using?
[Galaxy S I9000 Android Development] Benjamin Dobell:
Thanks. Those logs looks like Heimdall was simply unable to communicate with your device, no flashing took place then as Heimdall couldn't connect. Typically those errors imply there's something wrong with the USB cable (or USB port). Although if you're flashing fine from Linux on the same machine then that doesn't make a whole lot of sense.

There's nothing really different in Linux and Windows versions of Heimdall that should cause something like that, at least not from Heimdall's own code. However the Windows version of libusb-1.0 is a lot more experimental than UNIX versions. I've never experienced any problems myself but perhaps this is some sort of libusb-1.0 error.

As stupid as it sounds I recommend rebooting your computer, phone and trying a different USB cable and/or port. Theoretically none of those things should fix the problem, and if they do it's somewhat concerning. But it's worth checking if this problem is 100% reproducible or just something a little bit dodgy.

I'll do some testing myself. I'll also try build another Heimdall binary for Windows with a newer version of libusb-1.0 and send it your way. Other than that I'm really not sure what would cause this problem on Windows and not Linux.
[Galaxy S I9000 Android Development] AdamOutler:
yeah... I've been testing all day.. it's a gaurantee that if you flash a PIT on windows, you're going to brick the device. 100% reproducable on Windows XP 32bit VM and a Windows7 64bit VM.

I think it must be a heimdall problem. Could you try to recompile and see if maybe there was an invalid keypress on windows compilation?

When my setup is to flash a modem only... it gets to Handshaking with Loke.... then it stops and heimdall exits. Something about the initialization does not work.

On the second time it's already been initialized and it works.

Every time you try to repartition, it will fail. the device will end up with a dead brick. It must be something about the initialization/handshake sequence and/or timing