Delete unused internal/platform package
This is a leftover from the `osbuild/images` split`. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
e27cb2d397
commit
b41705adfb
11 changed files with 6 additions and 293 deletions
|
|
@ -14,9 +14,9 @@ import (
|
|||
"github.com/osbuild/images/pkg/distro"
|
||||
rhel "github.com/osbuild/images/pkg/distro/rhel8"
|
||||
"github.com/osbuild/images/pkg/ostree"
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/images/pkg/rpmmd"
|
||||
"github.com/osbuild/osbuild-composer/internal/dnfjson"
|
||||
"github.com/osbuild/osbuild-composer/internal/platform"
|
||||
)
|
||||
|
||||
// This test loads all the repositories available in /repositories directory
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/osbuild-composer/cmd/osbuild-image-tests/constants"
|
||||
"github.com/osbuild/osbuild-composer/internal/boot"
|
||||
"github.com/osbuild/osbuild-composer/internal/boot/azuretest"
|
||||
"github.com/osbuild/osbuild-composer/internal/boot/openstacktest"
|
||||
"github.com/osbuild/osbuild-composer/internal/boot/vmwaretest"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/platform"
|
||||
"github.com/osbuild/osbuild-composer/internal/test"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ import (
|
|||
"github.com/osbuild/images/pkg/distro/fedora"
|
||||
"github.com/osbuild/images/pkg/distroregistry"
|
||||
"github.com/osbuild/images/pkg/manifest"
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/images/pkg/rpmmd"
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
"github.com/osbuild/osbuild-composer/internal/dnfjson"
|
||||
"github.com/osbuild/osbuild-composer/internal/platform"
|
||||
"github.com/osbuild/osbuild-composer/internal/store"
|
||||
"github.com/osbuild/osbuild-composer/internal/target"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/osbuild-composer/cmd/osbuild-image-tests/constants"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/platform"
|
||||
)
|
||||
|
||||
// WithNetworkNamespace provides the function f with a new network namespace
|
||||
|
|
|
|||
|
|
@ -1,62 +0,0 @@
|
|||
package platform
|
||||
|
||||
type Aarch64 struct {
|
||||
BasePlatform
|
||||
UEFIVendor string
|
||||
}
|
||||
|
||||
func (p *Aarch64) GetArch() Arch {
|
||||
return ARCH_AARCH64
|
||||
}
|
||||
|
||||
func (p *Aarch64) GetUEFIVendor() string {
|
||||
return p.UEFIVendor
|
||||
}
|
||||
|
||||
func (p *Aarch64) GetPackages() []string {
|
||||
packages := p.BasePlatform.FirmwarePackages
|
||||
|
||||
if p.UEFIVendor != "" {
|
||||
packages = append(packages,
|
||||
"dracut-config-generic",
|
||||
"efibootmgr",
|
||||
"grub2-efi-aa64",
|
||||
"grub2-tools",
|
||||
"shim-aa64")
|
||||
}
|
||||
|
||||
return packages
|
||||
}
|
||||
|
||||
type Aarch64_IoT struct {
|
||||
BasePlatform
|
||||
UEFIVendor string
|
||||
BootFiles [][2]string
|
||||
}
|
||||
|
||||
func (p *Aarch64_IoT) GetArch() Arch {
|
||||
return ARCH_AARCH64
|
||||
}
|
||||
|
||||
func (p *Aarch64_IoT) GetUEFIVendor() string {
|
||||
return p.UEFIVendor
|
||||
}
|
||||
|
||||
func (p *Aarch64_IoT) GetPackages() []string {
|
||||
packages := p.BasePlatform.FirmwarePackages
|
||||
|
||||
if p.UEFIVendor != "" {
|
||||
packages = append(packages,
|
||||
"dracut-config-generic",
|
||||
"efibootmgr",
|
||||
"grub2-efi-aa64",
|
||||
"grub2-tools",
|
||||
"shim-aa64")
|
||||
}
|
||||
|
||||
return packages
|
||||
}
|
||||
|
||||
func (p *Aarch64_IoT) GetBootFiles() [][2]string {
|
||||
return p.BootFiles
|
||||
}
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
package platform
|
||||
|
||||
type Arch uint64
|
||||
type ImageFormat uint64
|
||||
|
||||
const ( // architecture enum
|
||||
ARCH_AARCH64 Arch = iota
|
||||
ARCH_PPC64LE
|
||||
ARCH_S390X
|
||||
ARCH_X86_64
|
||||
)
|
||||
|
||||
const ( // image format enum
|
||||
FORMAT_UNSET ImageFormat = iota
|
||||
FORMAT_RAW
|
||||
FORMAT_ISO
|
||||
FORMAT_QCOW2
|
||||
FORMAT_VMDK
|
||||
FORMAT_VHD
|
||||
FORMAT_GCE
|
||||
FORMAT_OVA
|
||||
)
|
||||
|
||||
func (a Arch) String() string {
|
||||
switch a {
|
||||
case ARCH_AARCH64:
|
||||
return "aarch64"
|
||||
case ARCH_PPC64LE:
|
||||
return "ppc64le"
|
||||
case ARCH_S390X:
|
||||
return "s390x"
|
||||
case ARCH_X86_64:
|
||||
return "x86_64"
|
||||
default:
|
||||
panic("invalid architecture")
|
||||
}
|
||||
}
|
||||
|
||||
func (f ImageFormat) String() string {
|
||||
switch f {
|
||||
case FORMAT_RAW:
|
||||
return "raw"
|
||||
case FORMAT_ISO:
|
||||
return "iso"
|
||||
case FORMAT_QCOW2:
|
||||
return "qcow2"
|
||||
case FORMAT_VMDK:
|
||||
return "vmdk"
|
||||
case FORMAT_VHD:
|
||||
return "vhd"
|
||||
case FORMAT_GCE:
|
||||
return "gce"
|
||||
case FORMAT_OVA:
|
||||
return "ova"
|
||||
default:
|
||||
panic("invalid image format")
|
||||
}
|
||||
}
|
||||
|
||||
type Platform interface {
|
||||
GetArch() Arch
|
||||
GetImageFormat() ImageFormat
|
||||
GetQCOW2Compat() string
|
||||
GetBIOSPlatform() string
|
||||
GetUEFIVendor() string
|
||||
GetZiplSupport() bool
|
||||
GetPackages() []string
|
||||
GetBuildPackages() []string
|
||||
GetBootFiles() [][2]string
|
||||
}
|
||||
|
||||
type BasePlatform struct {
|
||||
ImageFormat ImageFormat
|
||||
QCOW2Compat string
|
||||
FirmwarePackages []string
|
||||
}
|
||||
|
||||
func (p BasePlatform) GetImageFormat() ImageFormat {
|
||||
return p.ImageFormat
|
||||
}
|
||||
|
||||
func (p BasePlatform) GetQCOW2Compat() string {
|
||||
return p.QCOW2Compat
|
||||
}
|
||||
|
||||
func (p BasePlatform) GetBIOSPlatform() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (p BasePlatform) GetUEFIVendor() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (p BasePlatform) GetZiplSupport() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (p BasePlatform) GetPackages() []string {
|
||||
return p.FirmwarePackages
|
||||
}
|
||||
|
||||
func (p BasePlatform) GetBuildPackages() []string {
|
||||
return []string{}
|
||||
}
|
||||
|
||||
func (p BasePlatform) GetBootFiles() [][2]string {
|
||||
return [][2]string{}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
package platform
|
||||
|
||||
type PPC64LE struct {
|
||||
BasePlatform
|
||||
BIOS bool
|
||||
}
|
||||
|
||||
func (p *PPC64LE) GetArch() Arch {
|
||||
return ARCH_PPC64LE
|
||||
}
|
||||
|
||||
func (p *PPC64LE) GetBIOSPlatform() string {
|
||||
if p.BIOS {
|
||||
return "powerpc-ieee1275"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (p *PPC64LE) GetPackages() []string {
|
||||
return []string{
|
||||
"dracut-config-generic",
|
||||
"powerpc-utils",
|
||||
"grub2-ppc64le",
|
||||
"grub2-ppc64le-modules",
|
||||
}
|
||||
}
|
||||
|
||||
func (p *PPC64LE) GetBuildPackages() []string {
|
||||
return []string{
|
||||
"grub2-ppc64le",
|
||||
"grub2-ppc64le-modules",
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
package platform
|
||||
|
||||
type S390X struct {
|
||||
BasePlatform
|
||||
Zipl bool
|
||||
}
|
||||
|
||||
func (p *S390X) GetArch() Arch {
|
||||
return ARCH_S390X
|
||||
}
|
||||
|
||||
func (p *S390X) GetZiplSupport() bool {
|
||||
return p.Zipl
|
||||
}
|
||||
|
||||
func (p *S390X) GetPackages() []string {
|
||||
packages := p.BasePlatform.FirmwarePackages
|
||||
// TODO: should these packages be present also in images not intended for booting?
|
||||
packages = append(packages,
|
||||
"dracut-config-generic",
|
||||
"s390utils-base",
|
||||
"s390utils-core",
|
||||
)
|
||||
return packages
|
||||
}
|
||||
|
||||
func (p *S390X) GetBuildPackages() []string {
|
||||
// TODO: should these packages be present also in images not intended for booting?
|
||||
return []string{
|
||||
"s390utils-base",
|
||||
}
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
package platform
|
||||
|
||||
type X86BootLoader uint64
|
||||
|
||||
type X86 struct {
|
||||
BasePlatform
|
||||
BIOS bool
|
||||
UEFIVendor string
|
||||
}
|
||||
|
||||
func (p *X86) GetArch() Arch {
|
||||
return ARCH_X86_64
|
||||
}
|
||||
|
||||
func (p *X86) GetBIOSPlatform() string {
|
||||
if p.BIOS {
|
||||
return "i386-pc"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (p *X86) GetUEFIVendor() string {
|
||||
return p.UEFIVendor
|
||||
}
|
||||
|
||||
func (p *X86) GetPackages() []string {
|
||||
packages := p.BasePlatform.FirmwarePackages
|
||||
|
||||
if p.BIOS {
|
||||
packages = append(packages,
|
||||
"dracut-config-generic",
|
||||
"grub2-pc")
|
||||
}
|
||||
|
||||
if p.UEFIVendor != "" {
|
||||
packages = append(packages,
|
||||
"dracut-config-generic",
|
||||
"efibootmgr",
|
||||
"grub2-efi-x64",
|
||||
"shim-x64")
|
||||
}
|
||||
|
||||
return packages
|
||||
}
|
||||
|
||||
func (p *X86) GetBuildPackages() []string {
|
||||
packages := []string{}
|
||||
if p.BIOS {
|
||||
packages = append(packages, "grub2-pc")
|
||||
}
|
||||
return packages
|
||||
}
|
||||
|
|
@ -17,10 +17,10 @@ import (
|
|||
"github.com/osbuild/images/pkg/distro/fedora"
|
||||
"github.com/osbuild/images/pkg/distro/test_distro"
|
||||
"github.com/osbuild/images/pkg/distroregistry"
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/images/pkg/rpmmd"
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/platform"
|
||||
"github.com/osbuild/osbuild-composer/internal/target"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ import (
|
|||
"github.com/osbuild/images/pkg/distro/test_distro"
|
||||
"github.com/osbuild/images/pkg/manifest"
|
||||
"github.com/osbuild/images/pkg/osbuild"
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/images/pkg/rpmmd"
|
||||
"github.com/osbuild/osbuild-composer/internal/jobqueue/fsjobqueue"
|
||||
"github.com/osbuild/osbuild-composer/internal/platform"
|
||||
"github.com/osbuild/osbuild-composer/internal/target"
|
||||
"github.com/osbuild/osbuild-composer/internal/test"
|
||||
"github.com/osbuild/osbuild-composer/internal/worker"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue