fixup! Move the file system's information into its own struct
Introduce image_options and supports a dynamic checksum's size

A lot of changes in preparation for the image format 0002. All the changes
require the image_options to determine how to handle the image:
- what is the size of the checksum?

check_mem_size() is rewritten to handle the various cases.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
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
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.

BUG: fail to validate the latest checksum

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.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
fixup! Clone & Restore operations learns to handle checksum on a block c

remove # from log message