Commit Graph

9 Commits

Author SHA1 Message Date
Evan Lezar
15645e6cd5
Move resolution of host LDConfig to config package
Signed-off-by: Evan Lezar <elezar@nvidia.com>
2025-03-20 13:23:59 +02:00
Evan Lezar
4088430fc1
Move SafeExec logic to internal safeexec package
Signed-off-by: Evan Lezar <elezar@nvidia.com>
2025-03-20 13:22:55 +02:00
Evan Lezar
715e09fbd4
Move CreateLdsoconfdFile to ContainerRoot
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>
2025-03-20 13:21:52 +02:00
Evan Lezar
13bbf71ead
Move ContainerRoot type to oci package
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>
2025-03-20 13:21:51 +02:00
Evan Lezar
995e56306d
Fix update-ldcache arguments
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>
2025-03-20 12:51:31 +02:00
Evan Lezar
52b9631333
Use libcontainer execseal to run ldconfig
This change copies ldconfig into a memfd before executing it from
the createContainer hook.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2025-02-27 13:52:27 +02:00
Evan Lezar
9429fbac5f
[no-relnote] Move root to separate file
Signed-off-by: Evan Lezar <elezar@nvidia.com>
2025-02-27 13:48:29 +02:00
Evan Lezar
4f0de9f1ef Increase priority of ld.so.conf.d config file
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>
2024-06-13 13:49:14 +02:00
Avi Deitcher
179d8655f9 Move nvidia-ctk hook command into own binary
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>
2024-05-21 12:19:44 +02:00