mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Automatic regeneration of /var/run/cdi/nvidia.yaml New units: • nvidia-cdi-refresh.service – one-shot wrapper for nvidia-ctk cdi generate (adds sleep + required caps). • nvidia-cdi-refresh.path – fires on driver install/upgrade via modules.dep.bin changes. Packaging • RPM %post reloads systemd and enables the path unit on fresh installs. • DEB postinst does the same (configure, skip on upgrade). Result: CDI spec is always up to date Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
32 lines
666 B
Bash
32 lines
666 B
Bash
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
case "$1" in
|
|
configure)
|
|
/usr/bin/nvidia-ctk --quiet config --config-file=/etc/nvidia-container-runtime/config.toml --in-place
|
|
|
|
if command -v systemctl >/dev/null 2>&1 \
|
|
&& systemctl --quiet is-system-running 2>/dev/null; then
|
|
|
|
systemctl daemon-reload || true
|
|
|
|
if [ -z "$2" ]; then # $2 empty → first install
|
|
systemctl enable --now nvidia-cdi-refresh.path || true
|
|
fi
|
|
fi
|
|
;;
|
|
|
|
abort-upgrade|abort-remove|abort-deconfigure)
|
|
;;
|
|
|
|
*)
|
|
echo "postinst called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
#DEBHELPER#
|
|
|
|
exit 0
|