#
# 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
#
#
#
# s10 boot script.
#
# The arguments to this script are the zone name and the zonepath.
#
ZONENAME=$1
ZONEPATH=$2
if [ "$arch" = "i386" ]; then
elif [ "$arch" = "sparc" ]; then
# 32-bit SPARC not supported!
else
echo "Unsupported architecture: $arch"
exit 2
fi
#
# Run the s10_support boot hook.
#
if (( $? != 0 )) ; then
exit 1
fi
#
# Replace the specified file in the booting zone with a wrapper script that
# invokes s10_isaexec_wrapper. This is a convenience function that reduces
# clutter and code duplication.
#
# Parameters:
# $2 The access mode of the replacement file in hex (e.g., 0555)
# $3 The name of the replacement file's owner (e.g., root:bin)
#
# NOTE: The checks performed in the 'if' statement below are not generic: they
# depend on the success of the zone filesystem structure validation performed
# above to ensure that intermediate directories exist and aren't symlinks.
#
path_dname=$ZONEROOT/`dirname $1`
[ ! -f $1 ] && printf "$w_missing" "$1"
if [ ! -h $path_dname -a -d $path_dname ]; then
safe_replace $ZONEROOT/$1 $BRANDDIR/s10_isaexec_wrapper $2 $3 \
fi
}
path_dname=$ZONEROOT/`dirname $1`
[ ! -f $1 ] && printf "$w_missing" "$1"
if [ ! -h $path_dname -a -d $path_dname ]; then
safe_replace $ZONEROOT/$1 $BRANDDIR/s10_python_wrapper $2 $3 \
fi
}
#
# Create a new wrapper script that invokes s10_isaexec_wrapper in the
# brand (for a non-existing s10c file) pointing to the native brand file.
#
# Parameters:
# $1 The full path of the wrapper file to create
# $2 The access mode of the replacement file in hex (e.g., 0555)
# $3 The name of the replacement file's owner (e.g., root:bin)
#
[ ! -f $1 ] && printf "$w_missing" "$1"
path_dname=$ZONEROOT/`dirname $1`
if [ ! -h $path_dname -a -d $path_dname -a ! -f $ZONEROOT/$1 ]; then
safe_wrap $ZONEROOT/$1 $BRANDDIR/s10_isaexec_wrapper $2 $3
fi
}
#
# Before we boot we validate and fix, if necessary, the required files within
# the zone. These modifications can be lost if a patch is applied within the
# zone, so we validate and fix the zone every time it boots.
#
#
# BINARY REPLACEMENT
#
# This section of the boot script is responsible for replacing Solaris 10
# binaries within the booting zone with Nevada binaries. This is a two-step
# process: First, the directory structure of the zone is validated to ensure
# that binary replacement will proceed safely. Second, Solaris 10 binaries
# are replaced with Nevada binaries.
#
#
# 1. Go to the section below labeled "STEP ONE" and add the following
# two lines:
#
# safe_dir /usr
#
# within the booting zone that can be safely accessed by the global
# zone.
# 2. Go to the section below labeled "STEP TWO" and add the following
# line:
#
#
# Details about the binary replacement procedure can be found in the Solaris 10
# Containers Developer Guide.
#
#
# STEP ONE
#
# Validate that the zone filesystem looks like we expect it to.
#
if [ -n "$ARCH32" ]; then
fi
if [ -n "$ARCH64" ]; then
fi
#
# Some of the native networking daemons such as in.mpathd are
#
#
# STEP TWO
#
# Replace Solaris 10 binaries with Nevada binaries.
#
#
# Replace various network-related programs with native wrappers.
#
#
# Replace IPFilter commands with native wrappers
#
if [ -n "$ARCH32" ]; then
fi
if [ -n "$ARCH64" ]; then
fi
#
#
fi
#
#
#
# Create ipmgmtd wrapper to native binary in s10 container
# and copy ipmgmt service manifest and method.
#
#
# To handle certain IPMP configurations, we need updated
# net-physical method script and native net_include.sh
#
#
# S10 container, the kernel will return EINVAL. So we need this.
#
#
# Replace various ZFS-related programs with native wrappers. These commands
# either link with libzfs, dlopen libzfs or link with libraries that link
# or dlopen libzfs. Commands which fall into these categories but which can
# only be used in the global zone are not wrapped. The libdiskmgt dm_in_use
# code uses libfs, but only the zpool_in_use() -> zpool_read_label() code path.
#
#
# Replace automount and automountd with native wrappers.
#
#
# The class-specific dispadmin(1M) and priocntl(1) binaries must be native
# wrappers, and we must have all of the ones the native zone does. This
# allows new scheduling classes to appear without causing dispadmin and
# priocntl to be unhappy.
#
done
#
# END OF STEP TWO
#
#
# install or remove drivers will work. NOTE: add_drv and rem_drv are hard
# linked to isaexec so we want to remove the current executable and
# then copy true so that we don't clobber isaexec.
#
exit 0