preinstall revision 0ea5e3a571e3da934507bdd32924d11659c70704
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# CDDL HEADER START
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# The contents of this file are subject to the terms of the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Common Development and Distribution License (the "License").
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# You may not use this file except in compliance with the License.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# See the License for the specific language governing permissions
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# and limitations under the License.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# When distributing Covered Code, include this CDDL HEADER in each
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# If applicable, add the following below this CDDL HEADER, with the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# fields enclosed by brackets "[]" replaced with your own identifying
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# information: Portions Copyright [yyyy] [name of copyright owner]
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# CDDL HEADER END
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Use is subject to license terms.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#ident "%Z%%M% %I% %E% SMI"
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesif [ -f $BASEDIR/etc/TIMEZONE ] ; then
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes cp $BASEDIR/etc/TIMEZONE $BASEDIR/etc/TIMEZONE.temp
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesif [ -h $BASEDIR/var/mail ] ; then
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes mv $BASEDIR/var/mail $BASEDIR/var/mail.ABCsavedXYZ
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesif [ -h $BASEDIR/var/news ] ; then
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes mv $BASEDIR/var/news $BASEDIR/var/news.ABCsavedXYZ
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesprint_dhcptags_warning() {
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes cat >> $CLEANUP <<-EOF
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes You have made changes to /etc/dhcp/dhcptags, which has been superseded
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes by /etc/dhcp/inittab, as documented in dhcp_inittab(4). Please refer
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes to the DHCP documentation in the Answerbook for information on how to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes convert your existing customizations.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesif [ "x$UPDATE" = xyes ]; then
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # If the dhcptags file has been modified, then install moved
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # it to a funky name like /etc/dhcp/dhcptags:8. Use this as
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # an opportunity to issue a warning to the user. Since the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # file may be left over from a previous upgrade, only issue
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # the warning if the current package database is familiar with
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # The construct ${PKG_INSTALL_ROOT:-/} is used instead of
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # $PKG_INSTALL_ROOT/ because the packaging subsystem will
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # think we're changing the path (from $PKG_INSTALL_ROOT to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # $PKG_INSTALL_ROOT/) and will output spurious warnings.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # We need to pass in the -R since otherwise we will get a
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # warning from a `make install' on this package that we may
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # be accessing a stale package database (in fact, this won't
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # happen since installf and friends inherit the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # $PKG_INSTALL_ROOT environment variable). Note that the -R
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # must be on the same line as the command it's used with.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # ${CLIENT_BASEDIR}foo is used instead of $CLIENT_BASEDIR/foo
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # because the packaging commands don't always realize that
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # //foo and /foo are the same file.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes if [ "`echo $DHCPTAGS:*`" != "$DHCPTAGS:*" ]; then
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes pkgchk -l -R ${PKG_INSTALL_ROOT:-/} \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes -p ${CLIENT_BASEDIR}etc/dhcp/dhcptags $PKGINST | \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes grep -i installed > /dev/null 2>&1 && \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes print_dhcptags_warning
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# We apply the limited profile on initial installs of the OS and of
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# initial installs of zones. We don't apply it on upgrades or patches.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesif [ "x$PKG_INIT_INSTALL" = "xTRUE" ]; then
bb2b38cd44b032118359afbc743efbea12f48e61bnicholeselif [ `/sbin/zonename` = "global" -a "x$SUNW_PKG_INSTALL_ZONENAME" != "x" -a \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes "x$SUNW_PKG_INSTALL_ZONENAME" != "xglobal" ]; then