debian-forge-composer/vendor/github.com/osbuild/images/pkg/runner/rhel.go
Achilleas Koutsou 0e4a9e586f split: replace internal packages with images library
Remove all the internal package that are now in the
github.com/osbuild/images package and vendor it.

A new function in internal/blueprint/ converts from an osbuild-composer
blueprint to an images blueprint.  This is necessary for keeping the
blueprint implementation in both packages.  In the future, the images
package will change the blueprint (and most likely rename it) and it
will only be part of the osbuild-composer internals and interface.  The
Convert() function will be responsible for converting the blueprint into
the new configuration object.
2023-07-10 21:11:19 +02:00

40 lines
950 B
Go

package runner
import "fmt"
type RHEL struct {
Major uint64
Minor uint64
}
func (r *RHEL) String() string {
return fmt.Sprintf("org.osbuild.rhel%d%d", r.Major, r.Minor)
}
func (p *RHEL) GetBuildPackages() []string {
packages := []string{
"glibc", // ldconfig
}
if p.Major >= 8 {
packages = append(packages,
"systemd", // systemd-tmpfiles and systemd-sysusers
"platform-python", // osbuild
)
}
if p.Major < 9 {
packages = append(packages,
// The RHEL 8 runner in osbuild runs with platform-python but
// explicitly symlinks python 3.6 to /etc/alternatives (which in turn
// is the target for /usr/bin/python3) for the stages.
// https://github.com/osbuild/osbuild/blob/ea8261cad6c5c606c00c0f2824c3f483c01a0cc9/runners/org.osbuild.rhel82#L61
// Install python36 explicitly for RHEL 8.
"python36",
)
} else {
packages = append(packages,
"python3", // osbuild stages
)
}
return packages
}