Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Packaging an Odin ROM for size and consistancy

OP AdamOutler

5th January 2013, 01:57 AM   |  #1  
Hey guys.. Odin3 version3 and higher has gz support. I've been working with this for a bit and tonight I found that Odin will accept tar.md5.gz files. This is important for GNote2 users as the stock ROM is 1.2Gigs! You can get an extra 10-40% compression and 100% gaurantee that the files arrive to your users computer in the condition that you packaged them using this method. I have not found a guide on using the gz format so I thought I would write one up.

You will need:
A Linux computer
Your rom (we will call it MyROM)

How to package for Odin on Windows
I will cover packing into a single file, adding an MD5, and compressing the file down. For the purposes of this, we are working with "MyROM". You will want to call your ROM whatever you like. Just make sure to add version information to the file name so users don't get confused. Also note, the name MUST be consistent throughout the process. If you change the name, Odin can fail.

Another good tip is to put a model number in the name so there is no confusion as to what device your Odin package goes to. Several users, myself included, have 20+ Odin packages on their computer.


So first you want to turn the ROM into a single tar file and then make sure changes are written to the disk.
Code:
tar -H ustar -c boot.img hidden.img modem.bin param.bin recovery.img system.img tz.img sboot.bin>./MyROM.tar;sync;
Next we want to add an MD5 to the file so Odin can check its consistancy.
Code:
md5sum MyROM.tar >> MyROM.tar;
Now we will change it into a tar.md5 file so Odin knows it has an MD5 attached to it.
Code:
mv MyROM.tar MyROM.tar.md5; sync;
Finally we will compress it with GZip. GZip is the only compression method supported by Odin.
Code:
gzip MyROM.tar.md5 -c -v > MyROM.tar.md5.gz;
You will now have a file called MyROM.tar.md5.gz.


Conclusion
The first time the file is flashed, Odin will uncompress it into MyROM.tar.md5, then check its consistancy, then flash the file. Using this method you will be transferring the smallest file possible and adding integrity checks.


notes
Note to Verizon GNote2 users: Stay away from using Odin after IROM unlock as flashing a package intended for another device will perma-lock your device into another carrier's bootloaders. Especially stay away from GS3 as the displays are not compatible.
Last edited by AdamOutler; 13th January 2013 at 08:29 AM.
The Following 18 Users Say Thank You to AdamOutler For This Useful Post: [ View ]
5th January 2013, 02:06 AM   |  #2  
BeansTown106's Avatar
Recognized Developer
Flag Springfield, MA
Thanks Meter: 19,544
 
2,598 posts
Join Date:Joined: Dec 2011
Donate to Me
More
good ****! this is def useful
The Following User Says Thank You to BeansTown106 For This Useful Post: [ View ]
6th January 2013, 06:10 AM   |  #3  
garwynn's Avatar
Forum Moderator / Recognized Developer
Flag Chi-town
Thanks Meter: 7,795
 
4,780 posts
Join Date:Joined: Jul 2011
Donate to Me
More
Awesome news! Any test results with the older versions? If not one click solutions may not benefit.. but servers and users will by cutting the downloads even more!

Sent from my SPH-L900 using Tapatalk 2
10th January 2013, 09:53 PM   |  #4  
Senior Member
Thanks Meter: 45
 
277 posts
Join Date:Joined: Nov 2010
Windows OS
How can I do it on a Windows computer?
10th January 2013, 10:22 PM   |  #5  
imnuts's Avatar
Recognized Developer
Flag West Chester
Thanks Meter: 3,006
 
3,453 posts
Join Date:Joined: Jul 2007
Donate to Me
More
Quote:
Originally Posted by MAQ7

How can I do it on a Windows computer?

Install Virtual Box and a Linux distribution. I haven't seen any tools for Windows that work properly to make tar archives that work with Odin.
The Following User Says Thank You to imnuts For This Useful Post: [ View ]
10th January 2013, 10:23 PM   |  #6  
adrynalyne's Avatar
Recognized Developer
Thanks Meter: 5,673
 
9,620 posts
Join Date:Joined: Dec 2008
cygwin.

Mine all work
The Following 2 Users Say Thank You to adrynalyne For This Useful Post: [ View ]
11th January 2013, 08:15 AM   |  #7  
Senior Member
Thanks Meter: 45
 
277 posts
Join Date:Joined: Nov 2010
Quote:
Originally Posted by imnuts

Install Virtual Box and a Linux distribution. I haven't seen any tools for Windows that work properly to make tar archives that work with Odin.

Quote:
Originally Posted by adrynalyne

cygwin.

Mine all work

I managed to make tar on Windows using cygwin .

Thank you
11th January 2013, 03:31 PM   |  #8  
broodplank1337's Avatar
Recognized Contributor / Recognized Developer
Flag Nijmegen
Thanks Meter: 10,090
 
4,943 posts
Join Date:Joined: Nov 2011
Donate to Me
More
Interesting adam, I always compressed the whole odin package into a rar file (same effect but one step extra). Also I made an article about odin a while ago:
http://broodplank.net/?p=496


Btw, did you know that you can put cwm backups (ext4.tar) inside an odin package? It's the first odin image I ever saw, filled with a CWM backup, and yes it works XD
But it's not an 1:1 copy of course, Also I wonder how nandroid backups actually store their permissions, I mean dd is a 1:1 dump, which is logical, cwm has the updater-script. but the nandroid backups which are actually just tar files packed with the contents, how do they store it?

Last thing, Odin packages can be a last resort fix, believe me, many users reported that flashing my rom broodROM_RC5.tar.md5 (which contains about 13 files, you can imagine how many partitions it includes) fixed their phone when nothing else worked.

So thank you Samsung for leaking your tool, A world with Samsung Kies only would be a very sad "softbricky" world
11th January 2013, 03:34 PM   |  #9  
imnuts's Avatar
Recognized Developer
Flag West Chester
Thanks Meter: 3,006
 
3,453 posts
Join Date:Joined: Jul 2007
Donate to Me
More
Quote:
Originally Posted by broodplank1337

But it's not an 1:1 copy of course, Also I wonder how nandroid backups actually store their permissions, I mean dd is a 1:1 dump, which is logical, cwm has the updater-script. but the nandroid backups which are actually just tar files packed with the contents, how do they store it?

TAR files preserve file permissions.
11th January 2013, 03:44 PM   |  #10  
mrRobinson's Avatar
Recognized Contributor
Thanks Meter: 8,439
 
2,370 posts
Join Date:Joined: Dec 2010
I still like making a 7z out of the final .tar.md5 file.
The info in OP is great to know as it does save a step for the end user but I'd rather them take a couple steps to vet out the incompetent ones. Could prevent a brick

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes