m/p/gpt: fix protective MBR off-by-one
Since the protective MBR partition starts at block 1 (the first is the
the protective MBR itself) that first block needs to be subtracted from
its size.
Change-Id: I99bbb449c27596efd2dd260ffb388a9a69a09589
Reviewed-on: https://review.monogon.dev/c/monogon/+/2024
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/metropolis/pkg/gpt/mbr.go b/metropolis/pkg/gpt/mbr.go
index 46f561f..fa82359 100644
--- a/metropolis/pkg/gpt/mbr.go
+++ b/metropolis/pkg/gpt/mbr.go
@@ -40,7 +40,7 @@
StartingCHS: toCHS(1),
Type: 0xEE, // Table/Protective MBR
StartingBlock: 1,
- SizeInBlocks: representedBlockCount,
+ SizeInBlocks: representedBlockCount - 1,
EndingCHS: toCHS(blockCount + 1),
},
{},