postinstall.tmpl revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#pragma ident "%Z%%M% %I% %E% SMI"
#
#
# fix_drv_migrate (mntpath)
# If root is mirrored and the driver name changes
# across upgrade, then we need to update the system file
# with the forceloads for the new underlying drivers
#
# check if we have a mirrored root.
{ if ( $3 == "/" )
print $1
}'`
fi
}
# add_devid_destroy(filename)
# returns contents in filename
# md_devid_destroy property is required when upgrading
# from pre SVM to SVM releases.
# It is specifically placed between
# # Begin MDD database info and # End MDD database info because
# on the subsequent reboot, this line will be removed automatically when
# metadevadm is run in rc2.d.
#
sed '/^# End MDD database/i\
md_devid_destroy=1;' $1 >>/tmp/t$$
}
# The ugly script below does the following:
# 1. For pre SLVM the mddb_bootlist is transformed from the
# and then :id0 is appended for device ID support.
# 2. For SLVM phase 1 only :id0 is appended to the bootlist.
#
# * set md:mddb_bootlist1="sd:215:16 sd:310:15"
#
# mddb_bootlist1="sd:215:16 sd:310:15";
#
# mddb_bootlist1="sd:215:16:id0 sd:310:15:id0";
#
# MINIROOT:
# If on the miniroot, the md.conf on the target disk is updated
# copied from the miniroot too.
# NONMINIROOT:
# On non miniroot the md.conf is updated as follows:
# if md.conf has the mddb_boolist append :id0 to it.
#if we are in the miniroot copy mddb.cf and mddb_bootlist from
-h /etc/transfer_list ] ; then
# delete all the lines for mddb_bootlist
echo "# Begin MDD database info (do not edit)" >> \
# cmdk->sd migration. Need to reset the forceloaded drivers in
else
#if we are not in the miniroot, then we have 2 cases
# 2. SLVM phase 1. where mddb_bootlist is in md.conf
# not in devid format.
echo "# Begin MDD database info (do not edit)" >> \
| grep mddb_bootlist | \
sed -e \
'/^mddb_bootlist/s/\([a-zA-Z0-9]\{1,\}:[0-9]\{1,\}:[0-9]\{1,\}\)"/\1:id0"/g' \
-e \
'/^mddb_bootlist/s/\([a-zA-Z0-9]\{1,\}:[0-9]\{1,\}:[0-9]\{1,\}\) /\1:id0 /g' \
else
sed -e \
'/^mddb_bootlist/s/\([a-zA-Z0-9]\{1,\}:[0-9]\{1,\}:[0-9]\{1,\}\)"/\1:id0"/g' \
-e \
'/^mddb_bootlist/s/\([a-zA-Z0-9]\{1,\}:[0-9]\{1,\}:[0-9]\{1,\}\) /\1:id0 /g' \
fi
fi
}
}
case $? in
0) ;;
1) cat $inettmp > $inetconf_pre
if [ $? -ne 0 ]; then
echo "couldn't edit $inetconf_pre"
return 1
fi
;;
*) echo "couldn't read $inetconf_pre or $inettmp"
return 1
;;
esac
return 0
}
#
# Remove any svm additions from /etc/inet/inetd.conf.preupgrade
#
if [ $? -ne 0 ]; then
echo "couldn't create $inetsed"
return 1
fi
sed -f $inetsed < $inetconf_pre > $inettmp
if [ $? -ne 0 ]; then
echo "couldn't create $inettmp"
return 1
fi
return 0
}
#
# Perform an upgrade
#
if [ "$IS_AN_UPGRADE" = "true" ]; then
# if previous release was not SLVM or md.conf did not have devids fix it.
DEVID_STATUS=$?
fi
fi
#
# Work with the SMF. The SVM services are in the SMF seed and enabled by
# default. If SVM mddbs are not configured then we should disable the SVM
# services.
#
else
fi
MDDB_STATUS=$?
else
done
# Remove entries in inetd.conf.preupgrade for SLVM daemons
^[# ]*100229/1
^[# ]*100230/1
^[# ]*100242/1
^# METAD
^# METAMHD
^# METAMEDD
^# SLVM Daemons
EOF
fi
fi