From b07cf675ae7a2296b3182567b2313f61ec936880 Mon Sep 17 00:00:00 2001 From: Evan Lezar <7723350-elezar@users.noreply.gitlab.com> Date: Wed, 5 Jul 2023 08:43:26 +0000 Subject: [PATCH] Merge branch 'rpm-fix-missing-coreutils-during-install' into 'main' RPM spec: Avoid scriptlet failure during initial system installation See merge request nvidia/container-toolkit/container-toolkit!432 --- CHANGELOG.md | 3 +++ packaging/rpm/SPECS/nvidia-container-toolkit.spec | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 913f4d92..d17b1778 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # NVIDIA Container Toolkit Changelog +## v1.13.5 +* Remove dependency on `coreutils` when installing the NVIDIA Container Toolkit on RPM-based systems. + ## v1.13.4 * [toolkit-container] Bump CUDA base image version to 12.2.0. diff --git a/packaging/rpm/SPECS/nvidia-container-toolkit.spec b/packaging/rpm/SPECS/nvidia-container-toolkit.spec index ed44bc37..c61a47da 100644 --- a/packaging/rpm/SPECS/nvidia-container-toolkit.spec +++ b/packaging/rpm/SPECS/nvidia-container-toolkit.spec @@ -57,12 +57,14 @@ mkdir -p %{buildroot}/usr/share/containers/oci/hooks.d install -m 644 -t %{buildroot}/usr/share/containers/oci/hooks.d oci-nvidia-hook.json %post -mkdir -p %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit -cp -af %{_bindir}/nvidia-container-runtime-hook %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit +if [ $1 -gt 1 ]; then # only on package upgrade + mkdir -p %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit + cp -af %{_bindir}/nvidia-container-runtime-hook %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit +fi %posttrans if [ ! -e %{_bindir}/nvidia-container-runtime-hook ]; then - # reparing lost file nvidia-container-runtime-hook + # repairing lost file nvidia-container-runtime-hook cp -avf %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit/nvidia-container-runtime-hook %{_bindir} fi rm -rf %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit