Skip to content

Commit

Permalink
pillar: Fix OVMF binary file for ARM64
Browse files Browse the repository at this point in the history
Commit e23b37f separated OVMF firmware
files and standardized names. However, these changes were available only
for x86_64. On arm64 we keep using the ovmf.bin binary (with the firmware
code + variables), leading to the following error:

qemu-system-aarch64: Could not find ROM image '/usr/lib/xen/boot/OVMF_CODE.fd'

This commit fixes this issue by using the ovmf.bin only for arm64.

Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
  • Loading branch information
rene committed Oct 11, 2024
1 parent 3fd2b37 commit 3acdbf9
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions pkg/pillar/cmd/zedmanager/handledomainmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ import (
"github.com/lf-edge/eve/pkg/pillar/types"
)

const (
// LegacyBIOS Legacy BIOS binary firmware
LegacyBIOS = "/usr/lib/xen/boot/seabios.bin"
// OVMFBIOSCombined UEFI OVMF BIOS firmware (code + variables)
OVMFBIOSCombined = "/usr/lib/xen/boot/ovmf.bin"
// OVMFBIOSCode UEFI OVMF BIOS firmware (only code)
OVMFBIOSCode = "/usr/lib/xen/boot/OVMF_CODE.fd"
)

// MaybeAddDomainConfig makes sure we have a DomainConfig
// Note that it does not publish it since caller often tweaks it; caller must
// call publishDomainConfig() when done with tweaks.
Expand Down Expand Up @@ -115,14 +124,18 @@ func MaybeAddDomainConfig(ctx *zedmanagerContext,
}
if dc.BootLoader == "" {
if runtime.GOARCH == "amd64" {
dc.BootLoader = "/usr/lib/xen/boot/seabios.bin"
dc.BootLoader = LegacyBIOS
} else {
dc.BootLoader = "/usr/lib/xen/boot/ovmf.bin"
dc.BootLoader = OVMFBIOSCombined
}
}
}
if dc.BootLoader == "" && (dc.VirtualizationModeOrDefault() == types.FML || runtime.GOARCH == "arm64") {
dc.BootLoader = "/usr/lib/xen/boot/OVMF_CODE.fd"
if dc.BootLoader == "" {
if dc.VirtualizationModeOrDefault() == types.FML {
dc.BootLoader = OVMFBIOSCode
} else if runtime.GOARCH == "arm64" {
dc.BootLoader = OVMFBIOSCombined
}
}
if ns != nil {
adapterCount := len(ns.AppNetAdapterList)
Expand Down

0 comments on commit 3acdbf9

Please sign in to comment.