#
# 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
#
#
#
m_usage=$(gettext "solaris10 brand usage:\n\tattach [-a archive | -d directory | -r recv_type] [-c sysidcfg]\n\tThe -a archive option specifies an archive name which can be a flar,\n\ttar, pax or cpio archive.\n\tThe -d directory option specifies an existing directory.\n\tThe -r recv_type option specifies the type of archive to be read from\n\tstdin.\n\tThe -c option gives a sysidcfg file and causes an unconfiguration of the zone.")
# Clean up on interrupt
{
# umount any mounted file systems
}
# If the attach failed then clean up the ZFS datasets we created.
# trap_cleanup calls trap_exit. Do not run trap_exit twice.
if [[ -n $EXIT_NOEXECUTE ]]; then
# dryrun mode, nothing to do here; exit with whatever
# EXIT_CODE is set to.
;
elif [[ $EXIT_CODE == $ZONE_SUBPROC_USAGE ]]; then
# Usage message printed, nothing to do here.
;
elif [[ $EXIT_CODE == $ZONE_SUBPROC_OK ]]; then
elif [[ $EXIT_CODE == $ZONE_SUBPROC_TRYAGAIN ]]; then
else
# Remove datasets that shouldn't exist
fi
vlog "Exiting with exit code $EXIT_CODE"
exit $EXIT_CODE
}
install_media="-"
rm_ds=0
# If we weren't passed at least two arguments, exit now.
# Used by start_log()
set -A save_args "$0" "$@"
zone=
# Set ZONEPATH, etc.
eval $(bind_legacy_zone_globals zone)
# Clear the child dataset list - solaris10 should not create them.
set -A zone.new_be_datasets
shift; shift # remove ZONENAME and ZONEPATH from arguments array
unset inst_type
unset sc_sysidcfg
# Other brand attach options are invalid for this brand.
while getopts "a:c:d:nr:x:" opt; do
a)
if [[ -n "$inst_type" ]]; then
fi
inst_type="archive"
;;
c) sc_sysidcfg="$OPTARG" ;;
d)
if [[ -n "$inst_type" ]]; then
fi
inst_type="directory"
# '-d -' means use the existing zonepath.
if [[ "$install_media" == "$ZONEPATH" ]]; then
install_media="-"
fi
;;
n) noexecute=1 ;;
r)
if [[ -n "$inst_type" ]]; then
fi
inst_type="stdin"
;;
x) ;; # zoneadm only
?) fail_usage "" ;;
*) fail_usage "";;
esac
done
fi
#
# The zone doesn't have to exist when the -n option is used, so do
# this work early.
#
# XXX do the sw validation for solaris10 minimal patch level to ensure
# everything will be ok.
# Exit handler not yet active, so no need to worry about it.
exit $ZONE_SUBPROC_OK
fi
trap trap_cleanup INT
log "$m_attach_log" "$LOGFILE"
#
# Perform a final check that this is really a zone image and not an archive of
# a system image which would need p2v. Check for a well-known S10 SMF service
# that shouldn't exist in a zone.
#
fi
trap - EXIT
log "$m_attach_log" "$LOGFILE"
exit $ZONE_SUBPROC_OK