From 25d6f6f05ea8a9149572a7f7e510d2ebd1e0ba59 Mon Sep 17 00:00:00 2001 From: Eric Hartford Date: Wed, 2 Dec 2026 20:10:50 +0000 Subject: [PATCH] uninstall.sh: clean up unmounted regular-file placeholders even after service stop --- uninstall.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/uninstall.sh b/uninstall.sh index 6aee7639..4e42659d 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -22,10 +22,13 @@ if [ "$UNLOAD" = "1" ]; then # bind mounts the service did not own (e.g. from install.sh's own --bind) for f in /dev/nvidia[0-9]* /dev/nvidiactl /dev/nvidia-uvm /dev/nvidia-modeset; do if mountpoint -q "$f" 2>/dev/null; then - if sudo umount "$f" 2>/dev/null; then - # Remove regular-file placeholders created by bind_dev_nodes.sh; preserve real char devices. - if [ -f "$f" ] && [ ! -c "$f" ]; then sudo rm -f -- "$f"; fi - fi + sudo umount "$f" 2>/dev/null || true + fi + # Remove regular-file placeholders created by bind_dev_nodes.sh (including + # those already unmounted by nvdriver-devnodes.service); preserve real char + # devices, symlinks, and anything still mounted. + if ! mountpoint -q "$f" 2>/dev/null && [ -f "$f" ] && [ ! -c "$f" ] && [ ! -L "$f" ]; then + sudo rm -f -- "$f" fi done for m in nvidia_rs_drm nvidia_rs_modeset nvidia_rs_peermem nvidia_rs_modeset_bridge nvidia_rs_uvm_bridge nvidia_rs; do