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:
parent
682481d4d7
commit
ec8cc01f95
9 changed files with 227 additions and 141 deletions
29
internal/platform/aarch64.go
Normal file
29
internal/platform/aarch64.go
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue