disk: add default minimum directory sizes

Currently, we only specify a minimum size for
- `/` (1 GiB), and
- `/usr` (2 GiB).

This ensures that
- a separate `/usr` partition is at least 2 GiB,
- `/` is always at least 1 GiB,
- if `/usr` it not a separate partition, `/` is at least 3 GiB.

We could (or should), in the future, make it possible for image types to
override this mapping as part of their default config, for example, if
an image type by default requires a larger `/usr`.
This commit is contained in:
Achilleas Koutsou 2022-04-27 17:34:59 +02:00 committed by Tomáš Hozza
parent efa10e56e1
commit 275e60f199

View file

@ -38,6 +38,12 @@ func NewPartitionTable(basePT *PartitionTable, mountpoints []blueprint.Filesyste
}
}
// TODO: make these overrideable for each image type
newPT.EnsureDirectorySizes(map[string]uint64{
"/": 1073741824,
"/usr": 2147483648,
})
// Calculate partition table offsets and sizes
newPT.relayout(imageSize)