cryptodrop.sh revision 597bd30ba830d1e11c8efdb9a1b9de28e0599f5e
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Create a tarball with crypto binaries.
#
usage="cryptodrop [-n] result-path"
function fail {
print -u2 "cryptodrop: $@"
exit 1
}
# Verify below (after adjusting for -n) that $ROOT exists, is a directory.
#
# Wrapper over cpio to filter out "NNN blocks" messages.
#
function cpio_filt {
integer cpio_stat
cpio_stat=$?
return $cpio_stat
}
#
# Create the README from boilerplate and the contents of the closed
# binary tree.
#
# usage: mkreadme targetdir
#
function mkreadme {
typeset targetdir="$1"
typeset readme="README.CRYPTO-BINARIES.$isa"
}
nondebug=n
while getopts n flag; do
n)
nondebug=y
if [ "$MULTI_PROTO" = yes ]; then
fi
;;
?)
exit 1
;;
esac
done
if [[ $# -ne 1 ]]; then
exit 1
fi
tarfile="$1"
if [[ "$nondebug" = n ]]; then
else
fi
#
# Copy the crypto binaries into a temp directory. This is a bit messy
# because we want to preserve the permissions of intermediate
# directories without including all the contents of those
# directories.
#
# Echo all the parent directories of the given file.
function alldirs {
while [ "$d" != . ]; do
echo $d
done
}
#
# Both alldirs and the cpio -p invocation assume that findcrypto only
# produces relative paths.
#
if [[ "$f" = /* ]]; then
fail "findcrypto produced absolute path ($f)"
fi
done
echo "$f"
alldirs "$f"
#
# Insert binary license files.
#
cp -p "$SRC/tools/opensolaris/BINARYLICENSE.txt" "$tmpdir/proto" || \
fail "could not add BINARYLICENSE.txt"
cp -p "$CODEMGR_WS/THIRDPARTYLICENSE.ON-CRYPTO" "$tmpdir/proto" || \
fail "could not add THIRDPARTYLICENSE.ON-CRYPTO."
exit 0