mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 08:18:32 +00:00
Rename driver-root option to root
This change renames the nvidia-ctk system create-device-nodes flag driver-root to root. This makes it clearer that this is used to load the kernel modules and is not specific to the user-mode driver installation. Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
f5a4b23041
commit
dffce25637
@ -31,8 +31,8 @@ type command struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type options struct {
|
type options struct {
|
||||||
driverRoot string
|
root string
|
||||||
devRoot string
|
devRoot string
|
||||||
|
|
||||||
dryRun bool
|
dryRun bool
|
||||||
|
|
||||||
@ -66,11 +66,15 @@ func (m command) build() *cli.Command {
|
|||||||
|
|
||||||
c.Flags = []cli.Flag{
|
c.Flags = []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "driver-root",
|
Name: "root",
|
||||||
Usage: "the path to the driver root. Device nodes will be created at `DRIVER_ROOT`/dev",
|
// TODO: Remove this alias
|
||||||
|
Aliases: []string{"driver-root"},
|
||||||
|
Usage: "the path to to the root to use to load the kernel modules. This root must be a chrootable path. " +
|
||||||
|
"If device nodes to be created these will be created at `ROOT`/dev unless an alternative path is specified",
|
||||||
Value: "/",
|
Value: "/",
|
||||||
Destination: &opts.driverRoot,
|
Destination: &opts.root,
|
||||||
EnvVars: []string{"NVIDIA_DRIVER_ROOT", "DRIVER_ROOT"},
|
// TODO: Remove the NVIDIA_DRIVER_ROOT and DRIVER_ROOT envvars.
|
||||||
|
EnvVars: []string{"ROOT", "NVIDIA_DRIVER_ROOT", "DRIVER_ROOT"},
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "dev-root",
|
Name: "dev-root",
|
||||||
@ -101,9 +105,9 @@ func (m command) build() *cli.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m command) validateFlags(r *cli.Context, opts *options) error {
|
func (m command) validateFlags(r *cli.Context, opts *options) error {
|
||||||
if opts.devRoot == "" && opts.driverRoot != "" {
|
if opts.devRoot == "" && opts.root != "" {
|
||||||
m.logger.Infof("Using dev-root %q", opts.driverRoot)
|
m.logger.Infof("Using dev-root %q", opts.root)
|
||||||
opts.devRoot = opts.driverRoot
|
opts.devRoot = opts.root
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -113,7 +117,7 @@ func (m command) run(c *cli.Context, opts *options) error {
|
|||||||
modules := nvmodules.New(
|
modules := nvmodules.New(
|
||||||
nvmodules.WithLogger(m.logger),
|
nvmodules.WithLogger(m.logger),
|
||||||
nvmodules.WithDryRun(opts.dryRun),
|
nvmodules.WithDryRun(opts.dryRun),
|
||||||
nvmodules.WithRoot(opts.driverRoot),
|
nvmodules.WithRoot(opts.root),
|
||||||
)
|
)
|
||||||
if err := modules.LoadAll(); err != nil {
|
if err := modules.LoadAll(); err != nil {
|
||||||
return fmt.Errorf("failed to load NVIDIA kernel modules: %v", err)
|
return fmt.Errorf("failed to load NVIDIA kernel modules: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user