diff --git a/internal/blueprint/customizations.go b/internal/blueprint/customizations.go index 8984360b8..e6b00db5e 100644 --- a/internal/blueprint/customizations.go +++ b/internal/blueprint/customizations.go @@ -200,3 +200,19 @@ func (c *Customizations) GetFilesystems() []FilesystemCustomization { } return c.Filesystem } + +func (c *Customizations) GetFilesystemsMinSize() uint64 { + if c == nil { + return 0 + } + agg := 0 + for _, m := range c.Filesystem { + agg += m.MinSize + } + // This ensures that file system customization `size` is a multiple of + // sector size (512) + if agg%512 != 0 { + agg = (agg/512 + 1) * 512 + } + return uint64(agg) +}