How to build ODIN flashable ROMs for Samsung Galaxy S Series

 
 
2011-11-06 17:06:58
Galaxy S Series
This guide applies to Galaxy S and all derivatives (Vibrant, Captivate, etc).

NOTE - THIS GUIDE DOES NOT APPLY TO THE GALAXY S II

For anyone unaware, ODIN is the Samsung equivalent of HTC’s RUU. Both are full ROMs which can only be installed via Windows. The ODIN ROMs can be used to restore a semi-bricked phone, that won’t boot to recovery or into the full OS, as all that is needed is Download mode. Download mode is simply accessed by unplugging the phone from the USB cable, holding the volume buttons and plugging in! There's a more thorough guide on ODIN and Heimdall in the Basic Guides section of this website. 

BEFORE YOU START, YOU WILL NEED:

- Windows & Relevant ODIN drivers (note – if you’re on 64 bit, you will need to run ODIN as administrator for it to work)
- A Linux installation (VM, cygwin will suffice)
So... Working on ODIN roms is a little different to typical ROM cooking.
1. First, flash the base ROM via ODIN. These can generally be obtained from Samfirmware.com (so, for the purpose of this example, I used a leaked, 90% working FROYO build for the Vibrant). 
2. ROOT the phone using SuperOneClick or your preferred method. 
3. Once you’ve found any ROM issues, fix - or make any changes to the build.
4. Add custom boot, build.prop, sounds, fonts, whatever you want. Literally, build your ROM live on the phone. You can pull the whole system directory, de-odex it, make changes to individual APKs using APKTOOL, and then push them back to the phone. To do so, you will need to mount system as read write. Do that by typing the following:
adb shell
su
mount -o rw,remount /dev/block/stl9 /system
5. Once you’re happy with the build, it’s time to dump the necessary partitions to build the ODIN rom. 
To do this, ensure the phone is rooted and use adb. Let’s work on the assumption that if you’re reading this, you know what you’re doing with adb.
adb shell
su
In terminal/command prompt, type the following commands to dump the /system partition, zImage (kernel) and modem.bin (radio) to the INTERNAL SD Card:
NOTE - YOU DO NOT NEED TO PULL KERNEL/MODEM IF YOU ALREADY HAVE THESE FROM AN OFFICIAL BUILD. JUST PULL SYSTEM. TO LOCATE THE DIFFERENT PARTITIONS, USE:
cat /proc/mounts
You will see that system is on STL9, and DBDATA is on STL10, for example, on a Galaxy S. I believe on the Galaxy Ace, system is on STL12.
Below are the commands to dump the images:
su
dd if=/dev/block/stl9 of=/sdcard/factoryfs.rfs bs=4096
dd if=/dev/block/bml7 of=/sdcard/zImage bs=4096
dd if=/dev/block/bml12 of=/sdcard/modem.bin bs=4096
6. You’ll need to boot into your Linux machine/VM and boot the . The next step is to create the tarball of the dumped partitions. Do this by typing the following command into the Linux terminal:
tar -H ustar -c factoryfs.rfs modem.bin zImage > vibrant.tar
NOTE - YOU CAN ADD data.rfs , dbdata.rfs - anything you like.
7. Next, we need to md5 it up, as ODIN checks the md5 before writing the image. Do this with the following command:
md5sum –t vibrant.tar >> vibrant.tar
mv vibrant.tar vibrant.tar.md5
8. Contratulations! That’s your ODIN flashable ROM. 
9. You will NOT need a PIT file in ODIN to flash this ROM. If, however you totally screwed up your ROM and it needs to be re-partitioned, you will need it. This can be obtained by Googling for it, or by pulling your own. Type this into terminal emulator:
su
dd if=/dev/block/bml2 of=/sdcard/FILENAME.pit bs=4096

 

 
blog comments powered by Disqus







PaypalFacebookRSSTwitterGoogle +