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