diff --git a/internal/manifest/anaconda.go b/internal/manifest/anaconda.go index 2d2f2b675..0c2df4286 100644 --- a/internal/manifest/anaconda.go +++ b/internal/manifest/anaconda.go @@ -8,6 +8,9 @@ import ( // An AnacondaPipeline represents the installer tree as found on an ISO. type AnacondaPipeline struct { BasePipeline + // Packages to install in addition to the ones required by the + // pipeline. + ExtraPackages []string // Users indicate whether or not the user spoke should be enabled in // anaconda. If it is, users specified in a kickstart will be configured, // and in case no users are provided in a kickstart the user will be @@ -57,6 +60,16 @@ func NewAnacondaPipeline(buildPipeline *BuildPipeline, return p } +func (p *AnacondaPipeline) getPackageSetChain() []rpmmd.PackageSet { + packages := []string{} + return []rpmmd.PackageSet{ + { + Include: append(packages, p.ExtraPackages...), + Repositories: p.repos, + }, + } +} + func (p *AnacondaPipeline) getPackageSpecs() []rpmmd.PackageSpec { return p.packageSpecs } diff --git a/internal/manifest/build.go b/internal/manifest/build.go index 03c57b340..a8d8f323f 100644 --- a/internal/manifest/build.go +++ b/internal/manifest/build.go @@ -14,6 +14,9 @@ import ( // make minimal assumptions about what's available there. type BuildPipeline struct { BasePipeline + // Packages to install in addition to the ones required by the + // pipeline. + ExtraPackages []string dependents []Pipeline repos []rpmmd.RepoConfig @@ -45,7 +48,7 @@ func (p *BuildPipeline) getPackageSetChain() []rpmmd.PackageSet { return []rpmmd.PackageSet{ { - Include: packages, + Include: append(packages, p.ExtraPackages...), Repositories: p.repos, }, } diff --git a/internal/manifest/commit_server_tree.go b/internal/manifest/commit_server_tree.go index 9e6a00bd8..e49537769 100644 --- a/internal/manifest/commit_server_tree.go +++ b/internal/manifest/commit_server_tree.go @@ -12,6 +12,9 @@ import ( // an embedded ostree commit. type OSTreeCommitServerTreePipeline struct { BasePipeline + // Packages to install in addition to the ones required by the + // pipeline. + ExtraPackages []string // TODO: should this be configurable? Language string @@ -46,6 +49,16 @@ func NewOSTreeCommitServerTreePipeline(buildPipeline *BuildPipeline, return p } +func (p *OSTreeCommitServerTreePipeline) getPackageSetChain() []rpmmd.PackageSet { + packages := []string{} + return []rpmmd.PackageSet{ + { + Include: append(packages, p.ExtraPackages...), + Repositories: p.repos, + }, + } +} + func (p *OSTreeCommitServerTreePipeline) getPackageSpecs() []rpmmd.PackageSpec { return p.packageSpecs } diff --git a/internal/manifest/os.go b/internal/manifest/os.go index 0a5b7d159..5486e2620 100644 --- a/internal/manifest/os.go +++ b/internal/manifest/os.go @@ -23,6 +23,19 @@ const ( // correpsonds to the root filesystem once an instance of the image is running. type OSPipeline struct { BasePipeline + // Packages to install in addition to the ones required by the + // pipeline. + ExtraBasePackages []string + // Packages to exclude from the base package set. This is useful in + // case of weak dependencies, comps groups, or where multiple packages + // can satisfy a dependency. Must not conflict with the included base + // package set. + ExcludeBasePackages []string + // Packages to install on top of the base packages in a seconadry dnf + // transaction. + UserPackages []string + // Repositories to install the user packages from. + UserRepos []rpmmd.RepoConfig // KernelOptionsAppend are appended to the kernel commandline KernelOptionsAppend []string // UEFIVendor indicates whether or not the OS should support UEFI and @@ -126,6 +139,26 @@ func NewOSPipeline(buildPipeline *BuildPipeline, return p } +func (p *OSPipeline) getPackageSetChain() []rpmmd.PackageSet { + packages := []string{} + chain := []rpmmd.PackageSet{ + { + Include: append(packages, p.ExtraBasePackages...), + Exclude: p.ExcludeBasePackages, + Repositories: p.repos, + }, + } + + if len(p.UserPackages) > 0 { + chain = append(chain, rpmmd.PackageSet{ + Include: p.UserPackages, + Repositories: append(p.repos, p.UserRepos...), + }) + } + + return chain +} + func (p *OSPipeline) getOSTreeCommits() []osTreeCommit { commits := []osTreeCommit{} if p.osTreeParent != "" && p.osTreeURL != "" {