fix: must copy path into partclone's structure

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
fix printf() warnings

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Stops using partclone's head buffer to read the blocks

That buffer is not present in image format 0002.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Rewrite partclone's image_head as image_desc as a first step to support format 0002

This rewrite image_desc as three sub-struct to facilitate support for format 0002,
in which the fields are organised differently. Only the "head" struct has the same
size.

Also make the alignment padding explicit by disabling the packing done by
the compiler when defining partclone's structs.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Update the code to work with image_desc_v2

This change makes the support of both version sameless. Only the
initialization code have to deal with the difference between image_desc_v1
and image_desc_v2. The rest of the code always uses image_options_v2.

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Extract some functions from v1_init() to make them available for futur v2_init()

The functions extracted are:
- init_crc32_table()
- init_omode()
- alloc_v1_context()

Signed-off-by: Patryck Rouleau <pfrouleau@gmail.com>
Check the image's head validity when it is read

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