1. Don't handle invalid or empty pte entries
num_partition_entries field in GPT typically means number of maximum entries
and not the number of used entries. Empty entries are indentified with
"0" partition type guid. Loop through all the entries
2. Fix the GPT partition size calculation
"ending_lba" is included in the partition, it is not the start of the next one.
Thus the correct size of the partition is end-start+1
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
If CONFIG_FS_LARGEFILE is not defined, the calculation overflows for larger
disks, since blkcnt_t is 32 bits.
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This fixes some number formatting errors for 64-bit targets
- GPT_HEADER_SIGNATURE is defined as "unsigned long long", so just print it as it is (without PRI macro)
- The size of blkcnt_t depends on CONFIG_FS_LARGEFILE and CONFIG_HAVE_LONG_LONG
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>