diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-06-14 18:02:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-14 18:02:27 +0000 |
commit | a22e270ef62efafa598978b179afa22dc0813101 (patch) | |
tree | 19f2f141f493ebb46634c545ee04b74de1a1ffde /pkg/machine | |
parent | 1cf3e4cda49507ec7794d8f908ec78de358066e4 (diff) | |
parent | 8fbb933f5abfc19994aab65d24e929587f6999ef (diff) | |
download | podman-a22e270ef62efafa598978b179afa22dc0813101.tar.gz podman-a22e270ef62efafa598978b179afa22dc0813101.tar.bz2 podman-a22e270ef62efafa598978b179afa22dc0813101.zip |
Merge pull request #14324 from anjannath/qemu-test
[macos: podman-machine] look for firmware (edk2-code-fd) based on the path of qemu binary
Diffstat (limited to 'pkg/machine')
-rw-r--r-- | pkg/machine/qemu/options_darwin_arm64.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/machine/qemu/options_darwin_arm64.go b/pkg/machine/qemu/options_darwin_arm64.go index 8930041b7..d75237938 100644 --- a/pkg/machine/qemu/options_darwin_arm64.go +++ b/pkg/machine/qemu/options_darwin_arm64.go @@ -4,6 +4,8 @@ import ( "os" "os/exec" "path/filepath" + + "github.com/containers/common/pkg/config" ) var ( @@ -38,6 +40,22 @@ func getOvmfDir(imagePath, vmName string) string { } /* + * When QEmu is installed in a non-default location in the system + * we can use the qemu-system-* binary path to figure the install + * location for Qemu and use it to look for edk2-code-fd + */ +func getEdk2CodeFdPathFromQemuBinaryPath() string { + cfg, err := config.Default() + if err == nil { + execPath, err := cfg.FindHelperBinary(QemuCommand, true) + if err == nil { + return filepath.Clean(filepath.Join(filepath.Dir(execPath), "..", "share", "qemu")) + } + } + return "" +} + +/* * QEmu can be installed in multiple locations on MacOS, especially on * Apple Silicon systems. A build from source will likely install it in * /usr/local/bin, whereas Homebrew package management standard is to @@ -45,6 +63,7 @@ func getOvmfDir(imagePath, vmName string) string { */ func getEdk2CodeFd(name string) string { dirs := []string{ + getEdk2CodeFdPathFromQemuBinaryPath(), "/opt/homebrew/opt/podman/libexec/share/qemu", "/usr/local/share/qemu", "/opt/homebrew/share/qemu", |