[9f1646]: build_driver.sh Maximize Restore History

Download this file

build_driver.sh    33 lines (24 with data), 777 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
CP210X_NAME="cp210x.c"
CP210X_ADDRESS="https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/plain/drivers/usb/serial/cp210x.c?id=refs/tags/v"
PATCH_NAME="cp210x.patch"
LINUX_KERNEL_VERSION=$(uname -r | cut -f1 -d"-")
LKV_P1=$(echo $LINUX_KERNEL_VERSION | cut -f1 -d".")
LKV_P2=$(echo $LINUX_KERNEL_VERSION | cut -f2 -d".")
LKV_P3=$(echo $LINUX_KERNEL_VERSION | cut -f3 -d".")
if [ $LKV_P3 = 0 ]; then
CP210X_VERSION=$(echo "$LKV_P1.$LKV_P2")
else
CP210X_VERSION=$(echo "$LKV_P1.$LKV_P2.$LKV_P3")
fi
#uncomment if patch doesn't work
#CP210X_VERSION="3.8.0"
#get the file to patch
if [ ! -f $CP210X_NAME ]; then
wget -O $CP210X_NAME "${CP210X_ADDRESS}${CP210X_VERSION}"
fi
#patch
patch -r - -Np1 < $PATCH_NAME
#run make
make clean
make