[TUTORIAL] How To Create Your Own Odin Flashable TAR or TAR.MD5

Search This thread

rwilco12

😺 Recognised Developer / Retired Forum Moderator
I recently put together a tutorial on how to extract files from a stock TAR.MD5 and one of the questions that came up most was “how do I create my own TAR.MD5’s?” I’m going to show you how to do that here.

The standard disclaimer applies here. This tutorial is just the beginning. It does not make you into a Elite Developer, it does not give you everything you need to conquer the world or even make your own ROM. What it does do is give you some of the tools to get you headed in that direction.

So what does this do for you? Well if you have the information from this thread and a few other places you could in fact build a full ROM that is flashable through Odin rather than through a custom recovery. No more need to root your phone beforehand, you could just plug it in to your computer and flash a custom ROM. I myself am not going to show you how to do a custom ROM but I promise you that the tools and resources are out there. That's how I learned this! :)

Before we dig in I have to make one thing clear – This tutorial does not show you how to make an Odin One-Click.exe. I will most likely never post instructions on how to do so. Most people don’t realize this but whenever you flash an Odin One-Click.exe you are taking a substantial risk and have the very real and distinct possibility that it will in fact completely brick your phone. Now, if it is done correctly there is absolutely no chance of it bricking your phone but the process of creating the One-Click.exe is very detailed and complex, one wrong variable or incorrect field and the whole thing is ruined. Now that I’ve scared you, you can rest assured that every One-Click on my site has been very thoroughly tested and are safe. Those who work on those One-Clicks (myself included) are exceptionally detail oriented and test all of their work before posting them. A huge thanks goes to Garwynn, Mohogalore and Sfhub for taking the One-Click process and making it as safe as it is for all of us!

I will also not be showing you how to make your own ROM. Yes, you could use this as a step in creating your own ROM but it involves more Linux than I know how to teach. The good news is that someone else far more talented than I has already put together the tools how to do it. For instructions on how to build your own factoryfs.img (this is where 99% of the ROM is stored in a TAR.MD5) please visit Chris41g's thread at http://xdaforums.com/showthread.php?t=1750295.

Now for the fun stuff!

If you feel you already have a working knowledge of what a TAR.MD5 is and how it works you can skip all the rest of this and go directly to www.rwilco12.com for the rest of the tutorial on how to create your own TAR.MD5.

In order to create a flashable TAR you should first understand the way they work. I’ll give you a semi-brief rundown.

Each Samsung device is setup with several partitions. These partitions all control different aspects of each device. AdamOutler put together a good list of all of them when the Epic 4G Touch first came out. I’ve used his list (http://xdaforums.com/showpost.php?p=17949633&postcount=8) as a base for my explanations.
For the Epic 4G Touch (SPH-D710) the partitions are as follows:
boot.bin – The first piece of the Bootloader. It initiates the activation of your device's memory and starts the SBL.bin.
SBL.bin – The second piece of the Bootloader. This is essentially its own operating system and can control the building and changing of all other partitions. When you flash something through Odin this is what Odin is communicating with.
param.lfs – This is the third and final piece of the Bootloader. This houses Download Mode, startup images and is where SBL.bin stores all of its information.
zImage – The kernel.
recovery.bin – Generally this is where the recovery is stored. However, in the E4GT the recovery is included in the kernel. For all intents and purposes this partition is just wasted space.
cache.img – Your cache partition. Apps and the system store data here to speed up loading times and responsiveness.
modem.bin – The modem. Interestingly enough AdamOutler explains that the modem.bin is essentially a mini operating system all by itself and this is the reason we can talk, surf and play with apps all at the same time.
factoryfs.img – This contains all of the system folders from your device.
data.img – This is where all your app data as well as some other information is stored.
hidden.img – This is your preload folder.
So now we know what’s in the partitions themselves. Now what does this have to do with creating a TAR.MD5? Well each time you flash a TAR.MD5 it contains a given set of files. If you look at one of my Modem TAR.MD5’s you’ll see they contain only a modem.bin file. If you look at the kernel TAR.MD5’s you’ll just see a zImage. If you look at a full ROM (leaked or otherwise) you’ll generally see a full set of files with the same names as the partition files in the TAR.MD5. The reason for this is that each of those files in the TAR.MD5 is in fact a partition image. When you flash the TAR.MD5 it completely overwrites the existing partition and replaces it with the new one.

Now the other question I get is, “How is this different from flashing a ROM in a ZIP format?” The biggest difference is in how they flash. A TAR does one thing and the ZIP does another.

Essentially the TAR.MD5 is what is known as a TAR Ball. A TAR Ball is a compilation of multiple files into an ordered archive. You may not see the order when you open the archive as an archive but the way it is digitally signed determines the order the files are stored and accessed within the TAR (this is important when using Odin to flash). As we previously covered each of those files corresponds to a specific partition on the device. What you don't see is that the way that Odin works is it takes that partition image and completely replaces everything currently on the partition with the new partition image. That there is the major reason why a full TAR build will always wipe all data. The way around this is to remove the data.img and cache.img files. However, removing them from the TAR ball ruins the digital signature and corrupts it. So you can't just manually remove them from the TAR ball but you can pull out the files you need and rebuild a new one.

Now a ZIP ROM. Essentially the ZIP is a standard ZIP archive. The only difference is that CWM (or its variants) has a specific area that they look for a script. These are a bit trickier to understand. That script controls the flashing process. Generally you would write it in the script that a batch of files (based on file structure) goes to the same folder on a specific partition. For example, you have an app you want to flash to the system/apps folder. You create a folder within your ZIP archive that is called system, within that folder you create another called apps, and then you place the app in that folder. When CWM looks at the script in the archive it will tell CWM to mount the factoryfs.img partition and allow you to write to it. It then copies all the files from that given location to the same location on the device. In theory you could write a script that would pull the app from whatever folder in the archive and move it to another folder on the device but that just gets WAY too complicated. When flashing to factoryfs.img or data.img you generally are good to just flash, however there are times where you may want to flash a full ROM. In those cases it is better to wipe the partition (using CWM) before flashing so that there isn't any carryover or overlap between the two ROMs.

If you go into a modem or kernel ZIP archive you'll see that we just took the corresponding partition file and placed it directly in the ZIP. The script in this case acts much the same way as Odin and just replaces the full partition with the new image. Generally you only see four partitions mounted through CWM, modem.bin, zImage, factoryfs.img and data.img. You could mount the others but there isn't often a need to.

Now that there my friends gives you a basic understanding of how these work. Now if you still feel comfortable proceeding please go to www.rwilco12.com for the rest of the tutorial.
 
Last edited:

leaderbuilder

Senior Member
Before we dig in I have to make one thing clear – This tutorial does not show you how to make an Odin One-Click.exe. I will most likely never post instructions on how to do so. Most people don’t realize this but whenever you flash an Odin One-Click.exe you are taking a substantial risk and have the very real and distinct possibility that it will in fact completely brick your phone. Now, if it is done correctly there is absolutely no chance of it bricking your phone but the process of creating the One-Click.exe is very detailed and complex, one wrong variable or incorrect field and the whole thing is ruined. Now that I’ve scared you, you can rest assured that every One-Click on my site has been very thoroughly tested and are safe. Those who work on those One-Clicks (myself included) are exceptionally detail oriented and test all of their work before posting them. A huge thanks goes to Garwynn, Mohogalore and Sfhub for taking the One-Click process and making it as safe as it is for all of us!

Wait - you are sure to be asked the above ^ by someone I'm sure. :p

Thanks RWILCO12 for this excellent tutorial and write up. I may have more free time in the next few months and may be digging back in to the world of coding and compiling. ;)
It's folks like you and all the other devs and contributors that make this such an awesome community! Thanks again.
 

rwilco12

😺 Recognised Developer / Retired Forum Moderator
Wait - you are sure to be asked the above ^ by someone I'm sure. :p

Thanks RWILCO12 for this excellent tutorial and write up. I may have more free time in the next few months and may be digging back in to the world of coding and compiling. ;)
It's folks like you and all the other devs and contributors that make this such an awesome community! Thanks again.

Lol truth be told I think I get a PM or email at least once a week asking... :(

I would love to share with everyone but I myself bricked my phone as part of the learning process. I would hate to see it rushed and have someone brick their own and other people's devices.

When you get back into the game hit me up and we'll see if we can get you going. :)
 

MotoDefier

Senior Member
Aug 4, 2011
360
158
41
Flower Mound
Ice Cream Sandwich (ICS) TAR Ball flashing order:
param.lfs
boot.bin
zImage
recovery.bin
cache.img
data.img
hidden.img
factoryfs.img
modem.bin​

Jelly Bean (JB) TAR Ball flashing order:
boot.bin
cache.img
data.img
factoryfs.img
modem.bin
hidden.img
param.lfs
recovery.bin
Sbl.bin
zImage​

i have a T999L and am trying to get a working stock rooted odin flashable rom built, the only problem i see in your what needs to be written into the tarball is the T999L has sbl1 sbl2 sb3 and is the zmage the same as the Tz or no, i know how to dump all of the partitions but i dont know about zimage or the hidden img factory fs is the system partition right so it would be dd if=/dev/block/mmcblk0p14
 

rwilco12

😺 Recognised Developer / Retired Forum Moderator
i have a T999L and am trying to get a working stock rooted odin flashable rom built, the only problem i see in your what needs to be written into the tarball is the T999L has sbl1 sbl2 sb3 and is the zmage the same as the Tz or no, i know how to dump all of the partitions but i dont know about zimage or the hidden img factory fs is the system partition right so it would be dd if=/dev/block/mmcblk0p14

The steps in this guide are specific to the Sprint Epic 4G Touch but with a little creativity could in theory be applied to all Samsung related.

Good news is that not all devices have a hidden.img so if it's not there I wouldn't worry about it.

The sbl being in multiple positions isn't uncommon either. Add them to the TAR ball in numeric order and that should take care of that.

I'm mobile right now so I can't confirm the exact devblock but Factoryfs is equivalent to system.img on other devices so you should be good.

As for the question on zImage, I've not heard of a tz partition. Is that the kernel on the t999? If so I would assume it would go in the place of the zImage.

Hopefully this helps a bit!
 
  • Like
Reactions: MotoDefier

MotoDefier

Senior Member
Aug 4, 2011
360
158
41
Flower Mound
The steps in this guide are specific to the Sprint Epic 4G Touch but with a little creativity could in theory be applied to all Samsung related.

Good news is that not all devices have a hidden.img so if it's not there I wouldn't worry about it.

The sbl being in multiple positions isn't uncommon either. Add them to the TAR ball in numeric order and that should take care of that.

I'm mobile right now so I can't confirm the exact devblock but Factoryfs is equivalent to system.img on other devices so you should be good.

As for the question on zImage, I've not heard of a tz partition. Is that the kernel on the t999? If so I would assume it would go in the place of the zImage.

okay after reading further on a few things related to the T999 which is the non lte version of the s3 i found this thread http://xdaforums.com/showthread.php?p=30781353 that is based around bootloader unlocking and discoery of how, if it is a direct corelation between the data on the device the TZ patition stands for Trust Zone and is part of the initial boot sequence in which this allows the device to check for secure boot so now i am wondering if the kernel is included in the system which would explain why when i dump it with dd the system.img comes out to 1.48GB instead of the tradtional size of around a gig for the entire rom for a T999
Hopefully this helps a bit!


here is a list of all partitions, zimage is not one of them.

aboot p5
backup p20
boot p7
cache p17
efs p11
fota p19
fsg p21
grow p23
modem p1
modemst1 p12
modemst2 p13
pad p9
param p10
persist p16
recovery p18
rpm p6
sbl1 p2
sbl2 p3
sbl3 p4
ssd p22
syste p14
tz p8
userdata p15

all are on mmcblk0

im guessing since it doesnt have a zimage that the tz is the kernel
 
Last edited:

majdinj

Senior Member
Nov 25, 2006
980
3,442
AlAhsa
Ice Cream Sandwich (ICS) TAR Ball flashing order:
param.lfs
boot.bin
zImage
recovery.bin
cache.img
data.img
hidden.img
factoryfs.img
modem.bin​

Jelly Bean (JB) TAR Ball flashing order:
boot.bin
cache.img
data.img
factoryfs.img
modem.bin
hidden.img
param.lfs
recovery.bin
Sbl.bin
zImage​

Thank you for such comprehensive tutorials,,
I got 3 question here..

1) How could I tell that the tar file created use the correct order if I was not the one who create it?

2) Could I use this command line to tar all dumps that I extracted from the ROM (by using wild star):
Code:
tar -H ustar -c *.img *.bin zImage > package.tar

3) And another query, after creating tar, I checked the permissions given to files by opening the tar by 7-zip.. In this created tar, all files are given the full permissions (0rwxrwxrwx); however, in the shipping original one, each file has different permissions!!!. The following is just an example:

2ed356t.jpg



Is this going to affect the flashing process later on?
 
Last edited:

rwilco12

😺 Recognised Developer / Retired Forum Moderator
Thank you for such comprehensive tutorials,,
I got 3 question here..

1) How could I tell that the tar file created use the correct order if I was not the one who create it?

2) Could I use this command line to tar all dumps that I extracted from the ROM (by using wild star):
Code:
tar -H ustar -c *.img *.bin zImage > package.tar

3) And another query, after creating tar, I checked the permissions given to files by opening the tar by 7-zip.. In this created tar, all files are given the full permissions (0rwxrwxrwx); however, in the shipping original one, each file has different permissions!!!. The following is just an example:

2ed356t.jpg



Is this going to affect the flashing process later on?

In answer to your questions:
1) How could I tell that the tar file created use the correct order if I was not the one who create it? This one is really hit and miss. The best method is to find a stock from the manufacturer TAR and flash it. Odin will flash it in the correct order. Take note of what Odin shows in the progress section and then use that as your flashing order. If you don't have that available it is a lot harder. You have to take them and put them in what you think is the best order and flash to see if you boot. If you don't try again. If you do? Awesome! You've got the boot order!

2) Could I use this command line to tar all dumps that I extracted from the ROM (by using wild star):
Code:
tar -H ustar -c *.img *.bin zImage > package.tar
In theory yes, but in practice no. The order that you put them in the TAR is what determines the flashing order. If you were to flash all the .img files and it grabbed the wrong .img file as the first item it could cause the device to not boot. I have played with the wild cards and have decided that best practice is to always to type them out one by one.

3) And another query, after creating tar, I checked the permissions given to files by opening the tar by 7-zip.. In this created tar, all files are given the full permissions (0rwxrwxrwx); however, in the shipping original one, each file has different permissions!!! Is this going to affect the flashing process later on? Long story short? Don't worry about it. Odin applies the correct permissions during the flash process. Each file within the img files (or bin, etc) comes with their own set of permissions and these are not inherited from the permissions within the TAR.

If you have any other questions or need any help let me know. More than happy to help. :)

Thanks!
 

majdinj

Senior Member
Nov 25, 2006
980
3,442
AlAhsa
If you have any other questions or need any help let me know. More than happy to help. :)

Thanks!

Thanks a lot for this spirit man,, that's why I love xda tooooooo much :laugh:

I am planning to make a utility for win users by which you will be able to do partitions dumps and then TAR them as flashable odin file.. It will be good idea especially for dumping some ROM leak versions. of course I will include linux reader tool to be able to extract the dumped img for custom ROM cooking..

In the meantime, I will concentrate on studying since I have promotion exam coming after 18 days..

Thanks again ;)
 
  • Like
Reactions: leaderbuilder

MotoDefier

Senior Member
Aug 4, 2011
360
158
41
Flower Mound
[QUESTION] so I have been working on an odin flashable rom for the T999L with another developer, when I tarball my files, if I open it in 7zip it doesn't show any permissions for the files, what am I doing wrong in the tar command? Also do all odin roms have to be tarballed in a certain order, or is that for the device you wrote this for only?

Sent from my SGH-T999L using xda app-developers app
 

rwilco12

😺 Recognised Developer / Retired Forum Moderator
[QUESTION] so I have been working on an odin flashable rom for the T999L with another developer, when I tarball my files, if I open it in 7zip it doesn't show any permissions for the files, what am I doing wrong in the tar command? Also do all odin roms have to be tarballed in a certain order, or is that for the device you wrote this for only?

Sent from my SGH-T999L using xda app-developers app

Permissions really aren't important for the TAR file as Odin sets them as it is flashing the TAR. All Odin ROM's have to be TAR balled in a specific order that is unique to that device. However, the order is generally bootloader, kernel, data, system, modem (or very close to that).
 

MotoDefier

Senior Member
Aug 4, 2011
360
158
41
Flower Mound
Is it possible to find that order with out a stock firmware to flash in odin? Would it follow the boot sequence, example: boot, sbl1,rpm, tz, sbl2, sbl3, cache, system. This is pretty much the boot tree for the T999L, its been a while since I looked at it but I think that's right. Is there Any way flashing order follows boot tree order?
Sent from my SGH-T999L using xda app-developers app
 

rwilco12

😺 Recognised Developer / Retired Forum Moderator
Is it possible to find that order with out a stock firmware to flash in odin? Would it follow the boot sequence, example: boot, sbl1,rpm, tz, sbl2, sbl3, cache, system. This is pretty much the boot tree for the T999L, its been a while since I looked at it but I think that's right. Is there Any way flashing order follows boot tree order?
Sent from my SGH-T999L using xda app-developers app

Generally they are pretty close to the same but I have run into a few cases where they haven't been. In those cases trial and error are the only route I've found.
 

MotoDefier

Senior Member
Aug 4, 2011
360
158
41
Flower Mound
Generally they are pretty close to the same but I have run into a few cases where they haven't been. In those cases trial and error are the only route I've found.

Let me ask you this, would it work for me to tar the files with the wildcards and use the pit file and then I can get the correct order of the flash based on how odin flashes it with the pit file?
 

rwilco12

😺 Recognised Developer / Retired Forum Moderator
Let me ask you this, would it work for me to tar the files with the wildcards and use the pit file and then I can get the correct order of the flash based on how odin flashes it with the pit file?

I honestly haven't tried that. If you want to give it a shot let us know if it works. Thanks!
 

zameer_yus

Senior Member
Mar 14, 2013
60
4
how to make a wipe able csc for samsung phone
i m using this below command for making odin flash able file but it doesnt wipe data after flash

$ tar -H ustar -c cache.img.md5 hidden.img.md5 > csc.tar
$ md5sum -t csc.tar >> csc.tar
$ mv csc.tar csc.tar.md5

i want to know how to put a (wipe data/factory default) command in that to erase all phone after flash or automatically perform a full wipe after flash



like here is some sample of csc files these below files erase all phone after flash

CSC_ITV_I9505ITVAMDB_526507_REV06_user_low_ship_MU LTI_CERT.tar.rar

https://mega.co.nz/#!vENDyA6D!cMY2Ws...qx0PuHq hByU

CSC_ITV_I9505ITVAMDB_526507_REV06_user_low_ship_MU LTI_CERT.tar.md5

CSC_OJV_S7560OJVAMF5_1231180_REV02_user_low_ship.t ar

i dont know the exact name of these kind of csc files but i think some people call it multi csc
please help me
 

kalanir

Senior Member
May 19, 2010
57
7
32
Mililani
Odin flash just system

What if I just want to flash the system portion of the phone? is that possible or do I still need to make a TAR ball
 

rwilco12

😺 Recognised Developer / Retired Forum Moderator
What if I just want to flash the system portion of the phone? is that possible or do I still need to make a TAR ball

Depends on what you have setup. You could flash it as a ZIP file through recovery and not have to do it as a TAR ball. If you want to flash through Odin or Mobile Odin you would need to do it as a TAR ball. You could do it in a TAR ball with just the system image though.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 53
    I recently put together a tutorial on how to extract files from a stock TAR.MD5 and one of the questions that came up most was “how do I create my own TAR.MD5’s?” I’m going to show you how to do that here.

    The standard disclaimer applies here. This tutorial is just the beginning. It does not make you into a Elite Developer, it does not give you everything you need to conquer the world or even make your own ROM. What it does do is give you some of the tools to get you headed in that direction.

    So what does this do for you? Well if you have the information from this thread and a few other places you could in fact build a full ROM that is flashable through Odin rather than through a custom recovery. No more need to root your phone beforehand, you could just plug it in to your computer and flash a custom ROM. I myself am not going to show you how to do a custom ROM but I promise you that the tools and resources are out there. That's how I learned this! :)

    Before we dig in I have to make one thing clear – This tutorial does not show you how to make an Odin One-Click.exe. I will most likely never post instructions on how to do so. Most people don’t realize this but whenever you flash an Odin One-Click.exe you are taking a substantial risk and have the very real and distinct possibility that it will in fact completely brick your phone. Now, if it is done correctly there is absolutely no chance of it bricking your phone but the process of creating the One-Click.exe is very detailed and complex, one wrong variable or incorrect field and the whole thing is ruined. Now that I’ve scared you, you can rest assured that every One-Click on my site has been very thoroughly tested and are safe. Those who work on those One-Clicks (myself included) are exceptionally detail oriented and test all of their work before posting them. A huge thanks goes to Garwynn, Mohogalore and Sfhub for taking the One-Click process and making it as safe as it is for all of us!

    I will also not be showing you how to make your own ROM. Yes, you could use this as a step in creating your own ROM but it involves more Linux than I know how to teach. The good news is that someone else far more talented than I has already put together the tools how to do it. For instructions on how to build your own factoryfs.img (this is where 99% of the ROM is stored in a TAR.MD5) please visit Chris41g's thread at http://xdaforums.com/showthread.php?t=1750295.

    Now for the fun stuff!

    If you feel you already have a working knowledge of what a TAR.MD5 is and how it works you can skip all the rest of this and go directly to www.rwilco12.com for the rest of the tutorial on how to create your own TAR.MD5.

    In order to create a flashable TAR you should first understand the way they work. I’ll give you a semi-brief rundown.

    Each Samsung device is setup with several partitions. These partitions all control different aspects of each device. AdamOutler put together a good list of all of them when the Epic 4G Touch first came out. I’ve used his list (http://xdaforums.com/showpost.php?p=17949633&postcount=8) as a base for my explanations.
    For the Epic 4G Touch (SPH-D710) the partitions are as follows:
    boot.bin – The first piece of the Bootloader. It initiates the activation of your device's memory and starts the SBL.bin.
    SBL.bin – The second piece of the Bootloader. This is essentially its own operating system and can control the building and changing of all other partitions. When you flash something through Odin this is what Odin is communicating with.
    param.lfs – This is the third and final piece of the Bootloader. This houses Download Mode, startup images and is where SBL.bin stores all of its information.
    zImage – The kernel.
    recovery.bin – Generally this is where the recovery is stored. However, in the E4GT the recovery is included in the kernel. For all intents and purposes this partition is just wasted space.
    cache.img – Your cache partition. Apps and the system store data here to speed up loading times and responsiveness.
    modem.bin – The modem. Interestingly enough AdamOutler explains that the modem.bin is essentially a mini operating system all by itself and this is the reason we can talk, surf and play with apps all at the same time.
    factoryfs.img – This contains all of the system folders from your device.
    data.img – This is where all your app data as well as some other information is stored.
    hidden.img – This is your preload folder.
    So now we know what’s in the partitions themselves. Now what does this have to do with creating a TAR.MD5? Well each time you flash a TAR.MD5 it contains a given set of files. If you look at one of my Modem TAR.MD5’s you’ll see they contain only a modem.bin file. If you look at the kernel TAR.MD5’s you’ll just see a zImage. If you look at a full ROM (leaked or otherwise) you’ll generally see a full set of files with the same names as the partition files in the TAR.MD5. The reason for this is that each of those files in the TAR.MD5 is in fact a partition image. When you flash the TAR.MD5 it completely overwrites the existing partition and replaces it with the new one.

    Now the other question I get is, “How is this different from flashing a ROM in a ZIP format?” The biggest difference is in how they flash. A TAR does one thing and the ZIP does another.

    Essentially the TAR.MD5 is what is known as a TAR Ball. A TAR Ball is a compilation of multiple files into an ordered archive. You may not see the order when you open the archive as an archive but the way it is digitally signed determines the order the files are stored and accessed within the TAR (this is important when using Odin to flash). As we previously covered each of those files corresponds to a specific partition on the device. What you don't see is that the way that Odin works is it takes that partition image and completely replaces everything currently on the partition with the new partition image. That there is the major reason why a full TAR build will always wipe all data. The way around this is to remove the data.img and cache.img files. However, removing them from the TAR ball ruins the digital signature and corrupts it. So you can't just manually remove them from the TAR ball but you can pull out the files you need and rebuild a new one.

    Now a ZIP ROM. Essentially the ZIP is a standard ZIP archive. The only difference is that CWM (or its variants) has a specific area that they look for a script. These are a bit trickier to understand. That script controls the flashing process. Generally you would write it in the script that a batch of files (based on file structure) goes to the same folder on a specific partition. For example, you have an app you want to flash to the system/apps folder. You create a folder within your ZIP archive that is called system, within that folder you create another called apps, and then you place the app in that folder. When CWM looks at the script in the archive it will tell CWM to mount the factoryfs.img partition and allow you to write to it. It then copies all the files from that given location to the same location on the device. In theory you could write a script that would pull the app from whatever folder in the archive and move it to another folder on the device but that just gets WAY too complicated. When flashing to factoryfs.img or data.img you generally are good to just flash, however there are times where you may want to flash a full ROM. In those cases it is better to wipe the partition (using CWM) before flashing so that there isn't any carryover or overlap between the two ROMs.

    If you go into a modem or kernel ZIP archive you'll see that we just took the corresponding partition file and placed it directly in the ZIP. The script in this case acts much the same way as Odin and just replaces the full partition with the new image. Generally you only see four partitions mounted through CWM, modem.bin, zImage, factoryfs.img and data.img. You could mount the others but there isn't often a need to.

    Now that there my friends gives you a basic understanding of how these work. Now if you still feel comfortable proceeding please go to www.rwilco12.com for the rest of the tutorial.
    6
    Thank you for such comprehensive tutorials,,
    I got 3 question here..

    1) How could I tell that the tar file created use the correct order if I was not the one who create it?

    2) Could I use this command line to tar all dumps that I extracted from the ROM (by using wild star):
    Code:
    tar -H ustar -c *.img *.bin zImage > package.tar

    3) And another query, after creating tar, I checked the permissions given to files by opening the tar by 7-zip.. In this created tar, all files are given the full permissions (0rwxrwxrwx); however, in the shipping original one, each file has different permissions!!!. The following is just an example:

    2ed356t.jpg



    Is this going to affect the flashing process later on?

    In answer to your questions:
    1) How could I tell that the tar file created use the correct order if I was not the one who create it? This one is really hit and miss. The best method is to find a stock from the manufacturer TAR and flash it. Odin will flash it in the correct order. Take note of what Odin shows in the progress section and then use that as your flashing order. If you don't have that available it is a lot harder. You have to take them and put them in what you think is the best order and flash to see if you boot. If you don't try again. If you do? Awesome! You've got the boot order!

    2) Could I use this command line to tar all dumps that I extracted from the ROM (by using wild star):
    Code:
    tar -H ustar -c *.img *.bin zImage > package.tar
    In theory yes, but in practice no. The order that you put them in the TAR is what determines the flashing order. If you were to flash all the .img files and it grabbed the wrong .img file as the first item it could cause the device to not boot. I have played with the wild cards and have decided that best practice is to always to type them out one by one.

    3) And another query, after creating tar, I checked the permissions given to files by opening the tar by 7-zip.. In this created tar, all files are given the full permissions (0rwxrwxrwx); however, in the shipping original one, each file has different permissions!!! Is this going to affect the flashing process later on? Long story short? Don't worry about it. Odin applies the correct permissions during the flash process. Each file within the img files (or bin, etc) comes with their own set of permissions and these are not inherited from the permissions within the TAR.

    If you have any other questions or need any help let me know. More than happy to help. :)

    Thanks!
    5
    Wait - you are sure to be asked the above ^ by someone I'm sure. :p

    Thanks RWILCO12 for this excellent tutorial and write up. I may have more free time in the next few months and may be digging back in to the world of coding and compiling. ;)
    It's folks like you and all the other devs and contributors that make this such an awesome community! Thanks again.

    Lol truth be told I think I get a PM or email at least once a week asking... :(

    I would love to share with everyone but I myself bricked my phone as part of the learning process. I would hate to see it rushed and have someone brick their own and other people's devices.

    When you get back into the game hit me up and we'll see if we can get you going. :)
    3
    Before we dig in I have to make one thing clear – This tutorial does not show you how to make an Odin One-Click.exe. I will most likely never post instructions on how to do so. Most people don’t realize this but whenever you flash an Odin One-Click.exe you are taking a substantial risk and have the very real and distinct possibility that it will in fact completely brick your phone. Now, if it is done correctly there is absolutely no chance of it bricking your phone but the process of creating the One-Click.exe is very detailed and complex, one wrong variable or incorrect field and the whole thing is ruined. Now that I’ve scared you, you can rest assured that every One-Click on my site has been very thoroughly tested and are safe. Those who work on those One-Clicks (myself included) are exceptionally detail oriented and test all of their work before posting them. A huge thanks goes to Garwynn, Mohogalore and Sfhub for taking the One-Click process and making it as safe as it is for all of us!

    Wait - you are sure to be asked the above ^ by someone I'm sure. :p

    Thanks RWILCO12 for this excellent tutorial and write up. I may have more free time in the next few months and may be digging back in to the world of coding and compiling. ;)
    It's folks like you and all the other devs and contributors that make this such an awesome community! Thanks again.
    2
    Ice Cream Sandwich (ICS) TAR Ball flashing order:
    param.lfs
    boot.bin
    zImage
    recovery.bin
    cache.img
    data.img
    hidden.img
    factoryfs.img
    modem.bin​

    Jelly Bean (JB) TAR Ball flashing order:
    boot.bin
    cache.img
    data.img
    factoryfs.img
    modem.bin
    hidden.img
    param.lfs
    recovery.bin
    Sbl.bin
    zImage​

    Thank you for such comprehensive tutorials,,
    I got 3 question here..

    1) How could I tell that the tar file created use the correct order if I was not the one who create it?

    2) Could I use this command line to tar all dumps that I extracted from the ROM (by using wild star):
    Code:
    tar -H ustar -c *.img *.bin zImage > package.tar

    3) And another query, after creating tar, I checked the permissions given to files by opening the tar by 7-zip.. In this created tar, all files are given the full permissions (0rwxrwxrwx); however, in the shipping original one, each file has different permissions!!!. The following is just an example:

    2ed356t.jpg



    Is this going to affect the flashing process later on?