I was wondering about how to create / extract / verify .tar.md5
files. These files are used when flashing images to android devices, see here for example.
As far as I can tell the checksum is appended to the file like this:
cp file.tar file.tar.md5
md5sum file.tar >> file.tar.md5
Firstly I would like to know how to extract the file. Can I simply use tar -xf
on the file.tar.md5
?
How can I verify the integrity of the file? I would like to remove the last bytes (containing the checksum) from the file to obtain the original file back. I guess you would have to use a regexp to match the checksum file.tar
? Is something like this implemented somewhere already?
.tar.md5
, it's just.md5
.file.tar
identifies which file it's a hash of.