Skip to content

Commit

Permalink
distro/fedora: enable the new partitioning functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
achilleas-k committed Nov 15, 2024
1 parent 21fc141 commit 58944b1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/distro/fedora/imagetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,24 @@ func (t *imageType) getPartitionTable(
}

imageSize := t.Size(options.Size)
partitioning := customizations.GetPartitioning()
if partitioning != nil {
// Use the new custom partition table to create a PT fully based on the user's customizations.
// This overrides FilesystemCustomizations, but we should never have both defined.
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
}

partOptions := &disk.CustomPartitionTableOptions{
PartitionTableType: basePartitionTable.Type, // PT type is not customizable, it is determined by the base PT for an image type or architecture
BootMode: t.BootMode(),
DefaultFSType: disk.FS_EXT4, // default fs type for Fedora
RequiredMinSizes: t.requiredPartitionSizes,
}
return disk.NewCustomPartitionTable(partitioning, partOptions, rng)
}

partitioningMode := options.PartitioningMode
if t.rpmOstree {
Expand Down

0 comments on commit 58944b1

Please sign in to comment.