build FTDI module for Jetson TX2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Prepare to build the FTDI module the NVIDIA Jetson TX2 | |
if [ $(id -u) != 0 ]; then | |
echo "This script requires root permissions" | |
echo "$ sudo "$0"" | |
exit | |
fi | |
# Go to the kernel sources | |
cd /usr/src/linux-headers-$(uname -r) | |
# Get the kernel configuration file | |
zcat /proc/config.gz > .config | |
# Enable FTDI compilation | |
sudo sed -i 's/# CONFIG_USB_SERIAL_FTDI_SIO is not set/CONFIG_USB_SERIAL_FTDI_SIO=m/' .config | |
# Make sure that the local kernel version is set | |
LOCALVERSION=$(uname -r) | |
# vodoo incantation; This removes everything from the beginning to the last occurrence of "-" | |
# of the local version string i.e. 3.10.67 is removed | |
release="${LOCALVERSION##*-}" | |
CONFIGVERSION="CONFIG_LOCALVERSION=\"-$release\"" | |
# Replace the empty local version with the local version of this kernel | |
sudo sed -i 's/CONFIG_LOCALVERSION=""/'$CONFIGVERSION'/' .config | |
# Prepare the module for compilation | |
make prepare | |
make modules_prepare | |
# Compile the module | |
make M=drivers/usb/serial/ | |
# After compilation, copy the compiled module to the system area | |
cp drivers/usb/serial/ftdi_sio.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial | |
depmod -a | |
/bin/echo -e "\e[1;32mFTDI Driver Module Installed.\e[0m" |
HOLY FUCK! thank you so much. Star for you, for sure.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Status now