[Galaxy S I9000 Android Development] dirk1978:
The Odin files are just tar files of the various sections to flash. If you untar a firmware distributed for Odin you'll see stuff like:

tar xvf JP6_JP4_U_JPM.tar
factoryfs.rfs
modem.bin
param.lfs
zImage
cache.rfs

So just pass each one of what you have as an argument to Heimdall like so:

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

I've always used the 512 pit so I'm sticking with that. Benjamin said Heimdall doesn't yet support repartitioning so it's better to stick with the pit you normally use.

If you want to root it while flashing a new firmware then just copy the rooted kernel from Chainfire's CF-root etc. over the top of the included kernel and flash that instead

unzip CF-Root-JP6-v1.2-Busybox-1.17.1.zip
Archive: CF-Root-JP6-v1.2-Busybox-1.17.1.zip
inflating: CF-Root-JP6-v1.2-Busybox-1.17.1.tar

tar xvf CF-Root-JP6-v1.2-Busybox-1.17.1.tar
zImage

Or if you'd prefer to root it afterwards just flash the kernel only.

heimdall flash --pit ../s1_odin_20100512.pit --kernel zImage

Heimdall, Copyright (c) 2010, Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au

This is 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... 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
Kernel upload successful
Ending session...
Rebooting device...
Re-attaching kernel driver...

The recent releases have all just been a single tar file, but the older ones did have some duplicated files, namely dbdata.rfs and cache.rfs which are present in both the code (PDA) and the CSC. I'd assume you need to keep the versions in the CSC as these are region-specific - they are different:

md5sum CODE/cache.rfs CSC/cache.rfs
3ce87199ea95a1c105228420f7743958 CODE/cache.rfs
9b564f8fc28a31e5054ee5bb14deb921 CSC/cache.rfs
md5sum CODE/dbdata.rfs CSC/dbdata.rfs
6667f4a83974c25d11e88fbb5206c6d5 CODE/dbdata.rfs
41ade5efb0b1b13d7816d41ed5234b42 CSC/dbdata.rfs

In fact, after mounting the 2 caches, the one from the CODE is empty:

mount -oloop -tvfat CODE/cache.rfs /mnt/
ls /mnt/
<empty>

But the CSC has lots:

mount -oloop -tvfat CSC/cache.rfs /mnt/
ls /mnt/recovery/
command sec_csc.zip
unzip sec_csc.zip
Archive: sec_csc.zip
creating: META-INF/
inflating: META-INF/MANIFEST.MF
creating: system/
inflating: system/CSCVersion.txt
creating: system/csc/
inflating: system/csc/feature.xml
inflating: system/csc/sales_code.dat
creating: system/csc/XEU/
creating: system/csc/XEU/system/
inflating: system/csc/XEU/system/CSCVersion.txt
creating: system/csc/XEU/system/csc/
inflating: system/csc/XEU/system/csc/feature.xml
inflating: system/csc/XEU/system/csc/sales_code.dat
inflating: system/csc/XEU/system/csc/contents.db
inflating: system/csc/XEU/system/csc/customer.xml
...

It's the same story with dbdata, the code version is empty and the CSC has stuff in it:

mount -oloop -tvfat CODE/dbdata.rfs /mnt/
ls /mnt/
umount /mnt
mount -oloop -tvfat CSC/dbdata.rfs /mnt/
ls /mnt/
Samsung svox