ptgen tends to create stub partitions between the end of GPT entry table
and the start of the first disk. Normally fdisk/gdisk aligns partition
to 1MB boundary, so there is 2014 sectors gap before the first partition.
It is absolutely normal.
This patch somehow mimics fdisk/gdisk behavior and does NOT create stub
partition in the gap caused by alignment.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
printf("%" PRIu64 "\n", (sect - start) * DISK_SECTOR_SIZE);
}
- if (parts[0].actual_start > GPT_FIRST_ENTRY_SECTOR + GPT_SIZE) {
+ if ((parts[0].start != 0) &&
+ (parts[0].actual_start > GPT_FIRST_ENTRY_SECTOR + GPT_SIZE)) {
gpte[GPT_ENTRY_MAX - 1].start = cpu_to_le64(GPT_FIRST_ENTRY_SECTOR + GPT_SIZE);
gpte[GPT_ENTRY_MAX - 1].end = cpu_to_le64(parts[0].actual_start - 1);
gpte[GPT_ENTRY_MAX - 1].type = GUID_PARTITION_BIOS_BOOT;