Merge branch 'fix-cdi-spec-generation-on-debian' into 'main'

Resolve all symlinks when finding libraries in LDCache

See merge request nvidia/container-toolkit/container-toolkit!370
This commit is contained in:
Evan Lezar 2023-04-24 10:09:37 +00:00
commit 926ac77bc0
3 changed files with 4 additions and 5 deletions

View File

@ -5,6 +5,7 @@
* Update `update-ldcache` hook to only update ldcache if it exists.
* Update `update-ldcache` hook to create `/etc/ld.so.conf.d` folder if it doesn't exist.
* Fix failure when libcuda cannot be located during XOrg library discovery.
* Fix CDI spec generation on systems that use `/etc/alternatives` (e.g. Debian)
## v1.13.0

View File

@ -307,11 +307,7 @@ func (c *ldcache) resolve(target string) (string, error) {
link = filepath.Join(filepath.Dir(target), link)
}
// Ensure that the returned path is relative to the root.
link = filepath.Join(c.root, link)
c.logger.Debugf("Resolved link: '%v' => '%v'", name, link)
return link, nil
return c.resolve(link)
}
// bytesToString converts a byte slice to a string.

View File

@ -94,6 +94,8 @@ func (l *cudaLocator) Locate(pattern string) ([]string, error) {
"/usr/lib64",
"/usr/lib/x86_64-linux-gnu",
"/usr/lib/aarch64-linux-gnu",
"/usr/lib/x86_64-linux-gnu/nvidia/current",
"/usr/lib/aarch64-linux-gnu/nvidia/current",
),
lookup.WithCount(1),
)