blueprints: change minsize from int to uint64

thozza pointed out that `int` is platform dependent which results in
a fs size that is too small for 32-bit machines. This commit changes
the filesystem custimizations to use `uint64` instead of `int`
This commit is contained in:
Gianluca Zuccarelli 2021-09-29 10:07:19 +01:00 committed by Ondřej Budai
parent 5239e264bb
commit b8c14a5689
2 changed files with 4 additions and 4 deletions

View file

@ -73,7 +73,7 @@ type ServicesCustomization struct {
type FilesystemCustomization struct {
Mountpoint string `json:"mountpoint,omitempty" toml:"mountpoint,omitempty"`
MinSize int `json:"minsize,omitempty" toml:"size,omitempty"`
MinSize uint64 `json:"minsize,omitempty" toml:"size,omitempty"`
}
type CustomizationError struct {
@ -258,7 +258,7 @@ func (c *Customizations) GetFilesystemsMinSize() uint64 {
if c == nil {
return 0
}
agg := 0
var agg uint64
for _, m := range c.Filesystem {
agg += m.MinSize
}
@ -267,7 +267,7 @@ func (c *Customizations) GetFilesystemsMinSize() uint64 {
if agg%512 != 0 {
agg = (agg/512 + 1) * 512
}
return uint64(agg)
return agg
}
func (c *Customizations) GetInstallationDevice() string {

View file

@ -38,7 +38,7 @@ func CreatePartitionTable(
for _, m := range mountpoints {
if m.Mountpoint != "/" {
partitionSize := uint64(m.MinSize) / sectorSize
partitionSize := m.MinSize / sectorSize
partition := basePartitionTable.createPartition(m.Mountpoint, partitionSize, rng)
basePartitionTable.Partitions = append(basePartitionTable.Partitions, partition)
}