Since the creation of a .conf file in /etc/ld.so.conf.d is shared by
both the update-ldcache and enable-cuda-compat hooks, this is moved
to the ContainerRoot type.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
Thsi change moves the ContainerRoot type to the oci package and updates
state.GetContainerRootDirPath to return a variable of type ContainerRoot. This
enabled better reuse between hooks.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This change updates how the lconfig arguments are constructed. This
makes the update-ldcache more robust and ensures that folders are
specified last if at al.
Checks are also included for empty container roots at the start of the
hook to simplify later checks.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This change ensures that the created /etc/ld.so.conf.d file
has a higher priority to ensure that the injected libraries
take precendence over non-compat libraries.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This change creates an nvidia-cdi-hook binary for implementing
CDI hooks. This allows for these hooks to be separated from the
nvidia-ctk command which may, for example, require libnvidia-ml
to support other functionality.
The nvidia-ctk hook subcommand is maintained as an alias for the
time being to allow for existing CDI specifications referring to
this path to work as expected.
Signed-off-by: Avi Deitcher <avi@deitcher.net>