Odin uses a .tar.md5 format which is actually a concatenated tar and .md5 file.
To convert boot.img to Odin flashable:
tar -H ustar -cvvf boot.tar boot.img
The -H option may be substituted with –format
This creates a file boot.tar in ustar format.
Now we append the md5 to the same file
md5sum boot.tar >> boot.tar
We now rename the file to .tar.md5
mv boot.tar boot.tar.md5
To extract and convert this back to a Recovery flashable format, we do
tar -xvvf boot.tar.md5
If you need to read the md5, you can use the following command:
tail -1 boot.tar.md5 | cut -d\ -f1
which reads the last byte of the file boot.tar.md5 which is the md5sum integer plus the filename seperated by a space, then “cuts” it by the delimitor of space, and shows the first characters before the delimitor.
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
He is a full stack developer, whose favorite languages are currently Python and Vue.js. He is also fluent in Javascript, Flutter/Dart, Perl, PHP, SQL, C and bash shell scripting. He loves Linux, and can often be found tinkering with linux kernel code, and source code for GNU applications. He used to be an active developer on XDA forums, and his tinkered ROMS used to be very popular in the early 2000s.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.