toolbox: avoid to rewrite version.h if the version has not change

When version.h is modified, every programs are recompiled. By avoiding to
modify it, we avoid to recompile every thing at each execution of make.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
btrfs: use the right type spec when calling log_mesg()

super_block is defined as uint64_t
fix type specification for log_mesg()
Fix warnings from btrfs by using the same type than them

btrfs uses u64 instead of uint64_t and they force the compiler to check
the types passed to the API.
WIP: Adjust indentation in btrfsclone.c
WIP: add empty lines in tests's output
Prepare the code to handle a new image version

Simply rename some #define to make them more uniform.
Validate the image version to be restored

Give up if the version is not recognized.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Add functions to allocate and initialize the bitmap

This make the code a little bit easier to read and maintain.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Declare read_bitmap() and initial_image_hdr() in one place

This reduce code duplication and will simplify the modification of their
declaration when they must be updated.

readbitmap() is renamed read_bitmap() to follow the coding standard.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Disable struct's members alignment and regroup the structs' definitions

The compiler automatically align the struct's members on the platform's
memory boundary. This is to prevent a lost of performance when the members
cross the memory boundary of the platform. If the alignment is not disabled,
the image created with a 64 bits version is not usable by a 32 bits version
and vice-versa.

In our case, a padding of 2 bytes is added before block_size to align it
on the next address divisible by 4.

    00000000  70 61 72 74 63 6c 6f 6e  65 2d 69 6d 61 67 65 45  |partclone-imageE|
    00000010  58 54 46 53 00 00 00 00  00 00 00 00 00 00 30 30  |XTFS..........00|
    00000020  30 31 XX XX 00-04-00-00  00-d0-ff-1f-00-00-00-00  |01..............|
    00000030  f4-ff-07-00-00-00-00-00  be-c3-01-00-00-00-00-00  |................|
    00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Move bitmap writing in write_image_bitmap()

This change will simplify the implementation of image 0002, in which
the user can choose the bitmap format to be recorded.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Extract file system's infos from image_head and move them in fs_info

This commit impacts a lot of code, but it mostly consist of replacing one
type by another. Some functions are renamed to make them more logical given
the change.

This is an intermediate step. Some functions must access image_head and
fs_info because the values are not totally separated, but it will be fixed
in a later commit. For now the code is still purely version 0001.

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