Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distro: add initial support for el10/c10s (COMPOSER-2185) #516

Merged
merged 9 commits into from
Mar 14, 2024
9 changes: 7 additions & 2 deletions pkg/distro/rhel9/ami.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,9 @@ func ec2BuildPackageSet(t *imageType) rpmmd.PackageSet {
}

func ec2CommonPackageSet(t *imageType) rpmmd.PackageSet {
return rpmmd.PackageSet{
ps := rpmmd.PackageSet{
Include: []string{
"@core",
"authselect-compat",
"chrony",
"cloud-init",
"cloud-utils-growpart",
Expand Down Expand Up @@ -350,6 +349,12 @@ func ec2CommonPackageSet(t *imageType) rpmmd.PackageSet {
"qemu-guest-agent",
},
}.Append(distroSpecificPackageSet(t))

if t.arch.distro.releaseVersion == "9" {
ps.Include = append(ps.Include, "authselect-compat")
}

return ps
}

// common rhel ec2 RHUI image package set
Expand Down
56 changes: 33 additions & 23 deletions pkg/distro/rhel9/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,6 @@ var (
basePartitionTables: defaultBasePartitionTables,
}

// Azure BYOS image type
azureByosImgType = imageType{
name: "vhd",
filename: "disk.vhd",
mimeType: "application/x-vhd",
packageSets: map[string]packageSetFunc{
osPkgsKey: azurePackageSet,
},
defaultImageConfig: defaultAzureByosImageConfig.InheritFrom(defaultAzureImageConfig),
kernelOptions: defaultAzureKernelOptions,
bootable: true,
defaultSize: 4 * common.GibiByte,
image: diskImage,
buildPipelines: []string{"build"},
payloadPipelines: []string{"os", "image", "vpc"},
exports: []string{"vpc"},
basePartitionTables: defaultBasePartitionTables,
}

// Azure RHUI image type
azureRhuiImgType = imageType{
name: "azure-rhui",
Expand All @@ -70,6 +51,27 @@ var (
}
)

// Azure BYOS image type
func azureByosImgType(rd distribution) imageType {
return imageType{
name: "vhd",
filename: "disk.vhd",
mimeType: "application/x-vhd",
packageSets: map[string]packageSetFunc{
osPkgsKey: azurePackageSet,
},
defaultImageConfig: defaultAzureByosImageConfig(rd).InheritFrom(defaultAzureImageConfig),
kernelOptions: defaultAzureKernelOptions,
bootable: true,
defaultSize: 4 * common.GibiByte,
image: diskImage,
buildPipelines: []string{"build"},
payloadPipelines: []string{"os", "image", "vpc"},
exports: []string{"vpc"},
basePartitionTables: defaultBasePartitionTables,
}
}

func azureSapRhuiImgType(rd distribution) imageType {
return imageType{
name: "azure-sap-rhui",
Expand Down Expand Up @@ -574,10 +576,18 @@ var defaultAzureImageConfig = &distro.ImageConfig{
// Diff of the default Image Config compare to the `defaultAzureImageConfig`
// The configuration for non-RHUI images does not touch the RHSM configuration at all.
// https://issues.redhat.com/browse/COMPOSER-2157
var defaultAzureByosImageConfig = &distro.ImageConfig{
GPGKeyFiles: []string{
"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
},
func defaultAzureByosImageConfig(rd distribution) *distro.ImageConfig {
ic := &distro.ImageConfig{}
// NOTE RHEL 10 content is currently unsigned - remove this when GPG keys get added to the repos
if rd.Releasever() == "9" {
ic = &distro.ImageConfig{
GPGKeyFiles: []string{
"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
},
}
}
return ic

}

// Diff of the default Image Config compare to the `defaultAzureImageConfig`
Expand Down
6 changes: 5 additions & 1 deletion pkg/distro/rhel9/bare_metal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package rhel9
import (
"fmt"

"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/rpmmd"
)
Expand Down Expand Up @@ -48,7 +49,6 @@ func bareMetalPackageSet(t *imageType) rpmmd.PackageSet {
ps := rpmmd.PackageSet{
Include: []string{
"@core",
"authselect-compat",
"chrony",
"cockpit-system",
"cockpit-ws",
Expand Down Expand Up @@ -90,6 +90,10 @@ func bareMetalPackageSet(t *imageType) rpmmd.PackageSet {
},
}.Append(distroBuildPackageSet(t))

if common.VersionLessThan(t.arch.distro.osVersion, "10.0") {
ps.Include = append(ps.Include, "authselect-compat")
}

// Ensure to not pull in subscription-manager on non-RHEL distro
if t.arch.distro.isRHEL() {
ps = ps.Append(rpmmd.PackageSet{
Expand Down
Loading
Loading