Move the file system's information into its own struct

This commit impacts a lot of code, but it is mostly the remplacement of the
type image_head by file_system_info. The code uses file_system_info_v2
instead of *_v1 because the field "fs" is not available otherwise.
image_head is only required inside load_image_desc() and write_image_desc().

The functions get_image_* are renamed into load_image_* to indicate they
load the informations from an image file.

initial_image_hdr() is renamed into read_super_blocks() to indicate more
precisely that it read the super blocks from a device.

The image format written by partclone is still 0001.

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

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

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