Skip to content

Commit fc7c8f7

Browse files
committed
Resolve all symlinks in ldcache
Signed-off-by: Evan Lezar <[email protected]>
1 parent 46c1c45 commit fc7c8f7

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Update `update-ldcache` hook to only update ldcache if it exists.
66
* Update `update-ldcache` hook to create `/etc/ld.so.conf.d` folder if it doesn't exist.
77
* Fix failure when libcuda cannot be located during XOrg library discovery.
8+
* Fix CDI spec generation on systems that use `/etc/alternatives` (e.g. Debian)
89

910
## v1.13.0
1011

internal/ldcache/ldcache.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,7 @@ func (c *ldcache) resolve(target string) (string, error) {
307307
link = filepath.Join(filepath.Dir(target), link)
308308
}
309309

310-
// Ensure that the returned path is relative to the root.
311-
link = filepath.Join(c.root, link)
312-
313-
c.logger.Debugf("Resolved link: '%v' => '%v'", name, link)
314-
return link, nil
310+
return c.resolve(link)
315311
}
316312

317313
// bytesToString converts a byte slice to a string.

internal/lookup/cuda/cuda.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ func (l *cudaLocator) Locate(pattern string) ([]string, error) {
9494
"/usr/lib64",
9595
"/usr/lib/x86_64-linux-gnu",
9696
"/usr/lib/aarch64-linux-gnu",
97-
"/usr/lib/current",
97+
"/usr/lib/x86_64-linux-gnu/nvidia/current",
98+
"/usr/lib/aarch64-linux-gnu/nvidia/current",
9899
),
99100
lookup.WithCount(1),
100101
)

0 commit comments

Comments
 (0)