From: Daniel Golle Date: Wed, 1 Oct 2025 15:20:25 +0000 (+0100) Subject: Revert "ptgen: do not create stub partition to fill a gap if gap caused by alignment" X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=0782d243d23e64d8420f8c067a4169eb69a55f92;p=project%2Ffirmware-utils.git Revert "ptgen: do not create stub partition to fill a gap if gap caused by alignment" Without the BIOS Boot Partition in the gap GRUB fails to install on MBR-boot images. Hence revert commit f1f98b0b8456e89f6c959d8f028c5204da82365e. Signed-off-by: Daniel Golle --- diff --git a/src/ptgen.c b/src/ptgen.c index d9fb744..d480908 100644 --- a/src/ptgen.c +++ b/src/ptgen.c @@ -489,8 +489,7 @@ static int gen_gptable(uint32_t signature, guid_t guid, unsigned nr) printf("%" PRIu64 "\n", (sect - start) * DISK_SECTOR_SIZE); } - if ((parts[0].start != 0) && - (parts[0].actual_start > gpt_first_entry_sector + GPT_SIZE)) { + if (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;