fedora: conditional greenboot package names

Greenboot for Fedora 35 and older has several optional subpackages.
Starting with v36, there is only the 'greenboot-default-health-checks'
subpackage.
This commit is contained in:
Achilleas Koutsou 2022-09-07 13:43:49 +02:00 committed by Tom Gundersen
parent 91e581462b
commit 2001b23610

View file

@ -6,6 +6,7 @@ import (
"fmt"
"strconv"
"github.com/osbuild/osbuild-composer/internal/common"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
)
@ -187,10 +188,6 @@ func iotCommitPackageSet(t *imageType) rpmmd.PackageSet {
"fwupd",
"usbguard",
"greenboot",
"greenboot-grub2",
"greenboot-rpm-ostree-grub2",
"greenboot-reboot",
"greenboot-status",
"ignition",
"zezere-ignition",
"rsync",
@ -226,6 +223,20 @@ func iotCommitPackageSet(t *imageType) rpmmd.PackageSet {
},
}
if common.VersionLessThan(t.arch.distro.osVersion, "36") {
ps = ps.Append(rpmmd.PackageSet{
Include: []string{
"greenboot-grub2",
"greenboot-reboot",
"greenboot-rpm-ostree-grub2",
"greenboot-status",
},
},
)
} else {
ps = ps.Append(rpmmd.PackageSet{Include: []string{"greenboot-default-health-checks"}})
}
return ps
}