distro/rhel7: and add platforms to image types
This commit is contained in:
parent
6fdf917271
commit
c12f2c61e2
1 changed files with 22 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/disk"
|
"github.com/osbuild/osbuild-composer/internal/disk"
|
||||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||||
"github.com/osbuild/osbuild-composer/internal/osbuild"
|
"github.com/osbuild/osbuild-composer/internal/osbuild"
|
||||||
|
"github.com/osbuild/osbuild-composer/internal/platform"
|
||||||
"github.com/osbuild/osbuild-composer/internal/rpmmd"
|
"github.com/osbuild/osbuild-composer/internal/rpmmd"
|
||||||
"github.com/osbuild/osbuild-composer/internal/runner"
|
"github.com/osbuild/osbuild-composer/internal/runner"
|
||||||
)
|
)
|
||||||
|
|
@ -174,13 +175,14 @@ func (a *architecture) GetImageType(name string) (distro.ImageType, error) {
|
||||||
return t, nil
|
return t, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *architecture) addImageTypes(imageTypes ...imageType) {
|
func (a *architecture) addImageTypes(platform platform.Platform, imageTypes ...imageType) {
|
||||||
if a.imageTypes == nil {
|
if a.imageTypes == nil {
|
||||||
a.imageTypes = map[string]distro.ImageType{}
|
a.imageTypes = map[string]distro.ImageType{}
|
||||||
}
|
}
|
||||||
for idx := range imageTypes {
|
for idx := range imageTypes {
|
||||||
it := imageTypes[idx]
|
it := imageTypes[idx]
|
||||||
it.arch = a
|
it.arch = a
|
||||||
|
it.platform = platform
|
||||||
a.imageTypes[it.name] = &it
|
a.imageTypes[it.name] = &it
|
||||||
for _, alias := range it.nameAliases {
|
for _, alias := range it.nameAliases {
|
||||||
if a.imageTypeAliases == nil {
|
if a.imageTypeAliases == nil {
|
||||||
|
|
@ -205,6 +207,7 @@ type packageSetFunc func(t *imageType) rpmmd.PackageSet
|
||||||
|
|
||||||
type imageType struct {
|
type imageType struct {
|
||||||
arch *architecture
|
arch *architecture
|
||||||
|
platform platform.Platform
|
||||||
name string
|
name string
|
||||||
nameAliases []string
|
nameAliases []string
|
||||||
filename string
|
filename string
|
||||||
|
|
@ -465,7 +468,25 @@ func newDistro(distroName string) distro.Distro {
|
||||||
}
|
}
|
||||||
|
|
||||||
x86_64.addImageTypes(
|
x86_64.addImageTypes(
|
||||||
|
&platform.X86{
|
||||||
|
BIOS: true,
|
||||||
|
UEFIVendor: rd.vendor,
|
||||||
|
BasePlatform: platform.BasePlatform{
|
||||||
|
ImageFormat: platform.FORMAT_QCOW2,
|
||||||
|
QCOW2Compat: "0.10",
|
||||||
|
},
|
||||||
|
},
|
||||||
qcow2ImgType,
|
qcow2ImgType,
|
||||||
|
)
|
||||||
|
|
||||||
|
x86_64.addImageTypes(
|
||||||
|
&platform.X86{
|
||||||
|
BIOS: true,
|
||||||
|
UEFIVendor: rd.vendor,
|
||||||
|
BasePlatform: platform.BasePlatform{
|
||||||
|
ImageFormat: platform.FORMAT_VHD,
|
||||||
|
},
|
||||||
|
},
|
||||||
azureRhuiImgType,
|
azureRhuiImgType,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue