Print this page
4108 remove ON_CRYPTO_BINS from tools
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/scripts/bindrop.sh
+++ new/usr/src/tools/scripts/bindrop.sh
1 1 #! /usr/bin/ksh -p
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 #
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
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
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 24 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
25 25 #
26 26 # Create an encumbered binaries tarball from a full build proto area,
27 -# less the contents of an OpenSolaris proto area. Special handling
28 -# for crypto binaries that need to be signed by Sun Release
29 -# Engineering.
27 +# less the contents of an OpenSolaris proto area.
30 28 #
31 29
32 30 usage="bindrop [-n] basename"
33 31
34 32 isa=`uname -p`
35 33
36 34 PATH="$PATH:/usr/bin:/usr/sfw/bin"
37 35
38 36 function fail {
39 37 print -u2 "bindrop: $@"
40 38 exit 1
41 39 }
42 40
43 41 function warn {
44 42 print -u2 "bindrop: warning: $@"
45 43 }
46 44
47 45 [[ -n "$SRC" ]] || fail "SRC must be set."
48 46 [[ -n "$CODEMGR_WS" ]] || fail "CODEMGR_WS must be set."
49 47
50 48 #
51 49 # Create the README from boilerplate and the contents of the closed
52 50 # binary tree.
53 51 #
54 52 # usage: mkreadme targetdir
55 53 #
56 54 function mkreadme {
57 55 typeset targetdir="$1"
58 56 typeset readme="README.ON-BINARIES.$isa"
59 57
60 58 sed -e s/@ISA@/$isa/ -e s/@DELIVERY@/ON-BINARIES/ \
61 59 "$SRC/tools/opensolaris/README.binaries.tmpl" > "$targetdir/$readme"
62 60 (cd "$targetdir"; find "$rootdir" -type f -print | \
63 61 sort >> "$targetdir/$readme")
64 62 }
65 63
66 64 nondebug=n
67 65 while getopts n flag; do
68 66 case $flag in
69 67 n)
70 68 nondebug=y
71 69 ;;
72 70 ?)
73 71 print -u2 "usage: $usage"
74 72 exit 1
75 73 ;;
76 74 esac
77 75 done
78 76 shift $(($OPTIND - 1))
79 77
80 78 if [[ $# -ne 1 ]]; then
81 79 print -u2 "usage: $usage"
82 80 exit 1
83 81 fi
84 82
85 83 tarfile="$CODEMGR_WS/$1.$isa.tar"
86 84
87 85 rootdir="root_$isa"
88 86 suffix=""
89 87 if [[ "$nondebug" = y ]]; then
90 88 rootdir="root_$isa-nd"
91 89 suffix="-nd"
92 90 fi
93 91
94 92 [[ -d "${ROOT}${suffix}-closed" ]] || fail "can't find closed root proto area."
95 93
96 94 tmpdir=$(mktemp -dt bindropXXXXX)
97 95 [[ -n "$tmpdir" ]] || fail "can't create temporary directory."
98 96 mkdir -p "$tmpdir/closed/$rootdir" || exit 1
99 97
100 98 #
101 99 # This will hold a temp list of directories that must be kept, even if
102 100 # empty.
↓ open down ↓ |
63 lines elided |
↑ open up ↑ |
103 101 #
104 102 needdirs=$(mktemp -t needdirsXXXXX)
105 103 [[ -n "$needdirs" ]] || fail "can't create temporary directory list file."
106 104
107 105 #
108 106 # Copy the closed root parallel tree into a temp directory.
109 107 #
110 108 (cd "${ROOT}${suffix}-closed"; tar cf - .) | (cd "$tmpdir/closed/$rootdir"; tar xpf -)
111 109
112 110 #
113 -# Remove internal ON crypto signing certs
114 -#
115 -delete="
116 - etc/certs/SUNWosnetSE
117 - etc/certs/SUNWosnetSolaris
118 - etc/crypto/certs/SUNWosnet
119 - etc/crypto/certs/SUNWosnetLimited
120 - etc/crypto/certs/SUNWosnetCF
121 - etc/crypto/certs/SUNWosnetCFLimited
122 - "
123 -
124 -#
125 111 # Remove miscellaneous files that we don't want to ship.
126 112 #
127 113
128 114 # SUNWsvvs (SVVS test drivers).
129 -delete="$delete
115 +delete="
130 116 usr/include/sys/svvslo.h
131 117 usr/include/sys/tidg.h
132 118 usr/include/sys/tivc.h
133 119 usr/include/sys/tmux.h
134 120 usr/kernel/drv/amd64/svvslo
135 121 usr/kernel/drv/amd64/tidg
136 122 usr/kernel/drv/amd64/tivc
137 123 usr/kernel/drv/amd64/tmux
138 124 usr/kernel/drv/sparcv9/svvslo
139 125 usr/kernel/drv/sparcv9/tidg
140 126 usr/kernel/drv/sparcv9/tivc
141 127 usr/kernel/drv/sparcv9/tmux
142 128 usr/kernel/drv/svvslo
143 129 usr/kernel/drv/svvslo.conf
144 130 usr/kernel/drv/tidg
145 131 usr/kernel/drv/tidg.conf
146 132 usr/kernel/drv/tivc
147 133 usr/kernel/drv/tivc.conf
148 134 usr/kernel/drv/tmux
149 135 usr/kernel/drv/tmux.conf
150 136 usr/kernel/strmod/amd64/lmodb
151 137 usr/kernel/strmod/amd64/lmode
152 138 usr/kernel/strmod/amd64/lmodr
153 139 usr/kernel/strmod/amd64/lmodt
154 140 usr/kernel/strmod/lmodb
155 141 usr/kernel/strmod/lmode
156 142 usr/kernel/strmod/lmodr
157 143 usr/kernel/strmod/lmodt
158 144 usr/kernel/strmod/sparcv9/lmodb
159 145 usr/kernel/strmod/sparcv9/lmode
160 146 usr/kernel/strmod/sparcv9/lmodr
161 147 usr/kernel/strmod/sparcv9/lmodt
162 148 "
163 149 # encumbered binaries and associated files
164 150 delete="$delete
165 151 kernel/drv/amd64/bmc
166 152 kernel/drv/bmc
167 153 kernel/drv/bmc.conf
168 154 kernel/drv/ifp.conf
169 155 kernel/drv/sparcv9/ifp
170 156 kernel/drv/sparcv9/isp
171 157 kernel/drv/sparcv9/qus
172 158 kernel/drv/spwr
173 159 kernel/kmdb/sparcv9/isp
174 160 usr/has/bin/ksh
175 161 usr/has/bin/pfksh
176 162 usr/has/bin/rksh
177 163 usr/include/sys/scsi/adapters/ifpcmd.h
178 164 usr/include/sys/scsi/adapters/ifpio.h
179 165 usr/include/sys/scsi/adapters/ifpmail.h
180 166 usr/include/sys/scsi/adapters/ifpreg.h
181 167 usr/include/sys/scsi/adapters/ifpvar.h
182 168 usr/include/sys/scsi/adapters/ispcmd.h
183 169 usr/include/sys/scsi/adapters/ispmail.h
184 170 usr/include/sys/scsi/adapters/ispreg.h
185 171 usr/include/sys/scsi/adapters/ispvar.h
186 172 usr/lib/mdb/kvm/sparcv9/isp.so
187 173 usr/platform/sun4u/include/sys/memtestio.h
188 174 usr/platform/sun4u/include/sys/memtestio_ch.h
189 175 usr/platform/sun4u/include/sys/memtestio_chp.h
190 176 usr/platform/sun4u/include/sys/memtestio_ja.h
191 177 usr/platform/sun4u/include/sys/memtestio_jg.h
192 178 usr/platform/sun4u/include/sys/memtestio_sf.h
193 179 usr/platform/sun4u/include/sys/memtestio_sr.h
194 180 usr/platform/sun4u/include/sys/memtestio_u.h
195 181 usr/platform/sun4u/include/sys/memtestio_pn.h
196 182 usr/platform/sun4v/include/sys/memtestio.h
197 183 usr/platform/sun4v/include/sys/memtestio_ni.h
198 184 usr/platform/sun4v/include/sys/memtestio_v.h
199 185 "
200 186 # memory fault injector test framework
201 187 delete="$delete
202 188 usr/bin/mtst
203 189 platform/sun4u/kernel/drv/sparcv9/memtest
204 190 platform/sun4u/kernel/drv/memtest.conf
205 191 platform/sun4v/kernel/drv/sparcv9/memtest
206 192 platform/sun4v/kernel/drv/memtest.conf
207 193 kernel/drv/memtest.conf
208 194 kernel/drv/memtest
209 195 kernel/drv/amd64/memtest
210 196 usr/platform/i86pc/lib/mtst/mtst_AuthenticAMD_15.so
211 197 usr/platform/i86pc/lib/mtst/mtst_AuthenticAMD.so
212 198 usr/platform/i86pc/lib/mtst/mtst_generic.so
213 199 usr/platform/i86pc/lib/mtst/mtst_GenuineIntel.so
214 200 "
215 201 for f in $delete; do
216 202 rm -rf "$tmpdir/closed/$rootdir/$f"
217 203 done
218 204
219 205 #
220 206 # Remove any header files. If they're in the closed tree, they're
221 207 # probably not freely redistributable.
222 208 #
223 209 (cd "$tmpdir/closed/$rootdir"; find . -name \*.h \
224 210 -a \! -name lc_core.h \
225 211 -a \! -name localedef.h \
226 212 -exec rm -f {} \;)
227 213
228 214 #
229 215 # Remove empty directories that the open tree doesn't need.
230 216 #
231 217 # Step 1: walk the redistributable manifests to find out which directories
232 218 # are specified in the open packages; save that list to a temporary
233 219 # file $needdirs.
234 220 #
235 221 MACH=$(uname -p)
236 222 (cd "$SRC/pkg/packages.$MACH"; \
237 223 nawk '/^dir/ {sub(/.+ path=/, ""); print $1;}' *.metadata.*.redist | \
238 224 sort -u > "$needdirs")
239 225
240 226 #
241 227 # Step 2: go to our closed directory, and find all the subdirectories,
242 228 # filtering out the ones needed by the open packages (saved in that
243 229 # temporary file). Sort in reverse order, so that parent directories
244 230 # come after any subdirectories, and pipe that to rmdir. If there are
245 231 # still any lingering files, rmdir will complain. That's fine--we
↓ open down ↓ |
106 lines elided |
↑ open up ↑ |
246 232 # only want to delete empty directories--so redirect the complaints to
247 233 # /dev/null.
248 234 #
249 235 (cd "$tmpdir/closed/$rootdir"; \
250 236 find * -type d -print | /usr/xpg4/bin/grep -xv -f $needdirs | \
251 237 sort -r | xargs -l rmdir 2>/dev/null )
252 238
253 239 rm "$needdirs"
254 240
255 241 #
256 -# Exclude signed crypto binaries; they are delivered in their
257 -# own tarball.
258 -#
259 -ROOT="$tmpdir/closed/$rootdir" findcrypto "$SRC/tools/codesign/creds" |
260 - awk '{ print $2 }' | (cd "$tmpdir/closed/$rootdir"; xargs rm -f)
261 -
262 -#
263 242 # Add binary license files.
264 243 #
265 244
266 245 cp -p "$SRC/tools/opensolaris/BINARYLICENSE.txt" "$tmpdir/closed" || \
267 246 fail "can't add BINARYLICENSE.txt"
268 247 mkreadme "$tmpdir/closed"
269 248 if [ -f "$CODEMGR_WS/THIRDPARTYLICENSE.ON-BINARIES" ]; then
270 249 cp -p "$CODEMGR_WS/THIRDPARTYLICENSE.ON-BINARIES" "$tmpdir/closed"
271 250 fi
272 251
273 252 (cd "$tmpdir"; tar cf "$tarfile" closed) || fail "can't create $tarfile."
274 253 bzip2 -f "$tarfile" || fail "can't compress $tarfile".
275 254
276 255 rm -rf "$tmpdir"
277 256
278 257 exit 0
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX