-
Notifications
You must be signed in to change notification settings - Fork 49
/
rhel.go
40 lines (35 loc) · 950 Bytes
/
rhel.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
}