Skip to content

Commit

Permalink
gpt: point alternate PartitionEntryLBA to alternate GPT table
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tobhe committed Aug 4, 2024
1 parent 5fa33cd commit f9c45ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion partition/gpt/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit f9c45ae

Please sign in to comment.