-
Notifications
You must be signed in to change notification settings - Fork 1
/
mxinstall
executable file
·54 lines (50 loc) · 1.38 KB
/
mxinstall
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
48
49
50
51
52
53
54
#!/bin/sh
###############################################################################
# Program:
# MOXA Linux driver installer
#
# History:
# 2009/05/21
#
# Author:
# Eric Lo, [email protected]
#
# Discription:
# The script install and load the MOXA Linux driver.
#
###############################################################################
TARGET_DRIVER1=mxser
TARGET_DRIVER2=mxupcie
MXVER=1.16
MAJOR_PCI=30
MAJOR_PCIE=31
MINOR=32
if lsmod | grep -q $TARGET_DRIVER1 ; then
echo "Found $TARGET_DRIVER1 in system..."
echo "Unloading $TARGET_DRIVER1..."
rmmod $TARGET_DRIVER1
echo "Unload $TARGET_DRIVER1 successfully."
echo ""
fi
if lsmod | grep -q $TARGET_DRIVER2 ; then
echo "Found $TARGET_DRIVER2 in system..."
echo "Unloading $TARGET_DRIVER2..."
rmmod $TARGET_DRIVER2
echo "Unload $TARGET_DRIVER2 successfully."
echo ""
fi
if make install ; then
echo ""
echo "Loading driver..."
modprobe $TARGET_DRIVER1
modprobe $TARGET_DRIVER2
[ -f /dev/mxser ] || rm -rf /dev/mxser
mknod /dev/mxser c $MAJOR_PCI $MINOR
chmod a+wx /dev/mxser
[ -f /dev/mxupcie ] || rm -rf /dev/mxupcie
mknod /dev/mxupcie c $MAJOR_PCIE $MINOR
chmod a+wx /dev/mxupcie
echo "**********************************************************************"
echo " MOXA Smartio/Industio Family driver ver $MXVER loaded successfully."
echo "**********************************************************************"
fi