Revert "Resolve symlink path for qemu directory if possible"

This reverts commit 6b6458916e (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 https://github.com/containers/podman/issues/18111

[NO NEW TESTS NEEDED]

Signed-off-by: Nathan Henrie <nate@n8henrie.com>
This commit is contained in:
Nathan Henrie 2023-04-24 08:59:13 -06:00
parent 3c53621885
commit 6014f26c47
No known key found for this signature in database
GPG Key ID: 26DE7D32DAC545A1
1 changed files with 6 additions and 16 deletions

View File

@ -46,23 +46,13 @@ func getOvmfDir(imagePath, vmName string) string {
*/
func getEdk2CodeFdPathFromQemuBinaryPath() string {
cfg, err := config.Default()
if err != nil {
return ""
if err == nil {
execPath, err := cfg.FindHelperBinary(QemuCommand, true)
if err == nil {
return filepath.Clean(filepath.Join(filepath.Dir(execPath), "..", "share", "qemu"))
}
}
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)
}
return sharePath(symlinkedPath)
return ""
}
/*