Print this page
6414175 kcf.conf's supportedlist not providing much usefulness
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/pkgdefs/SUNWdcar/postinstall
+++ new/usr/src/pkgdefs/SUNWdcar/postinstall
1 1 #! /bin/sh
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License (the "License").
7 7 # You may not use this file except in compliance with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22
23 23 #
24 -# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 +# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
25 25 # Use is subject to license terms.
26 26 #
27 -#pragma ident "%Z%%M% %I% %E% SMI"
28 -#
29 27
30 28 #
31 29 # install the Sun Crypto Accelerator 1000 device drivers.
32 30 #
33 31
34 32 PATH="/usr/bin:/usr/sbin:${PATH}"
35 33 export PATH
36 -
37 -# Add hardware provider section for the dca driver
38 -# to /etc/crypto/kcf.conf
39 -
40 -pkg_start="# Start $PKGINST"
41 -pkg_end="# End $PKGINST"
42 -kcfconf=${BASEDIR}/etc/crypto/kcf.conf
43 -tmpfile=/tmp/$$kcfconf
44 -error=no
45 -
46 -#
47 -# If /etc/crypto/kcf.conf doesn't exist, bail immediately
48 -#
49 -if [ ! -f "$kcfconf" ]
50 -then
51 - echo "$0: ERROR - $kcfconf doesn't exist"
52 - exit 2
53 -fi
54 -
55 -#
56 -# If the package has been already installed, remove old entries
57 -#
58 -start=0
59 -end=0
60 -egrep -s "$pkg_start" $kcfconf && start=1
61 -egrep -s "$pkg_end" $kcfconf && end=1
62 -
63 -if [ $start -ne $end ] ; then
64 - echo "$0: missing Start or End delimiters for $PKGINST in $kcfconf."
65 - echo "$0: $kcfconf may be corrupted and was not updated."
66 - error=yes
67 - exit 2
68 -fi
69 -
70 -# to preserve the gid
71 -cp -p $kcfconf $tmpfile || error=yes
72 -if [ $start -eq 1 ]
73 -then
74 - sed -e "/$pkg_start/,/$pkg_end/d" $kcfconf > $tmpfile || error=yes
75 -fi
76 -
77 -#
78 -# Append the delimiters for this package
79 -#
80 -echo "$pkg_start driver_names=dca" >> $tmpfile || error=yes
81 -echo "$pkg_end" >> $tmpfile || error=yes
82 -
83 -#
84 -# Install the updated config file and clean up the tmp file
85 -#
86 -if [ "$error" = no ]
87 -then
88 - mv $tmpfile $kcfconf || error=yes
89 -fi
90 -rm -f $tmpfile
91 -
92 -#
93 -# All done, if any of the steps above fail, report the error
94 -#
95 -if [ "$error" = yes ]
96 -then
97 - echo "$0: ERROR - failed to update $kcfconf."
98 - exit 2
99 -fi
100 -
101 34 NAMEMAJOR="${BASEDIR}/etc/name_to_major"
102 35
103 36 #
104 37 # Is the hardware there?
105 38 #
106 39 check_hardware()
107 40 {
108 41 for i in "pci14e4,5820" "pci14e4,5821" "pci14e4,5822" "pci14e4,5825" \
109 42 "pci108e,5454" "pci108e,5455" "pci108e,5456" "pci108e,5457"
110 43 do
111 44 prtconf -pv | egrep -s "$i"
112 45 if [ $? -eq 0 ]
113 46 then
114 47 return 1
115 48 fi
116 49 done
117 50 return 0
118 51 }
119 52
120 53 hw_opt=
121 54 check_hardware
122 55 if [ $? -eq 0 ]
123 56 then
124 57 hw_opt="-n"
125 58 fi
126 59
127 60 if [ "${BASEDIR:=/}" = "/" ]
128 61 then
129 62 ADD_DRV="/usr/sbin/add_drv $hw_opt"
130 63 else
131 64 ADD_DRV="/usr/sbin/add_drv $hw_opt -b ${BASEDIR}"
132 65 fi
133 66
134 67 grep -w dca ${NAMEMAJOR} > /dev/null 2>&1
135 68 if [ $? -ne 0 ]
136 69 then
137 70 $ADD_DRV -i '"pci14e4,5820" "pci14e4,5821" "pci14e4,5822" "pci14e4,5825" "pci108e,5454" "pci108e,5455" "pci108e,5456" "pci108e,5457"' \
138 71 dca || exit 1
139 72 fi
140 73
141 74 exit 0
↓ open down ↓ |
31 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX