blueprint: add filesystem minsize function
This commit is contained in:
parent
7408be580c
commit
90733e79f3
1 changed files with 16 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue