@@ -20,12 +20,10 @@ import (
2020 "errors"
2121 "fmt"
2222 "path/filepath"
23- "strings"
2423
2524 "github.com/urfave/cli/v2"
2625
2726 "github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-cdi-hook/utils"
28- "github.com/NVIDIA/nvidia-container-toolkit/internal/config"
2927 "github.com/NVIDIA/nvidia-container-toolkit/internal/logger"
3028 "github.com/NVIDIA/nvidia-container-toolkit/internal/oci"
3129)
@@ -115,7 +113,7 @@ func (m command) run(c *cli.Context, cfg *options) error {
115113 return fmt .Errorf ("failed to determined container root: %v" , err )
116114 }
117115
118- ldconfigPath := m . resolveLDConfigPath (cfg .ldconfigPath )
116+ ldconfigPath := utils . ResolveHostLDConfigPath (cfg .ldconfigPath )
119117 args := []string {filepath .Base (ldconfigPath )}
120118 if containerRootDir != "" {
121119 args = append (args , "-r" , containerRootDir )
@@ -146,10 +144,3 @@ func (m command) run(c *cli.Context, cfg *options) error {
146144
147145 return m .Exec (ldconfigPath , args , nil )
148146}
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