-
Notifications
You must be signed in to change notification settings - Fork 1
/
instal
109 lines (96 loc) · 1.85 KB
/
instal
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/sh
#
# This script file installs the driver in /etc/master,
# /etc/system
#
TRUE=1
MASTER=/etc/master
SYSTEM=/etc/system
MAJNUM=44
DEVICENAME=leaix
if_failed() {
status=$1
errmsg=$2
if [ $status -ne 0 ]; then
echo Failed $errmsg
# cleanup
exit 99
fi
}
onintr() {
echo Aborted by user.
cleanup
exit 5
}
trap onintr 1 2 3
cd /
#
# Now patch some critical system files.
#
name=`uname -n`
/bin/sed -n '/^'$DEVICENAME':/,/^[ ]*$/d
p' < $MASTER > /tmp/master.tmp 2> /dev/null
majnum=44;
while [ $TRUE ]
do
fgrep "major" /tmp/master.tmp | awk '{print $3}' | fgrep "$majnum" 1>/dev/null;
if [ $? -eq 0 ]
then majnum=`expr $majnum + 1`
else break;
fi
done
echo
echo Backing up /etc/master to /etc/master.orig
/bin/cp $MASTER /etc/master.orig 2>/dev/null
echo Patching /etc/master...
echo
/bin/cat /tmp/master.tmp - > $MASTER<<!
leaix: type = dev
routines = init,intr
softcfg = TRUE
nocount = TRUE
prefix = leaix
major = $majnum
character = TRUE
!
echo Backing up /etc/system to /etc/system.orig
/bin/cp $SYSTEM /etc/system.orig 2> /dev/null
echo Patching /etc/system...
echo
if [ `grep -c '^pg:' /etc/system` != "0" ]
then
echo "Removing Ungerman-Bass ethernet card from /etc/system"
fi
awk '
BEGIN {inpg = 0}
/^.*:/ {if ($1 == "pg:") inpg = 1}
/^[ ]*$/ {inpg = 0}
inpg == 1 {print "*",$0}
inpg == 0 {print $0}
' $SYSTEM | /bin/sed -n '/ipc43/d
/^sysparms:/a\
ipc43 = 1
/^lenet0/,/^[ ]*$/d
p' > /tmp/system.tmp 2> /dev/null
/bin/cat /tmp/system.tmp - > $SYSTEM<<!
lenet0:
* AMD am799x Ethernet Device Driver
name = lenet
driver = leaix
minor = c0
noddi = true
noduplicate = false
dtype = lan
* Local Area Network
pflag = false
* AMD am799x Ethernet Device Driver
noshow = false
dname = lenet0
modes = rw-rw-rw-
owner = root
slot = ---
nospecial = true
specproc = /etc/lanspecial
!
/bin/rm -rf /tmp/master.tmp /tmp/system.tmp
exit 0