xref: /onnv-gate/usr/src/cmd/sgs/packages/common/checkinstall (revision 9406:264141fcf761)
10Sstevel@tonic-gate#
28881SAli.Bahrami@Sun.COM# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
30Sstevel@tonic-gate# Use is subject to license terms.
40Sstevel@tonic-gate#
50Sstevel@tonic-gate# CDDL HEADER START
60Sstevel@tonic-gate#
70Sstevel@tonic-gate# The contents of this file are subject to the terms of the
88881SAli.Bahrami@Sun.COM# Common Development and Distribution License (the "License").
98881SAli.Bahrami@Sun.COM# You may not use this file except in compliance with the License.
100Sstevel@tonic-gate#
110Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
120Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
130Sstevel@tonic-gate# See the License for the specific language governing permissions
140Sstevel@tonic-gate# and limitations under the License.
150Sstevel@tonic-gate#
160Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
170Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
180Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
190Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
200Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
210Sstevel@tonic-gate#
220Sstevel@tonic-gate# CDDL HEADER END
230Sstevel@tonic-gate#
240Sstevel@tonic-gate
25*9406SAli.Bahrami@Sun.COM# Installing the wrong architecture of runtime linker will immediately
26*9406SAli.Bahrami@Sun.COM# brick the system. Catch this case and refuse to do it.
27*9406SAli.Bahrami@Sun.COMif [ "$PKG_INSTALL_ROOT" = '' -o "$PKG_INSTALL_ROOT" = '/' ]; then
28*9406SAli.Bahrami@Sun.COM    SYSARCH=`uname -p`
29*9406SAli.Bahrami@Sun.COM    if [ "$SYSARCH" != "$ARCH" ]; then
30*9406SAli.Bahrami@Sun.COM	echo "***"
31*9406SAli.Bahrami@Sun.COM	echo "*** Cannot install $ARCH linker into root of $SYSARCH system."
32*9406SAli.Bahrami@Sun.COM	echo "***"
33*9406SAli.Bahrami@Sun.COM	exit 1
34*9406SAli.Bahrami@Sun.COM    fi
35*9406SAli.Bahrami@Sun.COMfi
36*9406SAli.Bahrami@Sun.COM
370Sstevel@tonic-gateif [ -d $BASEDIR/$SGSBACKUPDIR ];
380Sstevel@tonic-gatethen
390Sstevel@tonic-gate    echo "***"
40*9406SAli.Bahrami@Sun.COM    echo "*** Previous version of SUNWonld already installed. Use"
41*9406SAli.Bahrami@Sun.COM    echo "***     # pkgrm SUNWonld"
42*9406SAli.Bahrami@Sun.COM    echo "*** to remove it before installing a newer version, or"
43*9406SAli.Bahrami@Sun.COM    echo "*** use an admin file to force an overwrite."
440Sstevel@tonic-gate    echo "***"
450Sstevel@tonic-gate    exit 1
460Sstevel@tonic-gatefi
470Sstevel@tonic-gate
488881SAli.Bahrami@Sun.COM# As of Nevada build snv_104, we require the mmapobj() system call.
498881SAli.Bahrami@Sun.COM# Installing on a system that lacks it will break rtld and brick the system.
508881SAli.Bahrami@Sun.COMelfdump -sN.dynsym /lib/libc.so.1 | grep mmapobj > /dev/null
518881SAli.Bahrami@Sun.COMif [ $? != 0 ];
528881SAli.Bahrami@Sun.COMthen
538881SAli.Bahrami@Sun.COM    echo "***"
548881SAli.Bahrami@Sun.COM    echo "*** System lacks required mmapobj() system call"
558881SAli.Bahrami@Sun.COM    echo "*** Nevada snv_104 or newer is required."
568881SAli.Bahrami@Sun.COM    echo "***"
578881SAli.Bahrami@Sun.COM    exit 1
588881SAli.Bahrami@Sun.COMfi
598881SAli.Bahrami@Sun.COM
600Sstevel@tonic-gateexit 0
61