feat: add psmouse module reload utility
Add utility to reload psmouse kernel module - Add psmouse reload script - Handle unloaded psmouse module - Add dependency and error checks - Add usage and troubleshooting documentation - Provide status messages during reload
This commit is contained in:
1 parent
daf0457175
commit
778490f090
2 files changed
+39
-2
No files matched your search
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
sudo modprobe -r psmouse && sudo modprobe psmouse
|
|
||||||
Executable
+39
@@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Reload the Linux psmouse kernel module.
|
||||||
|
#
|
||||||
|
# Description:
|
||||||
|
# Removes and reloads the psmouse module, which controls PS/2 mice and
|
||||||
|
# touchpads on many Linux systems. This can resolve cases where the
|
||||||
|
# touchpad/mouse has stopped responding.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# ./reload-psmouse.sh
|
||||||
|
#
|
||||||
|
# Requirements:
|
||||||
|
# - Linux
|
||||||
|
# - sudo privileges
|
||||||
|
# - psmouse kernel module
|
||||||
|
#
|
||||||
|
# Notes:
|
||||||
|
# Reloading psmouse may temporarily disconnect the touchpad/mouse.
|
||||||
|
# Systems using a different input driver may not be affected.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if ! command -v modprobe >/dev/null 2>&1; then
|
||||||
|
echo "Error: modprobe is not available."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! lsmod | grep -q '^psmouse '; then
|
||||||
|
echo "psmouse module is not currently loaded."
|
||||||
|
echo "Loading psmouse..."
|
||||||
|
sudo modprobe psmouse
|
||||||
|
else
|
||||||
|
echo "Reloading psmouse..."
|
||||||
|
sudo modprobe -r psmouse
|
||||||
|
sudo modprobe psmouse
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "psmouse module reloaded successfully."
|
||||||
Reference in new issue
Block a user