Skip to content

Commit eeddc24

Browse files
authored
Merge pull request #16853 from tmoschou/bugfix/do-not-assume-qemu-patch-version
Use the stable path for brew installed qemu firmware in machine config
2 parents d18f276 + 98cf695 commit eeddc24

File tree

1 file changed

+2
-16
lines changed
  • pkg/minikube/registry/drvs/qemu2

1 file changed

+2
-16
lines changed

pkg/minikube/registry/drvs/qemu2/qemu2.go

+2-16
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"fmt"
2222
"os"
2323
"os/exec"
24-
"path"
2524
"path/filepath"
2625
"runtime"
2726
"strings"
@@ -80,27 +79,14 @@ func qemuFirmwarePath(customPath string) (string, error) {
8079
arch := runtime.GOARCH
8180
// For macOS, find the correct brew installation path for qemu firmware
8281
if runtime.GOOS == "darwin" {
83-
var p, fw string
8482
switch arch {
8583
case "amd64":
86-
p = "/usr/local/Cellar/qemu"
87-
fw = "share/qemu/edk2-x86_64-code.fd"
84+
return "/usr/local/opt/qemu/share/qemu/edk2-x86_64-code.fd", nil
8885
case "arm64":
89-
p = "/opt/homebrew/Cellar/qemu"
90-
fw = "share/qemu/edk2-aarch64-code.fd"
86+
return "/opt/homebrew/opt/qemu/share/qemu/edk2-aarch64-code.fd", nil
9187
default:
9288
return "", fmt.Errorf("unknown arch: %s", arch)
9389
}
94-
95-
v, err := os.ReadDir(p)
96-
if err != nil {
97-
return "", fmt.Errorf("lookup qemu: %v", err)
98-
}
99-
for _, version := range v {
100-
if version.IsDir() {
101-
return path.Join(p, version.Name(), fw), nil
102-
}
103-
}
10490
}
10591

10692
switch arch {

0 commit comments

Comments
 (0)