@@ -20,12 +20,10 @@ import (
20
20
"errors"
21
21
"fmt"
22
22
"path/filepath"
23
- "strings"
24
23
25
24
"github.com/urfave/cli/v2"
26
25
27
26
"github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-cdi-hook/utils"
28
- "github.com/NVIDIA/nvidia-container-toolkit/internal/config"
29
27
"github.com/NVIDIA/nvidia-container-toolkit/internal/logger"
30
28
"github.com/NVIDIA/nvidia-container-toolkit/internal/oci"
31
29
)
@@ -115,7 +113,7 @@ func (m command) run(c *cli.Context, cfg *options) error {
115
113
return fmt .Errorf ("failed to determined container root: %v" , err )
116
114
}
117
115
118
- ldconfigPath := m . resolveLDConfigPath (cfg .ldconfigPath )
116
+ ldconfigPath := utils . ResolveHostLDConfigPath (cfg .ldconfigPath )
119
117
args := []string {filepath .Base (ldconfigPath )}
120
118
if containerRootDir != "" {
121
119
args = append (args , "-r" , containerRootDir )
@@ -146,10 +144,3 @@ func (m command) run(c *cli.Context, cfg *options) error {
146
144
147
145
return m .Exec (ldconfigPath , args , nil )
148
146
}
149
-
150
- // resolveLDConfigPath determines the LDConfig path to use for the system.
151
- // On systems such as Ubuntu where `/sbin/ldconfig` is a wrapper around
152
- // /sbin/ldconfig.real, the latter is returned.
153
- func (m command ) resolveLDConfigPath (path string ) string {
154
- return strings .TrimPrefix (config .NormalizeLDConfigPath ("@" + path ), "@" )
155
- }
0 commit comments