Skip to content

Commit

Permalink
fixup! update disk to use datasizes.size
Browse files Browse the repository at this point in the history
  • Loading branch information
mvo5 committed Nov 21, 2024
1 parent eca72ae commit 2a6eb0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pkg/disk/partition_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ func NewCustomPartitionTable(customizations *blueprint.DiskCustomization, option
pt.EnsureDirectorySizes(options.RequiredMinSizes)
}

pt.relayout(customizations.MinSize)
pt.relayout(customizations.MinSize.Uint64())
pt.GenerateUUIDs(rng)

return pt, nil
Expand All @@ -1260,7 +1260,7 @@ func addPlainPartition(pt *PartitionTable, partition blueprint.PartitionCustomiz
newpart := Partition{
Type: partType,
Bootable: false,
Size: partition.MinSize,
Size: partition.MinSize.Uint64(),
Payload: &Filesystem{
Type: fstype,
Label: partition.Label,
Expand Down Expand Up @@ -1310,15 +1310,15 @@ func addLVMPartition(pt *PartitionTable, partition blueprint.PartitionCustomizat
Mountpoint: lv.Mountpoint,
FSTabOptions: "defaults", // TODO: add customization
}
if _, err := newvg.CreateLogicalVolume(lv.Name, lv.MinSize, newfs); err != nil {
if _, err := newvg.CreateLogicalVolume(lv.Name, lv.MinSize.Uint64(), newfs); err != nil {
return fmt.Errorf("error creating logical volume %q (%s): %w", lv.Name, lv.Mountpoint, err)
}
}

// create partition for volume group
newpart := Partition{
Type: LVMPartitionGUID,
Size: partition.MinSize,
Size: partition.MinSize.Uint64(),
Bootable: false,
Payload: newvg,
}
Expand All @@ -1345,7 +1345,7 @@ func addBtrfsPartition(pt *PartitionTable, partition blueprint.PartitionCustomiz
Type: FilesystemDataGUID,
Bootable: false,
Payload: newvol,
Size: partition.MinSize,
Size: partition.MinSize.Uint64(),
}

pt.Partitions = append(pt.Partitions, newpart)
Expand Down
2 changes: 1 addition & 1 deletion pkg/distro/fedora/imagetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (t *imageType) getPartitionTable(
if options.Size > 0 {
// user specified a size on the command line, so let's override the
// customization with the calculated/rounded imageSize
partitioning.MinSize = imageSize
partitioning.MinSize = datasizes.Size(imageSize)
}

partOptions := &disk.CustomPartitionTableOptions{
Expand Down

0 comments on commit 2a6eb0e

Please sign in to comment.