mirror of
https://github.com/flatcar/scripts.git
synced 2025-12-09 19:31:54 +01:00
setup-nvidia: Make "current" symlink logic more robust
Users have reported that in some cases the nvidia.service fails because /opt/nvidia/current is a directory and the symbolic link gets created inside it. I have no idea how we get there, but to make the service robust in the face of this kind of issue: - remove the directory if it exists - use `-T` with ln to ensure that symbolic link creation fails if `current` is a directory Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
parent
3c4c7c6cb0
commit
03925e1ca3
@ -88,7 +88,11 @@ SYSEXT_LEVEL=1.0
|
||||
EOF
|
||||
|
||||
pushd /opt/nvidia
|
||||
ln -sfn "${NVIDIA_FLATCAR_VERSION_PAIR}" current
|
||||
if [[ -d "${NVIDIA_CURRENT_INSTALLATION}" ]]
|
||||
then
|
||||
rm -rf "${NVIDIA_CURRENT_INSTALLATION}"
|
||||
fi
|
||||
ln -sfn -T "${NVIDIA_FLATCAR_VERSION_PAIR}" "${NVIDIA_CURRENT_INSTALLATION}"
|
||||
popd
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user