disk: use BytesToSectors in customization.go
Use the newly introduced conversion helper to convert between bytes and sectors.
This commit is contained in:
parent
f5592bd14a
commit
aa2825d296
1 changed files with 3 additions and 3 deletions
|
|
@ -36,9 +36,9 @@ func CreatePartitionTable(
|
|||
table := basePartitionTable.Clone()
|
||||
|
||||
for _, m := range mountpoints {
|
||||
partitionSize := m.MinSize / DefaultSectorSize
|
||||
sectors := table.BytesToSectors(m.MinSize)
|
||||
if m.Mountpoint != "/" {
|
||||
table.createFilesystem(m.Mountpoint, partitionSize)
|
||||
table.createFilesystem(m.Mountpoint, sectors)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ func CreatePartitionTable(
|
|||
// treat the root partition as a special case
|
||||
// by setting the size dynamically
|
||||
rootPartition := table.RootPartition()
|
||||
rootPartition.Size = ((imageSize / DefaultSectorSize) - start - 100)
|
||||
rootPartition.Size = (table.BytesToSectors(imageSize) - start - 100)
|
||||
|
||||
// Generate new UUIDs for filesystems and partitions
|
||||
table.GenerateUUIDs(rng)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue