We currently extract a TAR archive to a SD-Card like this
tar xf ${ROOT}/rootfs.tar -C /cynox/${DRIVE}/${TARGET}
As a side note: The rootfs.tar contains files for an embedded Linux system. Some of those systems experience some kind of data corruption on the SD-cards. This can result in missing files, corrupted file contents etc. preventing the embedded system from functioning properly or even booting. This is most likely NOT related to problems during SD-Card creation, but to be totally sure, we also have to investigate in that direction.
What is the best way to compare the contents on the SD-Card to the contents of the source TAR afterwards?
Without knowing if its practical on Linux, things that come to mind are
- Create a new archive from the SD-Card and compare the MD5 of both archives (or will those somehow naturally be different?)
- Extract the source TAR elsewhere, calculate the MD5 of every file and compare file by file (is it practical to crawl all the folders/files?)
- Somehow directly compare the SD-Card contents to the packed contents of the TAR file by file?
- Do we need some special validations regarding folder structure, file/folder permissions and so on?
I don't know what possibilities Linux provides for this task, so I would be thankful for any suggestions, pointers in the right direction and examples if possible.