fs-usr revision 7c478bd95313f5f23a4c958a745db2134aa03244
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# CDDL HEADER START
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# The contents of this file are subject to the terms of the
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# Common Development and Distribution License, Version 1.0 only
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# (the "License"). You may not use this file except in compliance
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# with the License.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# See the License for the specific language governing permissions
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# and limitations under the License.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# When distributing Covered Code, include this CDDL HEADER in each
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# If applicable, add the following below this CDDL HEADER, with the
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# fields enclosed by brackets "[]" replaced with your own identifying
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# information: Portions Copyright [yyyy] [name of copyright owner]
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# CDDL HEADER END
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# Use is subject to license terms.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# All rights reserved.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# ident "%Z%%M% %I% %E% SMI"
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# Add physical swap.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# Check and remount the / (root) file system.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# For NFS mounts, force the llock option on.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomiif [ "${_INIT_ZONENAME:=`/sbin/zonename`}" = "global" ]; then
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi checkfs $fsckdev $fstype $mountp || exit $SMF_EXIT_ERR_FATAL
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi [ -n "$otherops" ] && mntopts="${mntopts},${otherops}"
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi # if root dev is a read-only metadevice then fail
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi dd if=/dev/null of=$special count=0 >/dev/null 2>&1 ||
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi mountfs -m $mountp $fstype $mntopts - || exit $SMF_EXIT_ERR_FATAL
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# Check and remount the /usr file system (formerly mounted read-only).
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomiif [ "$mountp" ]; then
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi if [ "x$mntopts" != x- ]; then
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi # if usr dev is a read-only metadevice then fail
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# Check and mount the /usr/platform file system. This should only be
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# present when a SunOS 5.5 (Solaris 2.5) or greater client is being
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# administered by a SunOS 5.4 or less host.
a53b81d08bf21d802705f6ff2df70cdf0e39e61dAki Tuomiif [ "$mountp" ]; then
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi checkfs $fsckdev $fstype $mountp || exit $SMF_EXIT_ERR_FATAL
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi mountfs - $mountp $fstype $mntopts - || exit $SMF_EXIT_ERR_FATAL
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi# Mount the fd file systems if mount point exists.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi mountfs - /dev/fd - - - || exit $SMF_EXIT_ERR_FATAL
7e1a69e513739a7c12e3c5ec53dff1eb01b90524Aki Tuomi# Clean up existing /etc/dfs/sharetab as there are no shared file systems
7e1a69e513739a7c12e3c5ec53dff1eb01b90524Aki Tuomi# at this point. This also takes care of a corrupt sharetab.