Skip to content

Commit

Permalink
Merge pull request #155 from KeithMnemonic/update_rpm_spec_file_to_ke…
Browse files Browse the repository at this point in the history
…ep_symlinks_when_upgrading

Update rpm spec file to ensure the symlinks are kept during an upgrade
  • Loading branch information
cdesiniotis authored Dec 13, 2024
2 parents 2e81bde + e1b4a1b commit 0a4df2c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.swp
*.swo
dist/
.vscode/
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# NVIDIA MIG Manager Changelog

- Fix rpm spec to maintain the config.yaml and hooks.yaml symlinks during an update

## v0.10.0
- Add GH200 144G HBM3e with PCI ID x234810DE
- Bump Golang version to v1.23.2
Expand Down
12 changes: 7 additions & 5 deletions deployments/systemd/packages/rpm/SPECS/nvidia-mig-manager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ maybe_add_hooks_symlink
maybe_add_config_symlink

%preun
systemctl disable nvidia-mig-manager.service
systemctl daemon-reload

function maybe_remove_hooks_symlink() {
local target=$(readlink -f /etc/nvidia-mig-manager/hooks.yaml)
if [ "${target}" = "/etc/nvidia-mig-manager/hooks-minimal.yaml" ]; then
Expand All @@ -132,8 +129,13 @@ function maybe_remove_config_symlink() {
fi
}

maybe_remove_hooks_symlink
maybe_remove_config_symlink
if [ $1 -eq 0 ]
then
systemctl disable nvidia-mig-manager.service
systemctl daemon-reload
maybe_remove_hooks_symlink
maybe_remove_config_symlink
fi

%changelog
# As of 0.6.0-1 we generate the release information automatically
Expand Down

0 comments on commit 0a4df2c

Please sign in to comment.