5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
26 # i.manifest - smf(5) service manifest install class action script
29 repfile
=$PKG_INSTALL_ROOT/etc
/svc
/repository.db
32 SVCCFG
=/usr
/sbin
/svccfg
33 SVCADM
=/usr
/sbin
/svcadm
42 # Helper function. Handle services deathrow file.
43 # Arguments: $1:manifest file.
47 TEMP
=/tmp
/svc_deathrow.$$
48 DEATHROW_FILE
=${PKG_INSTALL_ROOT}/etc
/svc
/deathrow
50 # Services deathrow file handling, file format:
51 # <fmri>< ><manifest file>< ><package name>
52 # (field separator is a space character)
54 if [ -s ${DEATHROW_FILE} ]; then
56 # Manifest file could be from another Solaris version, bypass
57 # the service bundle and validation (we only need the fmris
58 # list). Calling svccfg inventory with SVCCFG_NOVALIDATE=1 is
59 # safe because there is no access to the alternate repository.
61 ENTITIES
=`SVCCFG_NOVALIDATE=1 $SVCCFG inventory $1`
62 for fmri
in $ENTITIES; do
64 # If fmri matches one in deathrow file, remove the
68 $AWK "(\$1==\"$fmri\") \
69 {next}; {print}" ${DEATHROW_FILE} >>${TEMP} && \
70 $MV ${TEMP} ${DEATHROW_FILE}
77 # If the repository does not yet exist, create it from the appropriate seed. If
78 # for some reason the seeds do not exist, svccfg(1M) will create the repository
81 if [ ! -f $repfile ]; then
82 if [ -n "$SUNW_PKG_INSTALL_ZONENAME" -a \
83 "$SUNW_PKG_INSTALL_ZONENAME" != "global" ]; then
84 [ -f $PKG_INSTALL_ROOT/lib
/svc
/seed
/nonglobal.db
] && \
85 $CP $PKG_INSTALL_ROOT/lib
/svc
/seed
/nonglobal.db
$repfile
87 [ -f $PKG_INSTALL_ROOT/lib
/svc
/seed
/global.db
] && \
88 $CP $PKG_INSTALL_ROOT/lib
/svc
/seed
/global.db
$repfile
91 $CHOWN root
:sys
$repfile
94 if [ ! -r $PKG_INSTALL_ROOT/etc
/svc
/volatile
/repository_door
]; then
96 # smf(5) is not presently running for the destination environment.
97 # Since we presently cannot refresh without a running svc.startd(1M), we
98 # cannot consistently handle dependent placement. Defer to next boot.
100 while read src dst
; do
107 # Local package install.
109 while read src dst
; do
112 [ "$PKG_INSTALL_ROOT" = "" -o "$PKG_INSTALL_ROOT" = "/" ] && \
113 $SVCADM restart svc
:/system
/manifest-import
:default