fs-minimal revision b21718f06a7f8468913c84002f8381a5ee1cb8c4
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# CDDL HEADER START
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# The contents of this file are subject to the terms of the
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# Common Development and Distribution License (the "License").
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# You may not use this file except in compliance with the License.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# See the License for the specific language governing permissions
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# and limitations under the License.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# When distributing Covered Code, include this CDDL HEADER in each
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# If applicable, add the following below this CDDL HEADER, with the
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# fields enclosed by brackets "[]" replaced with your own identifying
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# information: Portions Copyright [yyyy] [name of copyright owner]
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# CDDL HEADER END
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# Use is subject to license terms.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincent# All rights reserved.
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincent# ident "%Z%%M% %I% %E% SMI"
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# Mount other file systems to be available in single user mode.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# Currently, these are /var, /var/adm, /var/run and /tmp. A change
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# here will require a modification to the following programs (and
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# documentation): /sbin/mountall, /sbin/umountall, and
ad0b283113c3f11ac1877df97d5d0fae899b56caBrendan Mmiller if [ -n "$mountp" ]; then
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle mounted $mountp $mntopts $fstype < /etc/mnttab && continue
c7d50eceb9a78ce2ecf39004ad4cf7e3d236aab0Alin Brici checkfs $fsckdev $fstype $mountp || exit $SMF_EXIT_ERR_FATAL
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle mountpt=`zfs get -H -o value mountpoint $be$fs 2>/dev/null`
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle if [ $? = 0 ] ; then
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienleif [ $? != 0 ] ; then
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincent mountfs -O /var/run tmpfs - swap || exit $SMF_EXIT_ERR_FATAL
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle /sbin/zfs list -rH -o mountpoint -s mountpoint -t filesystem $be | \
b1c33bb0456be2f3b9e866871ff404ae012978b9Chad Kienle while read mountp ; do
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle if [ "x$mountp" != "x" -a "$mountp" != "legacy" ] ; then
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincent mounted $mountp - zfs < /etc/mnttab && continue