[Feature Request] Include a pacman hook to regenerate NVIDIA CDI
Hi,
I would like to suggest providing a pacman hook to regenerate NVIDIA CDI whenever nvidia
package upgrades. The pacman hook could be something like this:
[Trigger]
Operation = Upgrade
Type = Package
Target = nvidia
[Action]
Description = Regenerate NVIDIA CDI (Container Device Interface)
Exec = /usr/bin/nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
When = PostTransaction
Depends = nvidia-container-toolkit
The hook can be installed as
- directly to
/usr/share/libalpm/hooks/nvidia-ctk-cdi.hook
, which implies that/etc/cdi/nvidia.yaml
is automatically overwrited whenevernvidia
package is upgraded; however, an user might have manually modified the file. - provided in
/usr/share/nvidia-container-toolkit/nvidia-ctk-cdi.hook
so that the user can choose to opt-in the hook (for instance,arch-audit
provides such kind of hook)