Skip to content

Instantly share code, notes, and snippets.

@weshouman
Last active August 21, 2023 07:46
Show Gist options
  • Save weshouman/753e4600ba9898cf8a03b98536c4927b to your computer and use it in GitHub Desktop.
Save weshouman/753e4600ba9898cf8a03b98536c4927b to your computer and use it in GitHub Desktop.
installation scripts for evdi kernel module
  • pip install pybind11: install requirements
  • pip3 show pybind11 | grep Location: to ensure installation
  • .\install_evdi.sh: install evdi
#!/bin/bash
# Parameterized link
EVDI_VERSION="${1:-1.13.1}"
EVDI_LINK="https://codeload.github.com/DisplayLink/evdi/tar.gz/refs/tags/v${EVDI_VERSION}"
# Check if evdi is loaded
if lsmod | grep evdi &> /dev/null; then
echo "evdi is already installed and loaded."
else
echo "evdi not found. Installing..."
# Install dependencies
sudo apt update
sudo apt install -y dkms
# Create a temporary directory for downloading and installing evdi
TEMP_DIR=$(mktemp -d)
cd $TEMP_DIR
# Download and extract evdi
wget $EVDI_LINK -O evdi.tar.gz
tar -xf evdi.tar.gz
# Navigate to the extracted directory (assuming it extracts to a directory named after the version, like evdi-1.14.1)
cd evdi-*
# Build and install
make
sudo make install
echo "evdi installation completed."
fi
# Cleanup
rm -rf $TEMP_DIR
# Optional: Reboot prompt
read -p "Do you want to reboot now? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo reboot
fi
#!/bin/bash
EVDI_VERSION="${1:-1.13.1}"
# Check if evdi is loaded
if lsmod | grep evdi &> /dev/null; then
echo "evdi found. Uninstalling..."
# Unload the evdi module
sudo modprobe -r evdi
# Remove the evdi module from the system
sudo dkms remove evdi/${EVDI_VERSION} --all
echo "evdi ${EVDI_VERSION} uninstalled successfully."
else
echo "evdi not found on the system."
fi
# Optional: Reboot prompt
read -p "Do you want to reboot now? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo reboot
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment