From d50e7f1f4fe7be3e8ce08ea9c679c1f60d23329e Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 27 Feb 2023 14:39:54 +0200 Subject: [PATCH 01/11] Bump version to 1.12.1 Signed-off-by: Evan Lezar --- CHANGELOG.md | 10 ++++++++++ third_party/libnvidia-container | 2 +- versions.mk | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5930cd5..15f07001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # NVIDIA Container Toolkit Changelog +## v1.12.1 + +* Don't fail chmod hook if paths are not injected +* Fix possible blank `nvidia-ctk` path in generated CDI specifications +* Fix error in postun scriplet on RPM-based systems +* Fix missing NVML symbols when running `nvidia-ctk` on some platforms [#49] +* Discover all `gsb*.bin` GSP firmware files when generating CDI specification. +* Remove `fedora35` packaging targets +* [libnvidia-container] Include all `gsp*.bin` firmware files if present + ## v1.12.0 * Promote `v1.12.0-rc.5` to `v1.12.0` diff --git a/third_party/libnvidia-container b/third_party/libnvidia-container index 7678e1af..abf9758e 160000 --- a/third_party/libnvidia-container +++ b/third_party/libnvidia-container @@ -1 +1 @@ -Subproject commit 7678e1af094d865441d0bc1b97c3e72d15fcab50 +Subproject commit abf9758ec8d98118119892441614270336c3257c diff --git a/versions.mk b/versions.mk index 7569e232..aca2ffca 100644 --- a/versions.mk +++ b/versions.mk @@ -13,7 +13,7 @@ # limitations under the License. LIB_NAME := nvidia-container-toolkit -LIB_VERSION := 1.12.0 +LIB_VERSION := 1.12.1 # Specify the nvidia-docker2 and nvidia-container-runtime package versions. # Note: The build tooling uses `LIB_TAG` above as the version tag. From bc81d5e68b9e0e7b703cd32dbcffb9affbb9be4c Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 27 Feb 2023 14:53:07 +0200 Subject: [PATCH 02/11] Update libnvidia-container Signed-off-by: Evan Lezar --- third_party/libnvidia-container | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/libnvidia-container b/third_party/libnvidia-container index abf9758e..7440a1ea 160000 --- a/third_party/libnvidia-container +++ b/third_party/libnvidia-container @@ -1 +1 @@ -Subproject commit abf9758ec8d98118119892441614270336c3257c +Subproject commit 7440a1ead8e4fe35edf1c973c73a662108b21a1f From 599530555470daeb4836aa094bcf213237ec8fd2 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 27 Feb 2023 14:51:03 +0200 Subject: [PATCH 03/11] Skip component updates on release-* branches Signed-off-by: Evan Lezar --- scripts/build-packages.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index 89e28eda..c1e47b82 100755 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -52,14 +52,6 @@ else targets=${all[@]} fi -echo "Updating components" -"${SCRIPTS_DIR}/update-components.sh" -if [[ -n $(git status -s third_party) && ${ALLOW_LOCAL_COMPONENT_CHANGES} != "true" ]]; then - echo "ERROR: Building with local component changes." - echo "Commit pending changes or rerun with ALLOW_LOCAL_COMPONENT_CHANGES='true'" - exit 1 -fi - eval $(${SCRIPTS_DIR}/get-component-versions.sh) From 944922a541f38d919df6b801d607d02efc86e864 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 31 Jan 2023 15:35:14 +0100 Subject: [PATCH 04/11] Remove fedora35 pipeline targets Signed-off-by: Evan Lezar --- .common-ci.yml | 7 ------- .gitlab-ci.yml | 16 ---------------- 2 files changed, 23 deletions(-) diff --git a/.common-ci.yml b/.common-ci.yml index c28bf25e..afd01f50 100644 --- a/.common-ci.yml +++ b/.common-ci.yml @@ -77,13 +77,6 @@ stages: DIST: debian9 PACKAGE_REPO_TYPE: debian -.dist-fedora35: - rules: - - !reference [.main-or-manual, rules] - variables: - DIST: fedora35 - PACKAGE_REPO_TYPE: rpm - .dist-opensuse-leap15.1: rules: - !reference [.main-or-manual, rules] diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5693a885..0517f9c7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -158,18 +158,6 @@ package-debian9-amd64: - .dist-debian9 - .arch-amd64 -package-fedora35-aarch64: - extends: - - .package-build - - .dist-fedora35 - - .arch-aarch64 - -package-fedora35-x86_64: - extends: - - .package-build - - .dist-fedora35 - - .arch-x86_64 - package-opensuse-leap15.1-x86_64: extends: - .package-build @@ -300,10 +288,6 @@ image-packaging: optional: true - job: package-debian9-amd64 optional: true - - job: package-fedora35-aarch64 - optional: true - - job: package-fedora35-x86_64 - optional: true - job: package-opensuse-leap15.1-x86_64 optional: true - job: package-ubuntu16.04-amd64 From a2d1f4cfb459ef614b6e1d25426e71eee974a813 Mon Sep 17 00:00:00 2001 From: Evan Lezar <7723350-elezar@users.noreply.gitlab.com> Date: Fri, 10 Feb 2023 14:17:53 +0000 Subject: [PATCH 05/11] Merge branch 'update-ldflags' into 'main' Update ldflags for cgo See merge request nvidia/container-toolkit/container-toolkit!290 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a9fc1ffe..7f7d375b 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ cmd-%: COMMAND_BUILD_OPTIONS = -o $(PREFIX)/$(*) endif cmds: $(CMD_TARGETS) $(CMD_TARGETS): cmd-%: - GOOS=$(GOOS) go build -ldflags "-s -w -X $(CLI_VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) -X $(CLI_VERSION_PACKAGE).version=$(CLI_VERSION)" $(COMMAND_BUILD_OPTIONS) $(MODULE)/cmd/$(*) + GOOS=$(GOOS) go build -ldflags "-extldflags=-Wl,-z,lazy -s -w -X $(CLI_VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) -X $(CLI_VERSION_PACKAGE).version=$(CLI_VERSION)" $(COMMAND_BUILD_OPTIONS) $(MODULE)/cmd/$(*) build: GOOS=$(GOOS) go build ./... From 2081750bea5be3f96605e810889a64dddb7174e2 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Thu, 16 Feb 2023 13:09:47 +0000 Subject: [PATCH 06/11] Merge branch 'support-multimple-firmware-files' into 'main' Add globbing for mounting multiple GSP firmware files See merge request nvidia/container-toolkit/container-toolkit!295 --- cmd/nvidia-ctk/cdi/generate/driver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/nvidia-ctk/cdi/generate/driver.go b/cmd/nvidia-ctk/cdi/generate/driver.go index 97f1506a..7e5600fc 100644 --- a/cmd/nvidia-ctk/cdi/generate/driver.go +++ b/cmd/nvidia-ctk/cdi/generate/driver.go @@ -87,7 +87,7 @@ func NewDriverLibraryDiscoverer(logger *logrus.Logger, driverRoot string, nvidia // NewDriverFirmwareDiscoverer creates a discoverer for GSP firmware associated with the specified driver version. func NewDriverFirmwareDiscoverer(logger *logrus.Logger, driverRoot string, version string) discover.Discover { - gspFirmwarePath := filepath.Join("/lib/firmware/nvidia", version, "gsp.bin") + gspFirmwarePath := filepath.Join("/lib/firmware/nvidia", version, "gsp*.bin") return discover.NewMounts( logger, lookup.NewFileLocator( From bc37b97c73a8a24bfd926b0edc9b6fce9cf12735 Mon Sep 17 00:00:00 2001 From: Evan Lezar <7723350-elezar@users.noreply.gitlab.com> Date: Thu, 16 Feb 2023 13:58:43 +0000 Subject: [PATCH 07/11] Merge branch 'fix-nvidia-ctk-path' into 'main' Fix issue with blank nvidia-ctk path See merge request nvidia/container-toolkit/container-toolkit!297 --- internal/discover/hooks.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/discover/hooks.go b/internal/discover/hooks.go index 708260e1..dfe98988 100644 --- a/internal/discover/hooks.go +++ b/internal/discover/hooks.go @@ -47,6 +47,9 @@ func FindNvidiaCTK(logger *logrus.Logger, nvidiaCTKPath string) string { return nvidiaCTKPath } + if nvidiaCTKPath == "" { + nvidiaCTKPath = nvidiaCTKExecutable + } logger.Debugf("Locating NVIDIA Container Toolkit CLI as %v", nvidiaCTKPath) lookup := lookup.NewExecutableLocator(logger, "") hookPath := nvidiaCTKDefaultFilePath From d5ab1c0ba0f6cdfb0f26151078e9aa4cfc3f904e Mon Sep 17 00:00:00 2001 From: Evan Lezar <7723350-elezar@users.noreply.gitlab.com> Date: Mon, 20 Feb 2023 08:29:44 +0000 Subject: [PATCH 08/11] Merge branch 'fix-nvidia-ctk-path' into 'main' Ensure that generate uses a consistent nvidia-ctk path See merge request nvidia/container-toolkit/container-toolkit!301 --- cmd/nvidia-ctk/cdi/generate/generate.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/nvidia-ctk/cdi/generate/generate.go b/cmd/nvidia-ctk/cdi/generate/generate.go index 66fc32dd..79a1cf6e 100644 --- a/cmd/nvidia-ctk/cdi/generate/generate.go +++ b/cmd/nvidia-ctk/cdi/generate/generate.go @@ -122,6 +122,8 @@ func (m command) validateFlags(r *cli.Context, cfg *config) error { return err } + cfg.nvidiaCTKPath = discover.FindNvidiaCTK(m.logger, cfg.nvidiaCTKPath) + return nil } From 7df553ad098a1f69bc2cec6f7f8c586fb939f8ea Mon Sep 17 00:00:00 2001 From: Evan Lezar <7723350-elezar@users.noreply.gitlab.com> Date: Wed, 22 Feb 2023 15:20:26 +0000 Subject: [PATCH 09/11] Merge branch 'CNT-3965/dont-fail-chmod-hook' into 'main' Skip paths with errors in chmod hook See merge request nvidia/container-toolkit/container-toolkit!303 --- cmd/nvidia-ctk/hook/chmod/chmod.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/nvidia-ctk/hook/chmod/chmod.go b/cmd/nvidia-ctk/hook/chmod/chmod.go index cad6edfa..0a78b6e8 100644 --- a/cmd/nvidia-ctk/hook/chmod/chmod.go +++ b/cmd/nvidia-ctk/hook/chmod/chmod.go @@ -18,6 +18,7 @@ package chmod import ( "fmt" + "os" "path/filepath" "strings" "syscall" @@ -133,7 +134,12 @@ func (m command) run(c *cli.Context, cfg *config) error { func (m command) getPaths(root string, paths []string) []string { var pathsInRoot []string for _, f := range paths { - pathsInRoot = append(pathsInRoot, filepath.Join(root, f)) + path := filepath.Join(root, f) + if _, err := os.Stat(path); err != nil { + m.logger.Debugf("Skipping path %q: %v", path, err) + continue + } + pathsInRoot = append(pathsInRoot, path) } return pathsInRoot From 9fc25ac64191720b435b94af7c846ed76411a437 Mon Sep 17 00:00:00 2001 From: Evan Lezar <7723350-elezar@users.noreply.gitlab.com> Date: Mon, 27 Feb 2023 11:48:33 +0000 Subject: [PATCH 10/11] Merge branch 'remove-outdated-platforms' into 'main' Remove outdated platforms from CI See merge request nvidia/container-toolkit/container-toolkit!310 --- .common-ci.yml | 31 +++------------- .gitlab-ci.yml | 71 ++++++++----------------------------- .nvidia-ci.yml | 16 ++------- build/container/Makefile | 5 +-- scripts/build-packages.sh | 6 ---- scripts/release-packages.sh | 6 ---- 6 files changed, 22 insertions(+), 113 deletions(-) diff --git a/.common-ci.yml b/.common-ci.yml index afd01f50..fb2ff90d 100644 --- a/.common-ci.yml +++ b/.common-ci.yml @@ -70,13 +70,6 @@ stages: DIST: debian10 PACKAGE_REPO_TYPE: debian -.dist-debian9: - rules: - - !reference [.main-or-manual, rules] - variables: - DIST: debian9 - PACKAGE_REPO_TYPE: debian - .dist-opensuse-leap15.1: rules: - !reference [.main-or-manual, rules] @@ -92,13 +85,6 @@ stages: CVE_UPDATES: "cyrus-sasl-lib" PACKAGE_REPO_TYPE: rpm -.dist-ubuntu16.04: - rules: - - !reference [.main-or-manual, rules] - variables: - DIST: ubuntu16.04 - PACKAGE_REPO_TYPE: debian - .dist-ubuntu18.04: variables: DIST: ubuntu18.04 @@ -106,8 +92,6 @@ stages: PACKAGE_REPO_TYPE: debian .dist-ubuntu20.04: - rules: - - !reference [.main-or-manual, rules] variables: DIST: ubuntu20.04 CVE_UPDATES: "libsasl2-2 libsasl2-modules-db" @@ -252,22 +236,15 @@ release:staging-ubi8: needs: - image-ubi8 -release:staging-ubuntu18.04: - extends: - - .release:staging - - .dist-ubuntu18.04 - needs: - - test-toolkit-ubuntu18.04 - - test-containerd-ubuntu18.04 - - test-crio-ubuntu18.04 - - test-docker-ubuntu18.04 - release:staging-ubuntu20.04: extends: - .release:staging - .dist-ubuntu20.04 needs: - - image-ubuntu20.04 + - test-toolkit-ubuntu20.04 + - test-containerd-ubuntu20.04 + - test-crio-ubuntu20.04 + - test-docker-ubuntu20.04 release:staging-packaging: extends: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0517f9c7..7a338002 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -116,12 +116,6 @@ package-amazonlinux2-x86_64: - .dist-amazonlinux2 - .arch-x86_64 -package-centos7-ppc64le: - extends: - - .package-build - - .dist-centos7 - - .arch-ppc64le - package-centos7-x86_64: extends: - .package-build @@ -152,30 +146,12 @@ package-debian10-amd64: - .dist-debian10 - .arch-amd64 -package-debian9-amd64: - extends: - - .package-build - - .dist-debian9 - - .arch-amd64 - package-opensuse-leap15.1-x86_64: extends: - .package-build - .dist-opensuse-leap15.1 - .arch-x86_64 -package-ubuntu16.04-amd64: - extends: - - .package-build - - .dist-ubuntu16.04 - - .arch-amd64 - -package-ubuntu16.04-ppc64le: - extends: - - .package-build - - .dist-ubuntu16.04 - - .arch-ppc64le - package-ubuntu18.04-amd64: extends: - .package-build @@ -228,7 +204,6 @@ image-centos7: - .package-artifacts - .dist-centos7 needs: - - package-centos7-ppc64le - package-centos7-x86_64 image-ubi8: @@ -242,17 +217,6 @@ image-ubi8: - package-centos8-x86_64 - package-centos8-ppc64le -image-ubuntu18.04: - extends: - - .image-build - - .package-artifacts - - .dist-ubuntu18.04 - needs: - - package-ubuntu18.04-amd64 - - package-ubuntu18.04-arm64 - - job: package-ubuntu18.04-ppc64le - optional: true - image-ubuntu20.04: extends: - .image-build @@ -261,7 +225,8 @@ image-ubuntu20.04: needs: - package-ubuntu18.04-amd64 - package-ubuntu18.04-arm64 - - package-ubuntu18.04-ppc64le + - job: package-ubuntu18.04-ppc64le + optional: true # The DIST=packaging target creates an image containing all built packages image-packaging: @@ -278,22 +243,14 @@ image-packaging: optional: true - job: package-amazonlinux2-x86_64 optional: true - - job: package-centos7-ppc64le - optional: true - job: package-centos7-x86_64 optional: true - job: package-centos8-ppc64le optional: true - job: package-debian10-amd64 optional: true - - job: package-debian9-amd64 - optional: true - job: package-opensuse-leap15.1-x86_64 optional: true - - job: package-ubuntu16.04-amd64 - optional: true - - job: package-ubuntu16.04-ppc64le - optional: true - job: package-ubuntu18.04-ppc64le optional: true @@ -327,31 +284,31 @@ image-packaging: TEST_CASES: "crio" # Define the test targets -test-toolkit-ubuntu18.04: +test-toolkit-ubuntu20.04: extends: - .test:toolkit - - .dist-ubuntu18.04 + - .dist-ubuntu20.04 needs: - - image-ubuntu18.04 + - image-ubuntu20.04 -test-containerd-ubuntu18.04: +test-containerd-ubuntu20.04: extends: - .test:containerd - - .dist-ubuntu18.04 + - .dist-ubuntu20.04 needs: - - image-ubuntu18.04 + - image-ubuntu20.04 -test-crio-ubuntu18.04: +test-crio-ubuntu20.04: extends: - .test:crio - - .dist-ubuntu18.04 + - .dist-ubuntu20.04 needs: - - image-ubuntu18.04 + - image-ubuntu20.04 -test-docker-ubuntu18.04: +test-docker-ubuntu20.04: extends: - .test:docker - - .dist-ubuntu18.04 + - .dist-ubuntu20.04 needs: - - image-ubuntu18.04 + - image-ubuntu20.04 diff --git a/.nvidia-ci.yml b/.nvidia-ci.yml index 1a82598a..51b3a58a 100644 --- a/.nvidia-ci.yml +++ b/.nvidia-ci.yml @@ -79,11 +79,6 @@ image-ubi8: - .dist-ubi8 - .image-pull -image-ubuntu18.04: - extends: - - .dist-ubuntu18.04 - - .image-pull - image-ubuntu20.04: extends: - .dist-ubuntu20.04 @@ -230,12 +225,12 @@ release:packages:kitmaker: extends: - .release:packages -release:staging-ubuntu18.04: +release:staging-ubuntu20.04: extends: - .release:staging - - .dist-ubuntu18.04 + - .dist-ubuntu20.04 needs: - - image-ubuntu18.04 + - image-ubuntu20.04 # Define the external release targets # Release to NGC @@ -244,11 +239,6 @@ release:ngc-centos7: - .dist-centos7 - .release:ngc -release:ngc-ubuntu18.04: - extends: - - .dist-ubuntu18.04 - - .release:ngc - release:ngc-ubuntu20.04: extends: - .dist-ubuntu20.04 diff --git a/build/container/Makefile b/build/container/Makefile index 32fd8fa6..da244a53 100644 --- a/build/container/Makefile +++ b/build/container/Makefile @@ -44,7 +44,7 @@ OUT_IMAGE = $(OUT_IMAGE_NAME):$(OUT_IMAGE_TAG) ##### Public rules ##### DEFAULT_PUSH_TARGET := ubuntu20.04 -DISTRIBUTIONS := ubuntu20.04 ubuntu18.04 ubi8 centos7 +DISTRIBUTIONS := ubuntu20.04 ubi8 centos7 META_TARGETS := packaging @@ -146,10 +146,7 @@ test-packaging: @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/centos8/ppc64le" || echo "Missing centos8/ppc64le" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/centos8/x86_64" || echo "Missing centos8/x86_64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/debian10/amd64" || echo "Missing debian10/amd64" - @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/debian9/amd64" || echo "Missing debian9/amd64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/opensuse-leap15.1/x86_64" || echo "Missing opensuse-leap15.1/x86_64" - @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/ubuntu16.04/amd64" || echo "Missing ubuntu16.04/amd64" - @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/ubuntu16.04/ppc64le" || echo "Missing ubuntu16.04/ppc64le" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/ubuntu18.04/amd64" || echo "Missing ubuntu18.04/amd64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/ubuntu18.04/arm64" || echo "Missing ubuntu18.04/arm64" @$(DOCKER) run --rm $(IMAGE) test -d "/artifacts/packages/ubuntu18.04/ppc64le" || echo "Missing ubuntu18.04/ppc64le" diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index c1e47b82..de0d658b 100755 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -29,18 +29,12 @@ SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../scripts && pwd )" all=( amazonlinux2-aarch64 amazonlinux2-x86_64 - centos7-ppc64le centos7-x86_64 centos8-aarch64 centos8-ppc64le centos8-x86_64 debian10-amd64 - debian9-amd64 - fedora35-aarch64 - fedora35-x86_64 opensuse-leap15.1-x86_64 - ubuntu16.04-amd64 - ubuntu16.04-ppc64le ubuntu18.04-amd64 ubuntu18.04-arm64 ubuntu18.04-ppc64le diff --git a/scripts/release-packages.sh b/scripts/release-packages.sh index d15e2ae6..ee676868 100755 --- a/scripts/release-packages.sh +++ b/scripts/release-packages.sh @@ -152,18 +152,12 @@ function sync() { all=( amazonlinux2-aarch64 amazonlinux2-x86_64 - centos7-ppc64le centos7-x86_64 centos8-aarch64 centos8-ppc64le centos8-x86_64 debian10-amd64 - debian9-amd64 - fedora35-aarch64 - fedora35-x86_64 opensuse-leap15.1-x86_64 - ubuntu16.04-amd64 - ubuntu16.04-ppc64le ubuntu18.04-amd64 ubuntu18.04-arm64 ubuntu18.04-ppc64le From a6d02feba744506490bfa5a28a9f787692003c03 Mon Sep 17 00:00:00 2001 From: Evan Lezar <7723350-elezar@users.noreply.gitlab.com> Date: Mon, 27 Feb 2023 12:36:49 +0000 Subject: [PATCH 11/11] Merge branch 'fix-rpm-postun-scriptlet' into 'main' nvidia-container-toolkit.spec: fix syntax error in postun scriptlet See merge request nvidia/container-toolkit/container-toolkit!309 --- packaging/rpm/SPECS/nvidia-container-toolkit.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packaging/rpm/SPECS/nvidia-container-toolkit.spec b/packaging/rpm/SPECS/nvidia-container-toolkit.spec index f206f632..ac47cfa2 100644 --- a/packaging/rpm/SPECS/nvidia-container-toolkit.spec +++ b/packaging/rpm/SPECS/nvidia-container-toolkit.spec @@ -65,7 +65,9 @@ rm -rf %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit ln -sf %{_bindir}/nvidia-container-runtime-hook %{_bindir}/nvidia-container-toolkit %postun -if [ -L %{_bindir}/nvidia-container-toolkit ] then; rm -f %{_bindir}/nvidia-container-toolkit; fi +if [ "$1" = 0 ]; then # package is uninstalled, not upgraded + if [ -L %{_bindir}/nvidia-container-toolkit ]; then rm -f %{_bindir}/nvidia-container-toolkit; fi +fi %files %license LICENSE