So I had never problems with cooking something up, but in the Galaxy I faced .rfs files and a flashing tool I can't use on linux...
So I searched through some boards to find a way to extract the .rfs files here a working guide for the S I9000.
What you need
- Linux (tested with Debian testing)
It's pretty simple, execute this commands as root on your computer
SHORT WAY (thanks to mimocan)
# mount -o loop factory.rfs /some_dir
Attatch the rfs file to the loop device
# losetup /dev/loop0 /somedir/factoryfs.rfs
# mkdir /somedir/mnt
# mount /dev/loop0 /somedir/mnt
Now you can copy the content from the /sdcard/tmp directory to the sdcard
# cp -R /somedir/mnt /somedir/factoryfs