Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,731,559 Members 52,328 Now Online
XDA Developers Android and Mobile Development Forum

Packaging an Odin ROM for size and consistancy

Tip us?
 
AdamOutler
Old
(Last edited by AdamOutler; 13th January 2013 at 07:29 AM.)
#1  
AdamOutler's Avatar
Recognized Developer - OP
Thanks Meter 9524
Posts: 5,169
Join Date: Feb 2011
Location: Louisiana

 
DONATE TO ME
Default Packaging an Odin ROM for size and consistancy

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.
Flash with Odin on Windows, Linux and Mac. Use JOdin3, Available in a web browser or offline
Check out my developer pages. Add me to your circles on Google Plus.
The Following 18 Users Say Thank You to AdamOutler For This Useful Post: [ Click to Expand ]
 
BeansTown106
Old
#2  
BeansTown106's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 17458
Posts: 2,426
Join Date: Dec 2011
Location: Springfield, Ma Likes: AllianceRom :) Dislikes: Kangers

 
DONATE TO ME
good ****! this is def useful

My Github: https://github.com/beanstown106
Follow me: @BeansTown106 or +BeansTown106
Current Device's: Verizon Galaxy Note 3, T-Mobile Galaxy S5, Wifi Galaxy Tab Pro 8.4
If You Like My work Please Consider a Donation To help me get a Verizon S5 Here! or Here!, if you cant donate at least say thanks!
The Following User Says Thank You to BeansTown106 For This Useful Post: [ Click to Expand ]
 
garwynn
Old
#3  
garwynn's Avatar
Forum Moderator / Recognized Developer
Thanks Meter 7385
Posts: 4,618
Join Date: Jul 2011
Location: Chi-town

 
DONATE TO ME
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
Contact: Twitter || Google+/Hangouts (Non-Moderator issues only please)
Useful Links: Forum Moderator List || Forum Rules

Please continue to thank and support those who bring these great things to our devices!
(That includes RTs, RCs, RDs/SRDs, FMs/SFMs and the people who maintain the site.)
 
MAQ7
Old
#4  
Senior Member
Thanks Meter 45
Posts: 272
Join Date: Nov 2010
Default Windows OS

How can I do it on a Windows computer?
 
imnuts
Old
#5  
imnuts's Avatar
Recognized Developer
Thanks Meter 2958
Posts: 3,386
Join Date: Jul 2007
Location: West Chester

 
DONATE TO ME
Quote:
Originally Posted by MAQ7 View Post
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.
Setup a Development Environment
Setup and Use the Android SDK
Stock Odin Restore files

You can find the answer to all of your questions right here. If that doesn't work, then try this or this
The Following User Says Thank You to imnuts For This Useful Post: [ Click to Expand ]
 
adrynalyne
Old
#6  
adrynalyne's Avatar
Recognized Developer
Thanks Meter 5669
Posts: 9,619
Join Date: Dec 2008
cygwin.

Mine all work
If you like what I do, buy me a brew!
The Following 2 Users Say Thank You to adrynalyne For This Useful Post: [ Click to Expand ]
 
MAQ7
Old
#7  
Senior Member
Thanks Meter 45
Posts: 272
Join Date: Nov 2010
Quote:
Originally Posted by imnuts View Post
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 View Post
cygwin.

Mine all work
I managed to make tar on Windows using cygwin .

Thank you
 
broodplank1337
Old
#8  
broodplank1337's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 9884
Posts: 4,921
Join Date: Nov 2011
Location: Nijmegen

 
DONATE TO ME
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
Device: Samsung Galaxy S4 (i9505)

Latest Development:
 

Roms:
AOSP v4.4.4 (KTU84P) from source for I9505 (Github)
- Cleanest ROM available for i9505. along with up-to-date stock kernel, also forms a perfect base for ROM developers.

Apps:
Galaxy S4 Glove Mode App (Playstore link)
- Do you want the Glove Mode of the S4 but your ROM doesn't support it? Use this app to enable/disable it easily.

Latest Scraps:
Proprietary Lib Cleaner / Silent proprietary libs / Live Thermal Monitor / GIT Conflict Fixer

Projects in development:
 

broodROM KitKat "Aiming for perfection"
- Custom ROM with really high standards, more info soon

For sources you can visit my Github. Or take a look at all my projects

 
imnuts
Old
#9  
imnuts's Avatar
Recognized Developer
Thanks Meter 2958
Posts: 3,386
Join Date: Jul 2007
Location: West Chester

 
DONATE TO ME
Quote:
Originally Posted by broodplank1337 View Post
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.
Setup a Development Environment
Setup and Use the Android SDK
Stock Odin Restore files

You can find the answer to all of your questions right here. If that doesn't work, then try this or this
 
mrRobinson
Old
#10  
mrRobinson's Avatar
Recognized Contributor
Thanks Meter 7992
Posts: 2,349
Join Date: 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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes