summaryrefslogtreecommitdiff
path: root/setup/SCO_SV/oss/build/install.sh
blob: 323957571ea8709eddeeee9f9a59b0efb45fbe35 (plain)
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/sh

. /etc/oss.conf

if test "$CONFDIR " = " "
then
  CONFDIR=/etc/conf
fi

# Remove the non-oss ICH driver before doing anything else
/etc/conf/bin/idinstall -R $CONFDIR -d ich > /dev/null 2>&1

# Unload previous modules
for n in `ls $OSSLIBDIR/modules|egrep -v "osscore|oss_imux"`
do
  modadmin -U $n > /dev/null 2>&1
done

for MOD in osscore oss_imux
do
  modadmin -U $MOD > /dev/null 2>&1
done

# (re)install osscore and oss_imux

rm -f $OSSLIBDIR/modules/*/install.log

for MOD in osscore oss_imux
do
  cd $OSSLIBDIR/modules/$MOD

  if test ! -f Space.c
  then
     cp $OSSLIBDIR/space.inst/$MOD Space.c
  fi

  rm -f install.log
  
  if /etc/conf/bin/idinstall -k -P oss -R $CONFDIR -M $MOD >> install.log 2>&1
  then
    if /etc/conf/bin/idbuild -M $MOD >> install.log 2>&1
    then
      echo OSS module $MOD installed OK
      echo OSS module $MOD installed OK >> install.log
    else
      cat install.log
      echo Building $MOD module failed
      echo Building $MOD module failed >> install.log
      exit 1
    fi
  else
    cat install.log
    echo Failed to idinstall $MOD
    echo Failed to idinstall $MOD >> install.log
    exit 1
  fi

  (cd $OSSLIBDIR/conf && rm -f $MOD.conf && ln -sf ../modules/$MOD/Space.c $MOD.conf)

  installf oss $CONFDIR/sdevice.d/$MOD
done


# Only install the drivers we have a resmgr match for
OSSTMPFILE=/tmp/ossdetect.$$
CDIR=`pwd`
cd $OSSLIBDIR/modules
/sbin/resmgr -p BRDID > $OSSTMPFILE
for file in */Drvmap
do
	DRVR=`dirname $file`
	grep "^|" $file | cut -d \| -f3 | while read BRDID
	do
		if [ -n "$BRDID" ]; then
			while read RMBRDID
			do
				if [ "$BRDID" = "$RMBRDID" ]; then
					echo "$DRVR"
				fi
			done < $OSSTMPFILE
		fi
	done
done | sort -u | while read DRVR
do
  cd $OSSLIBDIR/modules/$DRVR

  if test ! -f Space.c
  then
     cp $OSSLIBDIR/../space.inst/$n Space.c
  fi
 
  rm -f install.log

# /etc/conf/bin/idinstall -R $CONFDIR -d $DRVR > /dev/null 2>&1

  if /etc/conf/bin/idinstall -k -P oss -R $CONFDIR -M $DRVR >> install.log 2>&1
  then
    if /etc/conf/bin/idbuild -M $DRVR >> install.log 2>&1
    then
      echo OSS module $DRVR installed OK
      echo OSS module $DRVR installed OK >> install.log
    else
      cat install.log
      echo Building $DRVR module failed
      echo Building $DRVR module failed >> install.log
      exit 1
    fi
  else
    cat install.log
    echo Failed to idinstall $DRVR
    echo Failed to idinstall $DRVR >> install.log
    exit 1
  fi
  installf oss $CONFDIR/sdevice.d/$DRVR

  (cd $OSSLIBDIR/conf && rm -f $DRVR.conf && \
	 ln -sf ../modules/$DRVR/Space.c $DRVR.conf)
done

rm -f $OSSTMPFILE

cd $CDIR

if test -f /bin/dcu
then
  /bin/dcu -S
else
  /sbin/dcu -S
fi

if test ! -f $OSSLIBDIR/etc/installed_drivers
then
echo "----------------------------------------------"
        /usr/sbin/ossdetect -v
echo "----------------------------------------------"
fi
echo OSS modules installed OK