libraryDirectoryPath returns the library directory. It returns a multiarch directory if the distribution is Debian or a derivative. Based on https://github.com/NVIDIA/libnvidia-container/blob/v1.15.0/src/nvc_container.c#L152-L165
(m mounter)
| 26 | // |
| 27 | // Based on https://github.com/NVIDIA/libnvidia-container/blob/v1.15.0/src/nvc_container.c#L152-L165 |
| 28 | func libraryDirectoryPath(m mounter) (string, error) { |
| 29 | // Debian and its derivatives use a multiarch directory scheme. |
| 30 | if _, err := m.Stat(debianVersionFile); err != nil && !errors.Is(err, os.ErrNotExist) { |
| 31 | return "", fmt.Errorf("check if debian: %w", err) |
| 32 | } else if err == nil { |
| 33 | return usrLibMultiarchDir, nil |
| 34 | } |
| 35 | |
| 36 | return usrLibDir, nil |
| 37 | } |
| 38 | |
| 39 | // libraryDirectorySymlinks returns a mapping of each library (basename) with a |
| 40 | // list of their symlinks (basename). Libraries with no symlinks do not appear |