Handle the checksum in a generic way

Image version 0002 must supports various checksum algorithms. To that end,
we move the checksum code in a new file and we define generic functions to
hide the details of the selected algorithm.

After this, partclone still generates images in version 0001, but the bases
to supports more checksum algorithms is in place.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
write_image_bitmap() learns to write various type of bitmap

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
load_image_bitmap() learns to load various type of bitmap

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Clone & Restore operations learns to handle checksum on a block count other than 1

These changes update the code producing the checksum and make it aware of
value for blocks_per_checksum other than 1.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Partclone learns to handle various image version

This commit updates load_image_desc() to handle the image by determining its
version. The version written is still 0001.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Enable image format version 0002

Add the command line parameters to allow the user to select which features
to use when he clones a file system.

From this point, the image format writen by partclone is 0002.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
print_partclone_info() learns about the info mode

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
partclone.info: show the image's details

Show the details like:
- partclone's version used to create the image
- bitmap mode
- checksum options

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
partclone.chkimg: check only the image's size when it does not contains checksums

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>