From f9c45ae6ef9b28f45bbcb5920dba5917b119ea74 Mon Sep 17 00:00:00 2001 From: Tobias Heider Date: Sun, 4 Aug 2024 14:51:57 +0000 Subject: [PATCH] gpt: point alternate PartitionEntryLBA to alternate GPT table Currently both tables point to the primary GPT partition entry array which doesn't make a lot of sense. Pass "primary" to t.partitionArraySector() to get the right address for each of the tables instead. --- partition/gpt/table.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partition/gpt/table.go b/partition/gpt/table.go index 132b3578..5d62311b 100644 --- a/partition/gpt/table.go +++ b/partition/gpt/table.go @@ -295,7 +295,7 @@ func (t *Table) toGPTBytes(primary bool) ([]byte, error) { copy(b[56:72], bytesToUUIDBytes(guid[0:16])) // starting LBA of array of partition entries - binary.LittleEndian.PutUint64(b[72:80], t.partitionArraySector(true)) + binary.LittleEndian.PutUint64(b[72:80], t.partitionArraySector(primary)) // how many entries? binary.LittleEndian.PutUint32(b[80:84], uint32(t.partitionArraySize))