Skip to content

Commit e1b4a1b

Browse files
committed
Update rpm spec file to ensure the symlinks are kept during an upgrade
This PR updates the rpm spec file to ensure the symlinks to configf.yaml and hooks.yaml are maintained during a package upgrade. In addition, this also fixes an issue with the nvidia-mig-manager service is set to disabled during an upgrade. Currently when doing a dnf update or dnf reinstall, those two symlinks are removed. Adding a check around these functions: systemctl disable nvidia-mig-manager.service systemctl daemon-reload maybe_remove_hooks_symlink maybe_remove_config_symlink allows the symlinks to remain when a pacakge is reinstalled or updated and keeps the systemd service enabled. Closes: 154 Signed-off-by: KeithMnemonic <[email protected]>
1 parent ede931e commit e1b4a1b

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
*.swp
22
*.swo
3+
dist/
4+
.vscode/

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# NVIDIA MIG Manager Changelog
22

3+
- Fix rpm spec to maintain the config.yaml and hooks.yaml symlinks during an update
4+
35
## v0.10.0
46
- Add GH200 144G HBM3e with PCI ID x234810DE
57
- Bump Golang version to v1.23.2

deployments/systemd/packages/rpm/SPECS/nvidia-mig-manager.spec

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ maybe_add_hooks_symlink
112112
maybe_add_config_symlink
113113

114114
%preun
115-
systemctl disable nvidia-mig-manager.service
116-
systemctl daemon-reload
117-
118115
function maybe_remove_hooks_symlink() {
119116
local target=$(readlink -f /etc/nvidia-mig-manager/hooks.yaml)
120117
if [ "${target}" = "/etc/nvidia-mig-manager/hooks-minimal.yaml" ]; then
@@ -132,8 +129,13 @@ function maybe_remove_config_symlink() {
132129
fi
133130
}
134131

135-
maybe_remove_hooks_symlink
136-
maybe_remove_config_symlink
132+
if [ $1 -eq 0 ]
133+
then
134+
systemctl disable nvidia-mig-manager.service
135+
systemctl daemon-reload
136+
maybe_remove_hooks_symlink
137+
maybe_remove_config_symlink
138+
fi
137139

138140
%changelog
139141
# As of 0.6.0-1 we generate the release information automatically

0 commit comments

Comments
 (0)