Rebase patch for osbuild-compsoer v105+

This commit is contained in:
Takuya Wakazono 2024-05-18 23:46:19 +09:00 committed by pastalian
parent 9eaab29b1a
commit 3f6a08a2a6
2 changed files with 94 additions and 51 deletions

View File

@ -1041,31 +1041,79 @@ index 0000000..f8b21e0
+ }
+ ]
+}
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel8/distro.go b/vendor/github.com/osbuild/images/pkg/distro/rhel8/distro.go
index c20d26a..bbca4d4 100644
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel8/distro.go
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel8/distro.go
@@ -152,6 +152,19 @@ func newDistro(name string, minor int) *distribution {
runner: &runner.CentOS{Version: uint64(8)},
defaultImageConfig: defaultDistroImageConfig,
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..e543957 100644
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/distribution.go
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/distribution.go
@@ -97,6 +97,10 @@ func (d *Distribution) IsRHEL() bool {
return strings.HasPrefix(d.name, "rhel")
}
+func (d *Distribution) IsAlma() bool {
+ return strings.HasPrefix(d.name, "almalinux")
+}
+
func (d *Distribution) GetDefaultImageConfig() *distro.ImageConfig {
if d.DefaultImageConfig == nil {
return nil
@@ -138,6 +142,21 @@ func NewDistribution(name string, major, minor int) (*Distribution, error) {
ostreeRefTmpl: fmt.Sprintf("centos/%d/%%s/edge", major),
runner: &runner.CentOS{Version: uint64(major)},
}
+ case "almalinux":
+ rd = distribution{
+ name: fmt.Sprintf("almalinux-8.%d", minor),
+ product: "AlmaLinux",
+ osVersion: fmt.Sprintf("8.%d", minor),
+ releaseVersion: "8",
+ modulePlatformID: "platform:el8",
+ vendor: "almalinux",
+ ostreeRefTmpl: "almalinux/8/%s/edge",
+ isolabelTmpl: fmt.Sprintf("AlmaLinux-8-%d-%%s-dvd", minor),
+ runner: &runner.RHEL{Major: uint64(8), Minor: uint64(minor)},
+ defaultImageConfig: defaultDistroImageConfig,
+ if minor == -1 {
+ return nil, errors.New("AlmaLinux requires a minor version")
+ }
+
+ rd = &Distribution{
+ name: fmt.Sprintf("almalinux-%d.%d", major, minor),
+ product: "AlmaLinux",
+ osVersion: fmt.Sprintf("%d.%d", major, minor),
+ releaseVersion: fmt.Sprintf("%d", major),
+ modulePlatformID: fmt.Sprintf("platform:el%d", major),
+ vendor: "almalinux",
+ ostreeRefTmpl: fmt.Sprintf("almalinux/%d/%%s/edge", major),
+ runner: &runner.RHEL{Major: uint64(major), Minor: uint64(minor)},
+ }
default:
panic(fmt.Sprintf("unknown distro name: %s", name))
return nil, fmt.Errorf("unknown distro name: %s", name)
}
@@ -483,12 +496,12 @@ func ParseID(idStr string) (*distro.ID, error) {
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel/imagetype.go b/vendor/github.com/osbuild/images/pkg/distro/rhel/imagetype.go
index a70269a..53077de 100644
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel/imagetype.go
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel/imagetype.go
@@ -126,6 +126,10 @@ func (t *ImageType) IsRHEL() bool {
return t.arch.distro.IsRHEL()
}
+func (t *ImageType) IsAlma() bool {
+ return t.arch.distro.IsAlma()
+}
+
func (t *ImageType) ISOLabel() (string, error) {
if !t.BootISO {
return "", fmt.Errorf("image type %q is not an ISO", t.name)
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..1ec430a 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
@@ -60,10 +60,15 @@ 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 ALMA_ISO_LABEL = "AlmaLinux-%s-%s-%s-dvd"
+
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.IsAlma() {
+ osVer := strings.Split(t.Arch().Distro().OsVersion(), ".")
+ return fmt.Sprintf(ALMA_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 +423,12 @@ func ParseID(idStr string) (*distro.ID, error) {
return nil, err
}
@ -1080,7 +1128,7 @@ index c20d26a..bbca4d4 100644
if id.MajorVersion/10 == 8 {
// handle single digit minor version
id.MinorVersion = id.MajorVersion % 10
@@ -510,8 +523,8 @@ func ParseID(idStr string) (*distro.ID, error) {
@@ -445,8 +450,8 @@ func ParseID(idStr string) (*distro.ID, error) {
}
// RHEL uses minor version
@ -1091,31 +1139,26 @@ index c20d26a..bbca4d4 100644
}
return id, nil
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel9/distro.go b/vendor/github.com/osbuild/images/pkg/distro/rhel9/distro.go
index a3b57a9..8918c9b 100644
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel9/distro.go
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel9/distro.go
@@ -154,6 +154,19 @@ func newDistro(name string, minor int) *distribution {
runner: &runner.CentOS{Version: uint64(9)},
defaultImageConfig: defaultDistroImageConfig,
}
+ case "almalinux":
+ rd = distribution{
+ name: fmt.Sprintf("almalinux-9.%d", minor),
+ product: "AlmaLinux",
+ osVersion: fmt.Sprintf("9.%d", minor),
+ releaseVersion: "9",
+ modulePlatformID: "platform:el9",
+ vendor: "almalinux",
+ ostreeRefTmpl: "almalinux/9/%s/edge",
+ isolabelTmpl: fmt.Sprintf("AlmaLinux-9-%d-%%s-dvd", minor),
+ runner: &runner.RHEL{Major: uint64(9), Minor: uint64(minor)},
+ defaultImageConfig: defaultDistroImageConfig,
+ }
default:
panic(fmt.Sprintf("unknown distro name: %s", name))
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..e35ffee 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 ALMA_ISO_LABEL = "AlmaLinux-%s-%s-%s-dvd"
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.IsAlma() {
+ osVer := strings.Split(t.Arch().Distro().OsVersion(), ".")
+ return fmt.Sprintf(ALMA_ISO_LABEL, osVer[0], osVer[1], t.Arch().Name())
} else {
return fmt.Sprintf(CS_ISO_LABEL, t.Arch().Distro().Releasever(), t.Arch().Name())
}
@@ -470,12 +483,12 @@ func ParseID(idStr string) (*distro.ID, error) {
@@ -379,12 +383,12 @@ func ParseID(idStr string) (*distro.ID, error) {
return nil, err
}
@ -1130,7 +1173,7 @@ index a3b57a9..8918c9b 100644
if id.MajorVersion/10 == 9 {
// handle single digit minor version
id.MinorVersion = id.MajorVersion % 10
@@ -497,8 +510,8 @@ func ParseID(idStr string) (*distro.ID, error) {
@@ -406,8 +410,8 @@ func ParseID(idStr string) (*distro.ID, error) {
}
// RHEL uses minor version

View File

@ -8,11 +8,11 @@ Subject: [PATCH] Remove libreport-rhel-anaconda-bugzilla from anaconda
vendor/github.com/osbuild/images/pkg/distro/rhel8/bare_metal.go | 1 -
1 file changed, 1 deletion(-)
diff --git a/vendor/github.com/osbuild/images/pkg/distro/rhel8/bare_metal.go b/vendor/github.com/osbuild/images/pkg/distro/rhel8/bare_metal.go
index 05c54e5..68b0100 100644
--- a/vendor/github.com/osbuild/images/pkg/distro/rhel8/bare_metal.go
+++ b/vendor/github.com/osbuild/images/pkg/distro/rhel8/bare_metal.go
@@ -214,7 +214,6 @@ func anacondaPackageSet(t *imageType) rpmmd.PackageSet {
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 0d5fbe066..1fbbed351 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
@@ -228,7 +228,6 @@ func anacondaPackageSet(t *rhel.ImageType) rpmmd.PackageSet {
"libibverbs",
"libreport-plugin-bugzilla",
"libreport-plugin-reportuploader",