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