xref: /titanic_51/usr/src/cmd/sgs/packages/common/checkinstall (revision e23c41c9edb2294649cde3d370ae755701f3f140)
17c478bd9Sstevel@tonic-gate#
240e53e87SAli Bahrami# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate# Use is subject to license terms.
47c478bd9Sstevel@tonic-gate#
57c478bd9Sstevel@tonic-gate# CDDL HEADER START
67c478bd9Sstevel@tonic-gate#
77c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
840e53e87SAli Bahrami# Common Development and Distribution License (the "License").
940e53e87SAli Bahrami# You may not use this file except in compliance with the License.
107c478bd9Sstevel@tonic-gate#
117c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
127c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
137c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
147c478bd9Sstevel@tonic-gate# and limitations under the License.
157c478bd9Sstevel@tonic-gate#
167c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
177c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
187c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
197c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
207c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
217c478bd9Sstevel@tonic-gate#
227c478bd9Sstevel@tonic-gate# CDDL HEADER END
237c478bd9Sstevel@tonic-gate#
247c478bd9Sstevel@tonic-gate
25*e23c41c9SAli Bahrami# Installing the wrong architecture of runtime linker will immediately
26*e23c41c9SAli Bahrami# brick the system. Catch this case and refuse to do it.
27*e23c41c9SAli Bahramiif [ "$PKG_INSTALL_ROOT" = '' -o "$PKG_INSTALL_ROOT" = '/' ]; then
28*e23c41c9SAli Bahrami    SYSARCH=`uname -p`
29*e23c41c9SAli Bahrami    if [ "$SYSARCH" != "$ARCH" ]; then
30*e23c41c9SAli Bahrami	echo "***"
31*e23c41c9SAli Bahrami	echo "*** Cannot install $ARCH linker into root of $SYSARCH system."
32*e23c41c9SAli Bahrami	echo "***"
33*e23c41c9SAli Bahrami	exit 1
34*e23c41c9SAli Bahrami    fi
35*e23c41c9SAli Bahramifi
36*e23c41c9SAli Bahrami
377c478bd9Sstevel@tonic-gateif [ -d $BASEDIR/$SGSBACKUPDIR ];
387c478bd9Sstevel@tonic-gatethen
397c478bd9Sstevel@tonic-gate    echo "***"
40*e23c41c9SAli Bahrami    echo "*** Previous version of SUNWonld already installed. Use"
41*e23c41c9SAli Bahrami    echo "***     # pkgrm SUNWonld"
42*e23c41c9SAli Bahrami    echo "*** to remove it before installing a newer version, or"
43*e23c41c9SAli Bahrami    echo "*** use an admin file to force an overwrite."
447c478bd9Sstevel@tonic-gate    echo "***"
457c478bd9Sstevel@tonic-gate    exit 1
467c478bd9Sstevel@tonic-gatefi
477c478bd9Sstevel@tonic-gate
4840e53e87SAli Bahrami# As of Nevada build snv_104, we require the mmapobj() system call.
4940e53e87SAli Bahrami# Installing on a system that lacks it will break rtld and brick the system.
5040e53e87SAli Bahramielfdump -sN.dynsym /lib/libc.so.1 | grep mmapobj > /dev/null
5140e53e87SAli Bahramiif [ $? != 0 ];
5240e53e87SAli Bahramithen
5340e53e87SAli Bahrami    echo "***"
5440e53e87SAli Bahrami    echo "*** System lacks required mmapobj() system call"
5540e53e87SAli Bahrami    echo "*** Nevada snv_104 or newer is required."
5640e53e87SAli Bahrami    echo "***"
5740e53e87SAli Bahrami    exit 1
5840e53e87SAli Bahramifi
5940e53e87SAli Bahrami
607c478bd9Sstevel@tonic-gateexit 0
61