m/c/m/core: adjust the minimum ESP size
OVMF firmware refuses to boot from a smaller ESP.
This is due to unknown factors. This patch addresses that problem by
adjusting the partition's minimum size to slightly more than FAT's
advertised lower bound of 32MiB.
Change-Id: I1516ce19a162cd8da51e92aa7783c5a48ecfa77f
Reviewed-on: https://review.monogon.dev/c/monogon/+/421
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/cli/metroctl/core/install.go b/metropolis/cli/metroctl/core/install.go
index 35b49ea..f4c6b96 100644
--- a/metropolis/cli/metroctl/core/install.go
+++ b/metropolis/cli/metroctl/core/install.go
@@ -76,9 +76,10 @@
// 5% filesystem overhead
partitionSizeBytes := (uint64(float32(5*MiB+args.BundleSize+args.InstallerSize+uint64(len(nodeParamsRaw))) * 1.05)) & align1MiBMask
// FAT32 has a minimum partition size of 32MiB, so clamp the lower partition
- // size to that.
- if partitionSizeBytes < 32*MiB {
- partitionSizeBytes = 32 * MiB
+ // size to a notch more than that.
+ minimumSize := uint64(33 * MiB)
+ if partitionSizeBytes < minimumSize {
+ partitionSizeBytes = minimumSize
}
// If creating an image, create it with minimal size, i.e. 1MiB at each
// end for partitioning metadata and alignment.