7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22
23 #
24 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
25 #
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.
30 #
31
32 usage="bindrop [-n] basename"
33
34 isa=`uname -p`
35
36 PATH="$PATH:/usr/bin:/usr/sfw/bin"
37
38 function fail {
39 print -u2 "bindrop: $@"
40 exit 1
41 }
42
43 function warn {
44 print -u2 "bindrop: warning: $@"
45 }
46
47 [[ -n "$SRC" ]] || fail "SRC must be set."
48 [[ -n "$CODEMGR_WS" ]] || fail "CODEMGR_WS must be set."
49
93
94 [[ -d "${ROOT}${suffix}-closed" ]] || fail "can't find closed root proto area."
95
96 tmpdir=$(mktemp -dt bindropXXXXX)
97 [[ -n "$tmpdir" ]] || fail "can't create temporary directory."
98 mkdir -p "$tmpdir/closed/$rootdir" || exit 1
99
100 #
101 # This will hold a temp list of directories that must be kept, even if
102 # empty.
103 #
104 needdirs=$(mktemp -t needdirsXXXXX)
105 [[ -n "$needdirs" ]] || fail "can't create temporary directory list file."
106
107 #
108 # Copy the closed root parallel tree into a temp directory.
109 #
110 (cd "${ROOT}${suffix}-closed"; tar cf - .) | (cd "$tmpdir/closed/$rootdir"; tar xpf -)
111
112 #
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 # Remove miscellaneous files that we don't want to ship.
126 #
127
128 # SUNWsvvs (SVVS test drivers).
129 delete="$delete
130 usr/include/sys/svvslo.h
131 usr/include/sys/tidg.h
132 usr/include/sys/tivc.h
133 usr/include/sys/tmux.h
134 usr/kernel/drv/amd64/svvslo
135 usr/kernel/drv/amd64/tidg
136 usr/kernel/drv/amd64/tivc
137 usr/kernel/drv/amd64/tmux
138 usr/kernel/drv/sparcv9/svvslo
139 usr/kernel/drv/sparcv9/tidg
140 usr/kernel/drv/sparcv9/tivc
141 usr/kernel/drv/sparcv9/tmux
142 usr/kernel/drv/svvslo
143 usr/kernel/drv/svvslo.conf
144 usr/kernel/drv/tidg
145 usr/kernel/drv/tidg.conf
146 usr/kernel/drv/tivc
147 usr/kernel/drv/tivc.conf
148 usr/kernel/drv/tmux
149 usr/kernel/drv/tmux.conf
236 (cd "$SRC/pkg/packages.$MACH"; \
237 nawk '/^dir/ {sub(/.+ path=/, ""); print $1;}' *.metadata.*.redist | \
238 sort -u > "$needdirs")
239
240 #
241 # Step 2: go to our closed directory, and find all the subdirectories,
242 # filtering out the ones needed by the open packages (saved in that
243 # temporary file). Sort in reverse order, so that parent directories
244 # come after any subdirectories, and pipe that to rmdir. If there are
245 # still any lingering files, rmdir will complain. That's fine--we
246 # only want to delete empty directories--so redirect the complaints to
247 # /dev/null.
248 #
249 (cd "$tmpdir/closed/$rootdir"; \
250 find * -type d -print | /usr/xpg4/bin/grep -xv -f $needdirs | \
251 sort -r | xargs -l rmdir 2>/dev/null )
252
253 rm "$needdirs"
254
255 #
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 # Add binary license files.
264 #
265
266 cp -p "$SRC/tools/opensolaris/BINARYLICENSE.txt" "$tmpdir/closed" || \
267 fail "can't add BINARYLICENSE.txt"
268 mkreadme "$tmpdir/closed"
269 if [ -f "$CODEMGR_WS/THIRDPARTYLICENSE.ON-BINARIES" ]; then
270 cp -p "$CODEMGR_WS/THIRDPARTYLICENSE.ON-BINARIES" "$tmpdir/closed"
271 fi
272
273 (cd "$tmpdir"; tar cf "$tarfile" closed) || fail "can't create $tarfile."
274 bzip2 -f "$tarfile" || fail "can't compress $tarfile".
275
276 rm -rf "$tmpdir"
277
278 exit 0
|
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22
23 #
24 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
25 #
26 # Create an encumbered binaries tarball from a full build proto area,
27 # less the contents of an OpenSolaris proto area.
28 #
29
30 usage="bindrop [-n] basename"
31
32 isa=`uname -p`
33
34 PATH="$PATH:/usr/bin:/usr/sfw/bin"
35
36 function fail {
37 print -u2 "bindrop: $@"
38 exit 1
39 }
40
41 function warn {
42 print -u2 "bindrop: warning: $@"
43 }
44
45 [[ -n "$SRC" ]] || fail "SRC must be set."
46 [[ -n "$CODEMGR_WS" ]] || fail "CODEMGR_WS must be set."
47
91
92 [[ -d "${ROOT}${suffix}-closed" ]] || fail "can't find closed root proto area."
93
94 tmpdir=$(mktemp -dt bindropXXXXX)
95 [[ -n "$tmpdir" ]] || fail "can't create temporary directory."
96 mkdir -p "$tmpdir/closed/$rootdir" || exit 1
97
98 #
99 # This will hold a temp list of directories that must be kept, even if
100 # empty.
101 #
102 needdirs=$(mktemp -t needdirsXXXXX)
103 [[ -n "$needdirs" ]] || fail "can't create temporary directory list file."
104
105 #
106 # Copy the closed root parallel tree into a temp directory.
107 #
108 (cd "${ROOT}${suffix}-closed"; tar cf - .) | (cd "$tmpdir/closed/$rootdir"; tar xpf -)
109
110 #
111 # Remove miscellaneous files that we don't want to ship.
112 #
113
114 # SUNWsvvs (SVVS test drivers).
115 delete="
116 usr/include/sys/svvslo.h
117 usr/include/sys/tidg.h
118 usr/include/sys/tivc.h
119 usr/include/sys/tmux.h
120 usr/kernel/drv/amd64/svvslo
121 usr/kernel/drv/amd64/tidg
122 usr/kernel/drv/amd64/tivc
123 usr/kernel/drv/amd64/tmux
124 usr/kernel/drv/sparcv9/svvslo
125 usr/kernel/drv/sparcv9/tidg
126 usr/kernel/drv/sparcv9/tivc
127 usr/kernel/drv/sparcv9/tmux
128 usr/kernel/drv/svvslo
129 usr/kernel/drv/svvslo.conf
130 usr/kernel/drv/tidg
131 usr/kernel/drv/tidg.conf
132 usr/kernel/drv/tivc
133 usr/kernel/drv/tivc.conf
134 usr/kernel/drv/tmux
135 usr/kernel/drv/tmux.conf
222 (cd "$SRC/pkg/packages.$MACH"; \
223 nawk '/^dir/ {sub(/.+ path=/, ""); print $1;}' *.metadata.*.redist | \
224 sort -u > "$needdirs")
225
226 #
227 # Step 2: go to our closed directory, and find all the subdirectories,
228 # filtering out the ones needed by the open packages (saved in that
229 # temporary file). Sort in reverse order, so that parent directories
230 # come after any subdirectories, and pipe that to rmdir. If there are
231 # still any lingering files, rmdir will complain. That's fine--we
232 # only want to delete empty directories--so redirect the complaints to
233 # /dev/null.
234 #
235 (cd "$tmpdir/closed/$rootdir"; \
236 find * -type d -print | /usr/xpg4/bin/grep -xv -f $needdirs | \
237 sort -r | xargs -l rmdir 2>/dev/null )
238
239 rm "$needdirs"
240
241 #
242 # Add binary license files.
243 #
244
245 cp -p "$SRC/tools/opensolaris/BINARYLICENSE.txt" "$tmpdir/closed" || \
246 fail "can't add BINARYLICENSE.txt"
247 mkreadme "$tmpdir/closed"
248 if [ -f "$CODEMGR_WS/THIRDPARTYLICENSE.ON-BINARIES" ]; then
249 cp -p "$CODEMGR_WS/THIRDPARTYLICENSE.ON-BINARIES" "$tmpdir/closed"
250 fi
251
252 (cd "$tmpdir"; tar cf "$tarfile" closed) || fail "can't create $tarfile."
253 bzip2 -f "$tarfile" || fail "can't compress $tarfile".
254
255 rm -rf "$tmpdir"
256
257 exit 0
|