distro/*: handle image size internally
Do not rely on `distro.imageOptions` having any size information, i.e. `Size` being `0`. Instead use `imageType.Size()` and the information in the blueprint customization to calculate the size. This makes the individual distro definitions idenpendent of the API entry points that currently calculate the size, e.g.: internal/cloudapi/v1/v1.go:PostCompose line 184 internal/cloudapi/v2/v2.go:PostCompose line 197 internal/kojiapi/server.go:PostCompose line 135 internal/weldr/api.go:composeHandler line 2289
This commit is contained in:
parent
1dbd2bc364
commit
c64e3149aa
7 changed files with 77 additions and 49 deletions
|
|
@ -62,7 +62,7 @@ type imageType struct {
|
|||
bootable bool
|
||||
rpmOstree bool
|
||||
defaultSize uint64
|
||||
assembler func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler
|
||||
assembler func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler
|
||||
}
|
||||
|
||||
func removePackage(packages []string, packageToRemove string) []string {
|
||||
|
|
@ -309,6 +309,9 @@ func sources(packages []rpmmd.PackageSpec) *osbuild.Sources {
|
|||
|
||||
func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSpecs, buildPackageSpecs []rpmmd.PackageSpec) (*osbuild.Pipeline, error) {
|
||||
|
||||
// if options.Size is 0, this will be the default size of the image type
|
||||
imageSize := t.Size(options.Size)
|
||||
|
||||
if kernelOpts := c.GetKernel(); kernelOpts != nil && kernelOpts.Append != "" && t.rpmOstree {
|
||||
return nil, fmt.Errorf("kernel boot parameter customizations are not supported for ostree types")
|
||||
}
|
||||
|
|
@ -323,6 +326,10 @@ func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOp
|
|||
for _, m := range mountpoints {
|
||||
if m.Mountpoint != "/" {
|
||||
invalidMountpoints = append(invalidMountpoints, m.Mountpoint)
|
||||
} else {
|
||||
if m.MinSize > imageSize {
|
||||
imageSize = m.MinSize
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -404,7 +411,7 @@ func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOp
|
|||
}))
|
||||
}
|
||||
|
||||
p.Assembler = t.assembler(t.arch.uefi, options, t.arch)
|
||||
p.Assembler = t.assembler(t.arch.uefi, options, t.arch, imageSize)
|
||||
|
||||
return p, nil
|
||||
}
|
||||
|
|
@ -571,13 +578,13 @@ func (t *imageType) selinuxStageOptions() *osbuild.SELinuxStageOptions {
|
|||
}
|
||||
}
|
||||
|
||||
func qemuAssembler(format string, filename string, uefi bool, imageOptions distro.ImageOptions) *osbuild.Assembler {
|
||||
func qemuAssembler(format string, filename string, uefi bool, imageSize uint64) *osbuild.Assembler {
|
||||
var options osbuild.QEMUAssemblerOptions
|
||||
if uefi {
|
||||
options = osbuild.QEMUAssemblerOptions{
|
||||
Format: format,
|
||||
Filename: filename,
|
||||
Size: imageOptions.Size,
|
||||
Size: imageSize,
|
||||
PTUUID: "8DFDFF87-C96E-EA48-A3A6-9408F1F6B1EF",
|
||||
PTType: "gpt",
|
||||
Partitions: []osbuild.QEMUPartition{
|
||||
|
|
@ -608,7 +615,7 @@ func qemuAssembler(format string, filename string, uefi bool, imageOptions distr
|
|||
options = osbuild.QEMUAssemblerOptions{
|
||||
Format: format,
|
||||
Filename: filename,
|
||||
Size: imageOptions.Size,
|
||||
Size: imageSize,
|
||||
PTUUID: "0x14fc63d2",
|
||||
PTType: "mbr",
|
||||
Partitions: []osbuild.QEMUPartition{
|
||||
|
|
@ -771,7 +778,7 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
"parsec", "dbus-parsec",
|
||||
},
|
||||
rpmOstree: true,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return ostreeCommitAssembler(options, arch)
|
||||
},
|
||||
}
|
||||
|
|
@ -803,8 +810,8 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
kernelOptions: "ro no_timer_check console=ttyS0,115200n8 console=tty1 biosdevname=0 net.ifnames=0 console=ttyS0,115200",
|
||||
bootable: true,
|
||||
defaultSize: 6 * GigaByte,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
return qemuAssembler("raw", "image.raw", uefi, options)
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return qemuAssembler("raw", "image.raw", uefi, imageSize)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -837,8 +844,8 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
},
|
||||
bootable: true,
|
||||
defaultSize: 2 * GigaByte,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
return qemuAssembler("qcow2", "disk.qcow2", uefi, options)
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return qemuAssembler("qcow2", "disk.qcow2", uefi, imageSize)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -871,8 +878,8 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
},
|
||||
bootable: true,
|
||||
defaultSize: 2 * GigaByte,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
return qemuAssembler("qcow2", "disk.qcow2", uefi, options)
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return qemuAssembler("qcow2", "disk.qcow2", uefi, options.Size)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -910,8 +917,8 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
kernelOptions: "ro biosdevname=0 rootdelay=300 console=ttyS0 earlyprintk=ttyS0 net.ifnames=0",
|
||||
bootable: true,
|
||||
defaultSize: 2 * GigaByte,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
return qemuAssembler("vpc", "disk.vhd", uefi, options)
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return qemuAssembler("vpc", "disk.vhd", uefi, imageSize)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -944,8 +951,8 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
},
|
||||
bootable: true,
|
||||
defaultSize: 2 * GigaByte,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
return qemuAssembler("vmdk", "disk.vmdk", uefi, options)
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return qemuAssembler("vmdk", "disk.vmdk", uefi, options.Size)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -978,8 +985,8 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
},
|
||||
bootable: true,
|
||||
defaultSize: 2 * GigaByte,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
return qemuAssembler("qcow2", "disk.qcow2", uefi, options)
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return qemuAssembler("qcow2", "disk.qcow2", uefi, options.Size)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ type imageType struct {
|
|||
bootable bool
|
||||
rpmOstree bool
|
||||
defaultSize uint64
|
||||
assembler func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler
|
||||
assembler func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler
|
||||
}
|
||||
|
||||
func removePackage(packages []string, packageToRemove string) []string {
|
||||
|
|
@ -301,6 +301,9 @@ func sources(packages []rpmmd.PackageSpec) *osbuild.Sources {
|
|||
|
||||
func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSpecs, buildPackageSpecs []rpmmd.PackageSpec) (*osbuild.Pipeline, error) {
|
||||
|
||||
// if options.Size is 0, this will be the default size of the image type
|
||||
imageSize := t.Size(options.Size)
|
||||
|
||||
if kernelOpts := c.GetKernel(); kernelOpts != nil && kernelOpts.Append != "" && t.rpmOstree {
|
||||
return nil, fmt.Errorf("kernel boot parameter customizations are not supported for ostree types")
|
||||
}
|
||||
|
|
@ -318,6 +321,10 @@ func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOp
|
|||
for _, m := range mountpoints {
|
||||
if m.Mountpoint != "/" {
|
||||
invalidMountpoints = append(invalidMountpoints, m.Mountpoint)
|
||||
} else {
|
||||
if m.MinSize > imageSize {
|
||||
imageSize = m.MinSize
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -436,7 +443,7 @@ func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOp
|
|||
}
|
||||
}
|
||||
|
||||
p.Assembler = t.assembler(t.arch.uefi, options, t.arch)
|
||||
p.Assembler = t.assembler(t.arch.uefi, options, t.arch, imageSize)
|
||||
|
||||
return p, nil
|
||||
}
|
||||
|
|
@ -589,13 +596,13 @@ func (t *imageType) selinuxStageOptions() *osbuild.SELinuxStageOptions {
|
|||
}
|
||||
}
|
||||
|
||||
func qemuAssembler(format string, filename string, uefi bool, imageOptions distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
func qemuAssembler(format string, filename string, uefi bool, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
var options osbuild.QEMUAssemblerOptions
|
||||
if uefi {
|
||||
options = osbuild.QEMUAssemblerOptions{
|
||||
Format: format,
|
||||
Filename: filename,
|
||||
Size: imageOptions.Size,
|
||||
Size: imageSize,
|
||||
PTUUID: "8DFDFF87-C96E-EA48-A3A6-9408F1F6B1EF",
|
||||
PTType: "gpt",
|
||||
Partitions: []osbuild.QEMUPartition{
|
||||
|
|
@ -629,7 +636,7 @@ func qemuAssembler(format string, filename string, uefi bool, imageOptions distr
|
|||
},
|
||||
Format: format,
|
||||
Filename: filename,
|
||||
Size: imageOptions.Size,
|
||||
Size: imageSize,
|
||||
PTUUID: "0x14fc63d2",
|
||||
PTType: "dos",
|
||||
Partitions: []osbuild.QEMUPartition{
|
||||
|
|
@ -655,7 +662,7 @@ func qemuAssembler(format string, filename string, uefi bool, imageOptions distr
|
|||
},
|
||||
Format: format,
|
||||
Filename: filename,
|
||||
Size: imageOptions.Size,
|
||||
Size: imageSize,
|
||||
PTUUID: "0x14fc63d2",
|
||||
PTType: "dos",
|
||||
Partitions: []osbuild.QEMUPartition{
|
||||
|
|
@ -674,7 +681,7 @@ func qemuAssembler(format string, filename string, uefi bool, imageOptions distr
|
|||
options = osbuild.QEMUAssemblerOptions{
|
||||
Format: format,
|
||||
Filename: filename,
|
||||
Size: imageOptions.Size,
|
||||
Size: imageSize,
|
||||
PTUUID: "0x14fc63d2",
|
||||
PTType: "mbr",
|
||||
Partitions: []osbuild.QEMUPartition{
|
||||
|
|
@ -777,7 +784,7 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
"redboot-auto-reboot", "redboot-task-runner",
|
||||
},
|
||||
rpmOstree: true,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return ostreeCommitAssembler(options, arch)
|
||||
},
|
||||
}
|
||||
|
|
@ -830,7 +837,7 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
"redboot-auto-reboot", "redboot-task-runner",
|
||||
},
|
||||
rpmOstree: true,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return ostreeCommitAssembler(options, arch)
|
||||
},
|
||||
}
|
||||
|
|
@ -905,8 +912,8 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
kernelOptions: "ro console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
|
||||
bootable: true,
|
||||
defaultSize: 6 * GigaByte,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
return qemuAssembler("raw", "image.raw", uefi, options, arch)
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return qemuAssembler("raw", "image.raw", uefi, arch, imageSize)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -988,8 +995,8 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
kernelOptions: "console=ttyS0 console=ttyS0,115200n8 no_timer_check crashkernel=auto net.ifnames=0",
|
||||
bootable: true,
|
||||
defaultSize: 4 * GigaByte,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
return qemuAssembler("qcow2", "disk.qcow2", uefi, options, arch)
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return qemuAssembler("qcow2", "disk.qcow2", uefi, arch, imageSize)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -1014,8 +1021,8 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
kernelOptions: "ro net.ifnames=0",
|
||||
bootable: true,
|
||||
defaultSize: 4 * GigaByte,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
return qemuAssembler("qcow2", "disk.qcow2", uefi, options, arch)
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return qemuAssembler("qcow2", "disk.qcow2", uefi, arch, imageSize)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -1029,7 +1036,7 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
},
|
||||
bootable: false,
|
||||
kernelOptions: "ro net.ifnames=0",
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return tarAssembler("root.tar.xz", "xz")
|
||||
},
|
||||
}
|
||||
|
|
@ -1068,8 +1075,8 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
kernelOptions: "ro biosdevname=0 rootdelay=300 console=ttyS0 earlyprintk=ttyS0 net.ifnames=0",
|
||||
bootable: true,
|
||||
defaultSize: 4 * GigaByte,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
return qemuAssembler("vpc", "disk.vhd", uefi, options, arch)
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return qemuAssembler("vpc", "disk.vhd", uefi, arch, imageSize)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -1095,8 +1102,8 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
|
|||
kernelOptions: "ro net.ifnames=0",
|
||||
bootable: true,
|
||||
defaultSize: 4 * GigaByte,
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler {
|
||||
return qemuAssembler("vmdk", "disk.vmdk", uefi, options, arch)
|
||||
assembler: func(uefi bool, options distro.ImageOptions, arch distro.Arch, imageSize uint64) *osbuild.Assembler {
|
||||
return qemuAssembler("vmdk", "disk.vmdk", uefi, arch, imageSize)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ type imageType struct {
|
|||
buildPipelines []string
|
||||
payloadPipelines []string
|
||||
exports []string
|
||||
partitionTableGenerator func(imageOptions distro.ImageOptions, arch distro.Arch, rng *rand.Rand) disk.PartitionTable
|
||||
partitionTableGenerator func(imageSize uint64, arch distro.Arch, rng *rand.Rand) disk.PartitionTable
|
||||
assembler func(pt *disk.PartitionTable, options distro.ImageOptions, arch distro.Arch) *osbuild.Assembler
|
||||
}
|
||||
|
||||
|
|
@ -353,6 +353,8 @@ func sources(packages []rpmmd.PackageSpec) *osbuild.Sources {
|
|||
|
||||
func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSpecs, buildPackageSpecs []rpmmd.PackageSpec, rng *rand.Rand) (*osbuild.Pipeline, error) {
|
||||
|
||||
imageSize := t.Size(options.Size)
|
||||
|
||||
if kernelOpts := c.GetKernel(); kernelOpts != nil && kernelOpts.Append != "" && t.rpmOstree {
|
||||
return nil, fmt.Errorf("kernel boot parameter customizations are not supported for ostree types")
|
||||
}
|
||||
|
|
@ -367,6 +369,10 @@ func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOp
|
|||
for _, m := range mountpoints {
|
||||
if m.Mountpoint != "/" {
|
||||
invalidMountpoints = append(invalidMountpoints, m.Mountpoint)
|
||||
} else {
|
||||
if m.MinSize > imageSize {
|
||||
imageSize = m.MinSize
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -376,7 +382,7 @@ func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOp
|
|||
|
||||
var pt *disk.PartitionTable
|
||||
if t.partitionTableGenerator != nil {
|
||||
table := t.partitionTableGenerator(options, t.arch, rng)
|
||||
table := t.partitionTableGenerator(imageSize, t.arch, rng)
|
||||
pt = &table
|
||||
}
|
||||
|
||||
|
|
@ -684,10 +690,10 @@ func (t *imageType) selinuxStageOptions() *osbuild.SELinuxStageOptions {
|
|||
}
|
||||
}
|
||||
|
||||
func defaultPartitionTable(imageOptions distro.ImageOptions, arch distro.Arch, rng *rand.Rand) disk.PartitionTable {
|
||||
func defaultPartitionTable(imageSize uint64, arch distro.Arch, rng *rand.Rand) disk.PartitionTable {
|
||||
if arch.Name() == "x86_64" {
|
||||
return disk.PartitionTable{
|
||||
Size: imageOptions.Size,
|
||||
Size: imageSize,
|
||||
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
|
||||
Type: "gpt",
|
||||
Partitions: []disk.Partition{
|
||||
|
|
@ -730,7 +736,7 @@ func defaultPartitionTable(imageOptions distro.ImageOptions, arch distro.Arch, r
|
|||
}
|
||||
} else if arch.Name() == "aarch64" {
|
||||
return disk.PartitionTable{
|
||||
Size: imageOptions.Size,
|
||||
Size: imageSize,
|
||||
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
|
||||
Type: "gpt",
|
||||
Partitions: []disk.Partition{
|
||||
|
|
@ -766,7 +772,7 @@ func defaultPartitionTable(imageOptions distro.ImageOptions, arch distro.Arch, r
|
|||
}
|
||||
} else if arch.Name() == "ppc64le" {
|
||||
return disk.PartitionTable{
|
||||
Size: imageOptions.Size,
|
||||
Size: imageSize,
|
||||
UUID: "0x14fc63d2",
|
||||
Type: "dos",
|
||||
Partitions: []disk.Partition{
|
||||
|
|
@ -790,7 +796,7 @@ func defaultPartitionTable(imageOptions distro.ImageOptions, arch distro.Arch, r
|
|||
}
|
||||
} else if arch.Name() == "s390x" {
|
||||
return disk.PartitionTable{
|
||||
Size: imageOptions.Size,
|
||||
Size: imageSize,
|
||||
UUID: "0x14fc63d2",
|
||||
Type: "dos",
|
||||
Partitions: []disk.Partition{
|
||||
|
|
|
|||
|
|
@ -322,7 +322,9 @@ func (t *imageType) getPartitionTable(
|
|||
return basePartitionTable, fmt.Errorf("unknown arch: " + archName)
|
||||
}
|
||||
|
||||
return disk.CreatePartitionTable(mountpoints, options.Size, &basePartitionTable, rng)
|
||||
imageSize := t.Size(options.Size)
|
||||
|
||||
return disk.CreatePartitionTable(mountpoints, imageSize, &basePartitionTable, rng)
|
||||
}
|
||||
|
||||
// local type for ostree commit metadata used to define commit sources
|
||||
|
|
|
|||
|
|
@ -392,7 +392,9 @@ func (t *imageType) getPartitionTable(
|
|||
return basePartitionTable, fmt.Errorf("unknown arch: " + archName)
|
||||
}
|
||||
|
||||
return disk.CreatePartitionTable(mountpoints, options.Size, &basePartitionTable, rng)
|
||||
imageSize := t.Size(options.Size)
|
||||
|
||||
return disk.CreatePartitionTable(mountpoints, imageSize, &basePartitionTable, rng)
|
||||
}
|
||||
|
||||
func (t *imageType) getDefaultImageConfig() *distro.ImageConfig {
|
||||
|
|
|
|||
|
|
@ -380,7 +380,9 @@ func (t *imageType) getPartitionTable(
|
|||
return basePartitionTable, fmt.Errorf("unknown arch: " + archName)
|
||||
}
|
||||
|
||||
return disk.CreatePartitionTable(mountpoints, options.Size, &basePartitionTable, rng)
|
||||
imageSize := t.Size(options.Size)
|
||||
|
||||
return disk.CreatePartitionTable(mountpoints, imageSize, &basePartitionTable, rng)
|
||||
}
|
||||
|
||||
func (t *imageType) getDefaultImageConfig() *distro.ImageConfig {
|
||||
|
|
|
|||
|
|
@ -357,7 +357,9 @@ func (t *imageType) getPartitionTable(
|
|||
return basePartitionTable, fmt.Errorf("unknown arch: " + archName)
|
||||
}
|
||||
|
||||
return disk.CreatePartitionTable(mountpoints, options.Size, &basePartitionTable, rng)
|
||||
imageSize := t.Size(options.Size)
|
||||
|
||||
return disk.CreatePartitionTable(mountpoints, imageSize, &basePartitionTable, rng)
|
||||
}
|
||||
|
||||
// local type for ostree commit metadata used to define commit sources
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue