clone.ksh revision 090f667debfb7792a579172d3f173753762ee29a
#
# 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.
#
# Other brand clone options are invalid for this brand.
while getopts "R:z:" opt; do
exit $ZONE_SUBPROC_USAGE;;
esac
done
if [ $# -ne 1 ]; then
fail_usage "$0 {sourcezone}";
fi
sourcezone=$1
# Find the active source zone dataset to clone.
sourcezonepath=`/usr/sbin/zonecfg -z $sourcezone info zonepath | \
if [ -z "$sourcezonepath" ]; then
fi
#
# Now set up the zone's datasets
#
#
# First make the top-level dataset.
#
# Create the datasets.
if (( $? != 0 )); then
fi
if (( $? != 0 )); then
fi
# make snapshot
SNAPNUM=0
if [ $? = 0 ]; then
break
fi
done
fi
# do clone
if [ ! -d $ZONEROOT ]; then
fi
# Don't re-sysunconfig if we've already done so
if (( $? != 0 )); then
fi
if (( $? != 0 )); then
fi
fi
# Add a service tag for this zone.
add_svc_tag "$ZONENAME" "clone $sourcezone"
exit $ZONE_SUBPROC_OK