Skip to content

Instantly share code, notes, and snippets.

@tanpinsiang
Last active October 18, 2023 06:48
Show Gist options
  • Save tanpinsiang/4f7127d2268fd02f2969b399c2afcc2d to your computer and use it in GitHub Desktop.
Save tanpinsiang/4f7127d2268fd02f2969b399c2afcc2d to your computer and use it in GitHub Desktop.
#!/bin/bash
# Define the directory where your driver's source code is located
DRIVER_DIR="/home/admin/LINUX/driver"
# Navigate to the driver directory
cd $DRIVER_DIR
# Compile the driver
apt update
apt install -y linux-headers-$(uname -r)
make
# Load the driver dynamically
sudo make load
# Display message
echo "Checking the module ch9344.ko..."
# Wait for 5 seconds
sleep 5s
# Unload the driver
sudo make unload
# Install the driver permanently
sudo make install
# Display the message
echo "RS485 driver installed successfully!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment