gpt_parser: bugfix: correctly update alternate GPT header
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Thu, 16 May 2013 10:44:02 +0000 (13:44 +0300)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Thu, 16 May 2013 10:46:27 +0000 (13:46 +0300)
commitad431ed897911ca1b46d5751f4841e7f4062e910
treee513ba376f81e734854994691978f0053badf696
parentf57834b9bd7d956f7466e3f6f84c57016d708846
gpt_parser: bugfix: correctly update alternate GPT header

This patch is a bug-fix which fixes the --part-type option.

The sysmptom of the issue was the following warning from kpartx:

GPT: partition_entry_array_crc32 values don't match: 0xa24d9e34 != 0xc4e77ef0
GPT: Use GNU Parted to correct GPT errors.

The reason of the issue was that we did not update the alternate partition
array. The root-cause is that we cannot rely on the 'offs' element of the
partition entry dictionary because it points to the primary prition array
offset, while we needed the alternate. Instead, we have to calculate the offset
ourselves.

Change-Id: Iec35ebefa28ba8f7a65c414177c909747b6512ed
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
mic/utils/gpt_parser.py