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