331 lines
14 KiB
Diff
331 lines
14 KiB
Diff
From 2d22821674b6785c1867757d2906282473a14634 Mon Sep 17 00:00:00 2001
|
|
From: Josue David Hernandez Gutierrez <josue.d.hernandez@oracle.com>
|
|
Date: Wed, 30 Oct 2024 18:39:41 +0000
|
|
Subject: [PATCH 2/8] Add support for OL on osbuild-composer
|
|
|
|
Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez@oracle.com>
|
|
---
|
|
.../osbuild/images/pkg/blueprint/customizations.go | 2 +-
|
|
.../osbuild/images/pkg/distro/rhel/distribution.go | 11 +++++++++++
|
|
.../osbuild/images/pkg/distro/rhel/rhel8/ami.go | 2 +-
|
|
.../osbuild/images/pkg/distro/rhel/rhel8/azure.go | 8 ++++----
|
|
.../images/pkg/distro/rhel/rhel8/bare_metal.go | 2 +-
|
|
.../osbuild/images/pkg/distro/rhel/rhel8/distro.go | 12 ++++++++----
|
|
.../osbuild/images/pkg/distro/rhel/rhel9/ami.go | 2 +-
|
|
.../osbuild/images/pkg/distro/rhel/rhel9/azure.go | 8 ++++----
|
|
.../images/pkg/distro/rhel/rhel9/bare_metal.go | 4 ++--
|
|
.../osbuild/images/pkg/distro/rhel/rhel9/distro.go | 12 ++++++++----
|
|
.../images/pkg/image/anaconda_live_installer.go | 2 +-
|
|
.../images/pkg/image/anaconda_ostree_installer.go | 2 +-
|
|
.../images/pkg/image/anaconda_tar_installer.go | 2 +-
|
|
.../images/pkg/image/ostree_simplified_installer.go | 2 +-
|
|
14 files changed, 45 insertions(+), 26 deletions(-)
|
|
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/blueprint/customizations.go b/vendor/github.com/osbuild/images/pkg/blueprint/customizations.go
|
|
index 23addb9..81f248b 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/blueprint/customizations.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/blueprint/customizations.go
|
|
@@ -277,7 +277,7 @@ func (c *Customizations) GetKernel() *KernelCustomization {
|
|
}
|
|
|
|
if name == "" {
|
|
- name = "kernel"
|
|
+ name = "kernel-uek"
|
|
}
|
|
|
|
return &KernelCustomization{
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel/distribution.go b/vendor/github.com/osbuild/images/pkg/distro/rhel/distribution.go
|
|
index 849ca43..4e55c18 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/distribution.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/distribution.go
|
|
@@ -138,6 +138,17 @@ func NewDistribution(name string, major, minor int) (*Distribution, error) {
|
|
ostreeRefTmpl: fmt.Sprintf("centos/%d/%%s/edge", major),
|
|
runner: &runner.CentOS{Version: uint64(major)},
|
|
}
|
|
+ case "ol":
|
|
+ rd = &Distribution{
|
|
+ name: fmt.Sprintf("ol-%d.%d", major, minor),
|
|
+ product: "Oracle Linux",
|
|
+ osVersion: fmt.Sprintf("%d.%d", major, minor),
|
|
+ releaseVersion: fmt.Sprintf("%d", major),
|
|
+ modulePlatformID: fmt.Sprintf("platform:el%d", major),
|
|
+ vendor: "redhat",
|
|
+ ostreeRefTmpl: fmt.Sprintf("ol/%d/%%s/edge", major),
|
|
+ runner: &runner.RHEL{Major: uint64(major), Minor: uint64(minor)},
|
|
+ }
|
|
default:
|
|
return nil, fmt.Errorf("unknown distro name: %s", name)
|
|
}
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/ami.go b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/ami.go
|
|
index 12f8043..4eba290 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/ami.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/ami.go
|
|
@@ -196,7 +196,7 @@ func baseEc2ImageConfig() *distro.ImageConfig {
|
|
{
|
|
Kernel: &osbuild.SysconfigKernelOptions{
|
|
UpdateDefault: true,
|
|
- DefaultKernel: "kernel",
|
|
+ DefaultKernel: "kernel-uek",
|
|
},
|
|
Network: &osbuild.SysconfigNetworkOptions{
|
|
Networking: true,
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/azure.go b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/azure.go
|
|
index 5441ac6..5e5f30c 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/azure.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/azure.go
|
|
@@ -154,9 +154,9 @@ func azureCommonPackageSet(t *rhel.ImageType) rpmmd.PackageSet {
|
|
"efibootmgr",
|
|
"gdisk",
|
|
"hyperv-daemons",
|
|
- "kernel",
|
|
- "kernel-core",
|
|
- "kernel-modules",
|
|
+ "kernel-uek",
|
|
+ "kernel-uek-core",
|
|
+ "kernel-uek-modules",
|
|
"langpacks-en",
|
|
"lvm2",
|
|
"nvme-cli",
|
|
@@ -516,7 +516,7 @@ var defaultAzureImageConfig = &distro.ImageConfig{
|
|
{
|
|
Kernel: &osbuild.SysconfigKernelOptions{
|
|
UpdateDefault: true,
|
|
- DefaultKernel: "kernel-core",
|
|
+ DefaultKernel: "kernel-uek-core",
|
|
},
|
|
Network: &osbuild.SysconfigNetworkOptions{
|
|
Networking: true,
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/bare_metal.go b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/bare_metal.go
|
|
index 0d5fbe0..ac371d8 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/bare_metal.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/bare_metal.go
|
|
@@ -142,7 +142,7 @@ func installerPackageSet(t *rhel.ImageType) rpmmd.PackageSet {
|
|
"iwl6000-firmware",
|
|
"iwl6050-firmware",
|
|
"iwl7260-firmware",
|
|
- "kernel",
|
|
+ "kernel-uek",
|
|
"less",
|
|
"nfs-utils",
|
|
"openssh-clients",
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/distro.go b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/distro.go
|
|
index f35f450..39aa5d3 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/distro.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel8/distro.go
|
|
@@ -44,7 +44,7 @@ func defaultDistroImageConfig(d *rhel.Distribution) *distro.ImageConfig {
|
|
{
|
|
Kernel: &osbuild.SysconfigKernelOptions{
|
|
UpdateDefault: true,
|
|
- DefaultKernel: "kernel",
|
|
+ DefaultKernel: "kernel-uek",
|
|
},
|
|
Network: &osbuild.SysconfigNetworkOptions{
|
|
Networking: true,
|
|
@@ -60,10 +60,14 @@ func defaultDistroImageConfig(d *rhel.Distribution) *distro.ImageConfig {
|
|
func distroISOLabelFunc(t *rhel.ImageType) string {
|
|
const RHEL_ISO_LABEL = "RHEL-%s-%s-0-BaseOS-%s"
|
|
const CS_ISO_LABEL = "CentOS-Stream-%s-%s-dvd"
|
|
+ const OL_ISO_LABEL = "OL-%s-%s-dvd-%s"
|
|
|
|
if t.IsRHEL() {
|
|
osVer := strings.Split(t.Arch().Distro().OsVersion(), ".")
|
|
return fmt.Sprintf(RHEL_ISO_LABEL, osVer[0], osVer[1], t.Arch().Name())
|
|
+ }else if t.Arch().Distro().Name() == "ol" {
|
|
+ osVer := strings.Split(t.Arch().Distro().OsVersion(), ".")
|
|
+ return fmt.Sprintf(RHEL_ISO_LABEL, osVer[0], osVer[1], t.Arch().Name())
|
|
} else {
|
|
return fmt.Sprintf(CS_ISO_LABEL, t.Arch().Distro().Releasever(), t.Arch().Name())
|
|
}
|
|
@@ -418,12 +422,12 @@ func ParseID(idStr string) (*distro.ID, error) {
|
|
return nil, err
|
|
}
|
|
|
|
- if id.Name != "rhel" && id.Name != "centos" {
|
|
+ if id.Name != "rhel" && id.Name != "centos" && id.Name != "ol" {
|
|
return nil, fmt.Errorf("invalid distro name: %s", id.Name)
|
|
}
|
|
|
|
// Backward compatibility layer for "rhel-84" or "rhel-810"
|
|
- if id.Name == "rhel" && id.MinorVersion == -1 {
|
|
+ if (id.Name == "rhel" || id.Name == "ol") && id.MinorVersion == -1 {
|
|
if id.MajorVersion/10 == 8 {
|
|
// handle single digit minor version
|
|
id.MinorVersion = id.MajorVersion % 10
|
|
@@ -445,7 +449,7 @@ func ParseID(idStr string) (*distro.ID, error) {
|
|
}
|
|
|
|
// RHEL uses minor version
|
|
- if id.Name == "rhel" && id.MinorVersion == -1 {
|
|
+ if (id.Name == "rhel" || id.Name == "ol") && id.MinorVersion == -1 {
|
|
return nil, fmt.Errorf("rhel requires minor version, but got: %d", id.MinorVersion)
|
|
}
|
|
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/ami.go b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/ami.go
|
|
index 5f5cf3f..bb4fa53 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/ami.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/ami.go
|
|
@@ -53,7 +53,7 @@ func baseEc2ImageConfig() *distro.ImageConfig {
|
|
{
|
|
Kernel: &osbuild.SysconfigKernelOptions{
|
|
UpdateDefault: true,
|
|
- DefaultKernel: "kernel",
|
|
+ DefaultKernel: "kernel-uek",
|
|
},
|
|
Network: &osbuild.SysconfigNetworkOptions{
|
|
Networking: true,
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/bare_metal.go b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/bare_metal.go
|
|
index 22807f3..f98f4c5 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/bare_metal.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/bare_metal.go
|
|
@@ -147,7 +147,7 @@ func installerPackageSet(t *rhel.ImageType) rpmmd.PackageSet {
|
|
"iwl5150-firmware",
|
|
"iwl6050-firmware",
|
|
"iwl7260-firmware",
|
|
- "kernel",
|
|
+ "kernel-uek",
|
|
"less",
|
|
"nfs-utils",
|
|
"openssh-clients",
|
|
@@ -257,7 +257,7 @@ func anacondaPackageSet(t *rhel.ImageType) rpmmd.PackageSet {
|
|
"kbd",
|
|
"kbd-misc",
|
|
"kdump-anaconda-addon",
|
|
- "kernel",
|
|
+ "kernel-uek",
|
|
"khmeros-base-fonts",
|
|
"less",
|
|
"libblockdev-lvm-dbus",
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/distro.go b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/distro.go
|
|
index 2e77b6b..6a9ad8c 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/distro.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/distro.go
|
|
@@ -43,10 +43,14 @@ var (
|
|
func distroISOLabelFunc(t *rhel.ImageType) string {
|
|
const RHEL_ISO_LABEL = "RHEL-%s-%s-0-BaseOS-%s"
|
|
const CS_ISO_LABEL = "CentOS-Stream-%s-BaseOS-%s"
|
|
+ const OL_ISO_LABEL = "OL-%s-%s-dvd-%s"
|
|
|
|
if t.IsRHEL() {
|
|
osVer := strings.Split(t.Arch().Distro().OsVersion(), ".")
|
|
return fmt.Sprintf(RHEL_ISO_LABEL, osVer[0], osVer[1], t.Arch().Name())
|
|
+ }else if t.Arch().Distro().Name() == "ol" {
|
|
+ osVer := strings.Split(t.Arch().Distro().OsVersion(), ".")
|
|
+ return fmt.Sprintf(RHEL_ISO_LABEL, osVer[0], osVer[1], t.Arch().Name())
|
|
} else {
|
|
return fmt.Sprintf(CS_ISO_LABEL, t.Arch().Distro().Releasever(), t.Arch().Name())
|
|
}
|
|
@@ -60,7 +64,7 @@ func defaultDistroImageConfig(d *rhel.Distribution) *distro.ImageConfig {
|
|
{
|
|
Kernel: &osbuild.SysconfigKernelOptions{
|
|
UpdateDefault: true,
|
|
- DefaultKernel: "kernel",
|
|
+ DefaultKernel: "kernel-uek",
|
|
},
|
|
Network: &osbuild.SysconfigNetworkOptions{
|
|
Networking: true,
|
|
@@ -379,12 +383,12 @@ func ParseID(idStr string) (*distro.ID, error) {
|
|
return nil, err
|
|
}
|
|
|
|
- if id.Name != "rhel" && id.Name != "centos" {
|
|
+ if id.Name != "rhel" && id.Name != "centos" && id.Name != "ol" {
|
|
return nil, fmt.Errorf("invalid distro name: %s", id.Name)
|
|
}
|
|
|
|
// Backward compatibility layer for "rhel-93" or "rhel-910"
|
|
- if id.Name == "rhel" && id.MinorVersion == -1 {
|
|
+ if (id.Name == "rhel" || id.Name == "ol") && id.MinorVersion == -1 {
|
|
if id.MajorVersion/10 == 9 {
|
|
// handle single digit minor version
|
|
id.MinorVersion = id.MajorVersion % 10
|
|
@@ -406,7 +410,7 @@ func ParseID(idStr string) (*distro.ID, error) {
|
|
}
|
|
|
|
// RHEL uses minor version
|
|
- if id.Name == "rhel" && id.MinorVersion == -1 {
|
|
+ if (id.Name == "rhel" || id.Name == "ol") && id.MinorVersion == -1 {
|
|
return nil, fmt.Errorf("rhel requires minor version, but got: %d", id.MinorVersion)
|
|
}
|
|
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/image/anaconda_live_installer.go b/vendor/github.com/osbuild/images/pkg/image/anaconda_live_installer.go
|
|
index 9455fac..1ddcaf9 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/image/anaconda_live_installer.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/image/anaconda_live_installer.go
|
|
@@ -53,7 +53,7 @@ func (img *AnacondaLiveInstaller) InstantiateManifest(m *manifest.Manifest,
|
|
buildPipeline,
|
|
img.Platform,
|
|
repos,
|
|
- "kernel",
|
|
+ "kernel-uek",
|
|
img.Product,
|
|
img.OSVersion,
|
|
img.Preview,
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/image/anaconda_ostree_installer.go b/vendor/github.com/osbuild/images/pkg/image/anaconda_ostree_installer.go
|
|
index a88edae..72c83ab 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/image/anaconda_ostree_installer.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/image/anaconda_ostree_installer.go
|
|
@@ -67,7 +67,7 @@ func (img *AnacondaOSTreeInstaller) InstantiateManifest(m *manifest.Manifest,
|
|
buildPipeline,
|
|
img.Platform,
|
|
repos,
|
|
- "kernel",
|
|
+ "kernel-uek",
|
|
img.Product,
|
|
img.OSVersion,
|
|
img.Preview,
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/image/anaconda_tar_installer.go b/vendor/github.com/osbuild/images/pkg/image/anaconda_tar_installer.go
|
|
index 27ced33..28b5a78 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/image/anaconda_tar_installer.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/image/anaconda_tar_installer.go
|
|
@@ -114,7 +114,7 @@ func (img *AnacondaTarInstaller) InstantiateManifest(m *manifest.Manifest,
|
|
buildPipeline,
|
|
img.Platform,
|
|
repos,
|
|
- "kernel",
|
|
+ "kernel-uek",
|
|
img.Product,
|
|
img.OSVersion,
|
|
img.Preview,
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/image/ostree_simplified_installer.go b/vendor/github.com/osbuild/images/pkg/image/ostree_simplified_installer.go
|
|
index 253c8c1..451d2d0 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/image/ostree_simplified_installer.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/image/ostree_simplified_installer.go
|
|
@@ -86,7 +86,7 @@ func (img *OSTreeSimplifiedInstaller) InstantiateManifest(m *manifest.Manifest,
|
|
buildPipeline,
|
|
img.Platform,
|
|
repos,
|
|
- "kernel",
|
|
+ "kernel-uek",
|
|
img.Product,
|
|
img.OSVersion,
|
|
)
|
|
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/azure.go b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/azure.go
|
|
index cb3831d..9db3db7 100644
|
|
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/azure.go
|
|
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/rhel9/azure.go
|
|
@@ -98,9 +98,9 @@ func azureCommonPackageSet(t *rhel.ImageType) rpmmd.PackageSet {
|
|
"efibootmgr",
|
|
"gdisk",
|
|
"hyperv-daemons",
|
|
- "kernel-core",
|
|
- "kernel-modules",
|
|
- "kernel",
|
|
+ "kernel-uek-core",
|
|
+ "kernel-uek-modules",
|
|
+ "kernel-uek",
|
|
"langpacks-en",
|
|
"lvm2",
|
|
"NetworkManager",
|
|
@@ -430,7 +430,7 @@ func defaultAzureImageConfig(rd *rhel.Distribution) *distro.ImageConfig {
|
|
{
|
|
Kernel: &osbuild.SysconfigKernelOptions{
|
|
UpdateDefault: true,
|
|
- DefaultKernel: "kernel-core",
|
|
+ DefaultKernel: "kernel-uek-core",
|
|
},
|
|
Network: &osbuild.SysconfigNetworkOptions{
|
|
Networking: true,
|
|
--
|
|
2.31.1
|
|
|