[PATCH 2/6] partitions: gpt: only write actual ptes size to device

Sascha Hauer s.hauer at pengutronix.de
Wed Dec 3 07:19:06 PST 2025


For the alternate GPT we hardcode to write 32 blocks for the partition
entries. When writing partitions we only accept partition tables with
128 entries which translates to 32 blocks anyway, so no functional
change, but for correctness use the variable we also use for writing
the primary GPT's partition entries.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/partitions/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/partitions/efi.c b/common/partitions/efi.c
index da9c2d89c1c68ae1acebc1f8eaea8da48243f0d6..76c5393dddb04e2966d3a4b4478d5085f008d935 100644
--- a/common/partitions/efi.c
+++ b/common/partitions/efi.c
@@ -801,7 +801,7 @@ static __maybe_unused int efi_partition_write(struct partition_desc *pd)
 
 	if (ret)
 		goto err_block_write;
-	ret = block_write(blk, epd->ptes, last_lba(blk) - 32, 32);
+	ret = block_write(blk, epd->ptes, last_lba(blk) - 32, size);
 	if (ret)
 		goto err_block_write;
 

-- 
2.47.3




More information about the barebox mailing list