-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathadd_header.sh
More file actions
executable file
·49 lines (44 loc) · 878 Bytes
/
add_header.sh
File metadata and controls
executable file
·49 lines (44 loc) · 878 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
KPATH=/lib/modules/$(uname -r)/kernel/drivers
if [ "$1" == "modules" ]
then
if [ "$(uname -r)" \< "2.6.25" ]
then
# cp $(pwd)/usbnet.h $2
echo "make mdoules"
fi
elif [ "$1" == "clean" ]
then
if [ "$(uname -r)" \< "2.6.22" ]
then
if [ -f $KPATH/usb/net/hw_cdc_driver.ko ]
then
rm -f $KPATH/usb/net/hw_cdc_driver.ko
depmod -a
fi
else
if [ -f $KPATH/net/usb/hw_cdc_driver.ko ]
then
rm -f $KPATH/net/usb/hw_cdc_driver.ko
depmod -a
fi
fi
elif [ "$1" == "install" ]
then
if [ "$(uname -r)" \< "2.6.22" ]
then
if [ -f $(pwd)/hw_cdc_driver.ko ]
then
cp $(pwd)/hw_cdc_driver.ko $KPATH/usb/net
chmod 744 $KPATH/usb/net/hw_cdc_driver.ko
depmod -a
fi
else
if [ -f $(pwd)/hw_cdc_driver.ko ]
then
cp $(pwd)/hw_cdc_driver.ko $KPATH/net/usb
chmod 744 $KPATH/net/usb/hw_cdc_driver.ko
depmod -a
fi
fi
fi