platform: introduce hardware platform abstraction

These objects describes the hardware an image runs on. Including
 - architecture
 - bootloader
 - required firmware

Use the platform abstraction to move firmware packages out of the package set
definitions.
This commit is contained in:
Tom Gundersen 2022-07-05 17:43:03 +01:00
parent 682481d4d7
commit ec8cc01f95
9 changed files with 227 additions and 141 deletions

View file

@ -0,0 +1,29 @@
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
}