i.manifest revision 1ae0874509b6811fdde1dfd46f0d93fd09867a3f
70N/A#!/bin/sh
70N/A#
70N/A# CDDL HEADER START
70N/A#
70N/A# The contents of this file are subject to the terms of the
70N/A# Common Development and Distribution License, Version 1.0 only
70N/A# (the "License"). You may not use this file except in compliance
70N/A# with the License.
70N/A#
70N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
70N/A# or http://www.opensolaris.org/os/licensing.
70N/A# See the License for the specific language governing permissions
70N/A# and limitations under the License.
70N/A#
70N/A# When distributing Covered Code, include this CDDL HEADER in each
70N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
70N/A# If applicable, add the following below this CDDL HEADER, with the
70N/A# fields enclosed by brackets "[]" replaced with your own identifying
70N/A# information: Portions Copyright [yyyy] [name of copyright owner]
70N/A#
70N/A# CDDL HEADER END
70N/A#
70N/A#
70N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
70N/A# Use is subject to license terms.
70N/A#
70N/A# ident "%Z%%M% %I% %E% SMI"
70N/A#
70N/A# i.manifest - smf(5) service manifest install class action script
70N/A#
70N/A
70N/Arepfile=$PKG_INSTALL_ROOT/etc/svc/repository.db
70N/Aexport repfile
70N/A
70N/A#
70N/A# If the repository does not yet exist, create it from the appropriate seed. If
70N/A# for some reason the seeds do not exist, svccfg(1M) will create the repository
70N/A# automatically.
70N/A#
70N/Aif [ ! -f $repfile ]; then
70N/A if [ -n "$SUNW_PKG_INSTALL_ZONENAME" -a \
70N/A "$SUNW_PKG_INSTALL_ZONENAME" != "global" ]; then
70N/A [ -f $PKG_INSTALL_ROOT/lib/svc/seed/nonglobal.db ] && \
70N/A /usr/bin/cp $PKG_INSTALL_ROOT/lib/svc/seed/nonglobal.db \
70N/A $repfile
70N/A else
70N/A [ -f $PKG_INSTALL_ROOT/lib/svc/seed/global.db ] && \
70N/A /usr/bin/cp $PKG_INSTALL_ROOT/lib/svc/seed/global.db \
70N/A $repfile
70N/A fi
70N/A /usr/bin/chmod 0600 $repfile
70N/A /usr/bin/chown root:sys $repfile
70N/Afi
70N/A
70N/Aif [ ! -r $PKG_INSTALL_ROOT/etc/svc/volatile/repository_door ]; then
70N/A #
70N/A # smf(5) is not presently running for the destination environment.
70N/A # Since we presently cannot refresh without a running svc.startd(1M), we
70N/A # cannot consistently handle dependent placement. Defer to next boot.
70N/A #
while read src dst; do
/usr/bin/cp -p $src $dst
done
else
#
# Local package install.
#
while read src dst; do
/usr/bin/cp -p $src $dst
[ "$PKG_INSTALL_ROOT" = "" -o "$PKG_INSTALL_ROOT" = "/" ] && \
SVCCFG_CHECKHASH=1 /usr/sbin/svccfg import $dst
done
fi
exit 0