mpxio-upgrade revision c17d6d0368a95d88a7901e522b92d3f7b95da5da
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# CDDL HEADER START
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# The contents of this file are subject to the terms of the
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# Common Development and Distribution License (the "License").
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# You may not use this file except in compliance with the License.
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# See the License for the specific language governing permissions
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# and limitations under the License.
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# When distributing Covered Code, include this CDDL HEADER in each
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
dbcf55756e293292dfbfbb75fe317dd094b0585fjeff.schenk# If applicable, add the following below this CDDL HEADER, with the
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# fields enclosed by brackets "[]" replaced with your own identifying
dbcf55756e293292dfbfbb75fe317dd094b0585fjeff.schenk# information: Portions Copyright [yyyy] [name of copyright owner]
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# CDDL HEADER END
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# Use is subject to license terms.
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk#ident "%Z%%M% %I% %E% SMI"
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# Make sure that the essential libraries can be found.
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# map $special and $fsckdev
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk if [ $? -eq 0 ]; then
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk if [ $? -eq 0 ]; then
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # display recovery instructions - the first call logs to the service
dbcf55756e293292dfbfbb75fe317dd094b0585fjeff.schenk # log and the second call displays on the console.
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk cecho "These instructions were also logged to the file $RECOVERFILE\n"
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# root ("/") is already mounted read only by the kernel.
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# Remount the root read-write.
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk [ -n "$otherops" ] && mntopts="${mntopts},${otherops}"
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk /sbin/mount -m -F $fstype -o $mntopts $special $mountp \
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# mount /usr read only
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk /sbin/mount -m -F $cfsbacktype -o ro $special $mountp \
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # Must use -o largefiles here to ensure the read-only
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # mount does not fail as a result of having a large
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # In case of a manual restart of the service, mount
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # will emit messages if /usr is already mounted.
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk /sbin/mount -m -F $fstype -o $mntopts $special /usr \
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk if [ $ret_val -eq 0 ]; then
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# update system dump configuration
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # Disable device-in-use checking (done in libdiskmgt).
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # Without disabling this check, the configuration of dump device
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # would fail as the device-in-use code incorrectly concludes that
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # the device is in use and hence prevents configuration of the dump
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk set -- `dumpadm -u 2>&1 | $EGREP 'cannot use /dev.* as dump device'`
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk if [ $? -eq 0 ]; then
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk if /usr/sbin/dumpadm -d $newname > /dev/msglog 2> /dev/console; then
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenkthe dump device.\nold dump device name: $4"
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# Update bootpath for x86 here when we are enabling mpxio on root
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk cur_bootpath=`/usr/sbin/eeprom bootpath | $SED 's/bootpath=[ ]*//g' | $SED 's/[ ].*//'`
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk echo $cur_bootpath | $EGREP -s "/fp@.*/disk|$PHCIOPT"
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk if [ $? -eq 0 ]; then
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk new_bootpath=`$STMSBOOTUTIL -m /devices$cur_bootpath`
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk if [ $? -eq 0 -a "x$new_bootpath" != "x" ]; then
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # stmsboot_util -m phci-based path got mapped path back means
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk new_bootpath=`echo $new_bootpath|$SED "s/.*\/devices//"`
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk# do the actual work
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # NOTE: If the first attempt to run the service has failed due to an
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # expected error, users should be able to manually rerun the service.
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # First mount /usr read only. This must be done to run
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # In the case of a manual rerun of the service, mounting of /usr here
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # fails if /usr already happens to be mounted. It is better that we
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # do not mount /usr if already mounted, but there seems to be no
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # apparent way to check whether /usr is mounted or not as we mount
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # /usr without making an entry into /etc/mnttab. So instead of
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # explicitly checking for mount failures, we just do a sanity check
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # by looking for some file (in this case devfsadm) in /usr.
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk if [ ! -s $DEVFSADM ]; then
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk mpxio_error "failed to mount the /usr filesystem."
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk # update /etc/vfstab to reflect device name changes
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk if $STMSBOOTUTIL -u >/dev/msglog 2>&1; then
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk if [ -s /kernel/drv/md.conf ] && \
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk /usr/sbin/svcadm disable system/device/mpxio-upgrade
faaa489e1cc905efd364e01fe09111173c95db68jeff.schenk mpxio_error "failed to mount the root filesystem."
dbcf55756e293292dfbfbb75fe317dd094b0585fjeff.schenk if [ $usrmounted -eq 1 ]; then