Skip to content

Commit

Permalink
Revert "Resolve symlink path for qemu directory if possible"
Browse files Browse the repository at this point in the history
This reverts commit 6b64589 (Resolve
symlink path for qemu directory if possible).

Fully resolving the symlink to qemu solves some issues for
aarch64-darwin nix with regards to finding `edk2-aarch64-code.fd`, but
unfortunately the fully resolved path includes the version number,
making it so that even patch updates break the path to
homebrew-installed qemu files.

Fixes #18111

[NO NEW TESTS NEEDED]

Signed-off-by: Nathan Henrie <[email protected]>
  • Loading branch information
n8henrie committed Apr 24, 2023
1 parent 3c53621 commit 6014f26
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions pkg/machine/qemu/options_darwin_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,13 @@ func getOvmfDir(imagePath, vmName string) string {
*/
func getEdk2CodeFdPathFromQemuBinaryPath() string {
cfg, err := config.Default()
if err != nil {
return ""
}
execPath, err := cfg.FindHelperBinary(QemuCommand, true)
if err != nil {
return ""
}

sharePath := func(path string) string {
return filepath.Clean(filepath.Join(filepath.Dir(path), "..", "share", "qemu"))
}

symlinkedPath, err := filepath.EvalSymlinks(execPath)
if err != nil {
return sharePath(execPath)
if err == nil {
execPath, err := cfg.FindHelperBinary(QemuCommand, true)
if err == nil {
return filepath.Clean(filepath.Join(filepath.Dir(execPath), "..", "share", "qemu"))
}
}
return sharePath(symlinkedPath)
return ""
}

/*
Expand Down

0 comments on commit 6014f26

Please sign in to comment.