platform/s390x: return sane values from GetZiplSupport()

The s390x platform definition would previously always return `false`
when calling its `GetZiplSupport()` method. This was obviously not
correct.

The method is meant to suite a similar purpose as `GetBIOSPlatform()`
and `GetUEFIVendor()` on BIOS / UEFI enabled platforms.

Change the S390X platform struct to contain `Zipl` member instead of
`BIOS`, which is technically more correct. Make sure that the value
set in the `Zipl` struct member is returned by `GetZiplSupport()`.

Ensure that `FirmwarePackages` from `BasePlatform` are added to the list
of packages returned by `GetPackages()`.

Adjust distro definitions using the `S390X` platform.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2023-05-17 11:52:27 +02:00 committed by Achilleas Koutsou
parent bd7f0741b2
commit 6601c32f7e
3 changed files with 13 additions and 5 deletions

View file

@ -386,7 +386,7 @@ func newDistro(name string, minor int) *distribution {
s390x.addImageTypes(
&platform.S390X{
BIOS: true,
Zipl: true,
BasePlatform: platform.BasePlatform{
ImageFormat: platform.FORMAT_QCOW2,
QCOW2Compat: "0.10",

View file

@ -403,7 +403,7 @@ func newDistro(name string, minor int) *distribution {
s390x.addImageTypes(
&platform.S390X{
BIOS: true,
Zipl: true,
BasePlatform: platform.BasePlatform{
ImageFormat: platform.FORMAT_QCOW2,
QCOW2Compat: "1.1",

View file

@ -2,22 +2,30 @@ package platform
type S390X struct {
BasePlatform
BIOS bool
Zipl bool
}
func (p *S390X) GetArch() Arch {
return ARCH_S390X
}
func (p *S390X) GetZiplSupport() bool {
return p.Zipl
}
func (p *S390X) GetPackages() []string {
return []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",
}