distro/*: fail on kernel boot params with ostree
Kernel boot parameters have no effect on ostree type images (Fedora IoT and RHEL for Edge). Catch this and fail early in the pipeline creation and communicate the issue to the user.
This commit is contained in:
parent
f98e231f64
commit
fd1cc343a5
4 changed files with 20 additions and 0 deletions
|
|
@ -222,6 +222,11 @@ 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 kernelOpts := c.GetKernel(); kernelOpts != nil && kernelOpts.Append != "" && t.rpmOstree {
|
||||
return nil, fmt.Errorf("kernel boot parameter customizations are not supported for ostree types")
|
||||
}
|
||||
|
||||
p := &osbuild.Pipeline{}
|
||||
p.SetBuild(t.buildPipeline(repos, *t.arch, buildPackageSpecs), "org.osbuild.fedora32")
|
||||
|
||||
|
|
|
|||
|
|
@ -222,6 +222,11 @@ 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 kernelOpts := c.GetKernel(); kernelOpts != nil && kernelOpts.Append != "" && t.rpmOstree {
|
||||
return nil, fmt.Errorf("kernel boot parameter customizations are not supported for ostree types")
|
||||
}
|
||||
|
||||
p := &osbuild.Pipeline{}
|
||||
p.SetBuild(t.buildPipeline(repos, *t.arch, buildPackageSpecs), "org.osbuild.fedora33")
|
||||
|
||||
|
|
|
|||
|
|
@ -229,6 +229,11 @@ 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 kernelOpts := c.GetKernel(); kernelOpts != nil && kernelOpts.Append != "" && t.rpmOstree {
|
||||
return nil, fmt.Errorf("kernel boot parameter customizations are not supported for ostree types")
|
||||
}
|
||||
|
||||
p := &osbuild.Pipeline{}
|
||||
p.SetBuild(t.buildPipeline(repos, *t.arch, buildPackageSpecs), "org.osbuild.rhel82")
|
||||
|
||||
|
|
|
|||
|
|
@ -236,6 +236,11 @@ 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) {
|
||||
|
||||
if kernelOpts := c.GetKernel(); kernelOpts != nil && kernelOpts.Append != "" && t.rpmOstree {
|
||||
return nil, fmt.Errorf("kernel boot parameter customizations are not supported for ostree types")
|
||||
}
|
||||
|
||||
var pt *disk.PartitionTable
|
||||
if t.partitionTableGenerator != nil {
|
||||
table := t.partitionTableGenerator(options, t.arch, rng)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue