xref: /titanic_50/usr/src/cmd/svc/milestone/fs-minimal (revision 29e83d4b25fd82feb8e0e0fbe89f7e2a8438533d)
1#!/sbin/sh
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License, Version 1.0 only
7# (the "License").  You may not use this file except in compliance
8# with the License.
9#
10# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11# or http://www.opensolaris.org/os/licensing.
12# See the License for the specific language governing permissions
13# and limitations under the License.
14#
15# When distributing Covered Code, include this CDDL HEADER in each
16# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17# If applicable, add the following below this CDDL HEADER, with the
18# fields enclosed by brackets "[]" replaced with your own identifying
19# information: Portions Copyright [yyyy] [name of copyright owner]
20#
21# CDDL HEADER END
22#
23#
24# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
28# All rights reserved.
29#
30#
31# ident	"%Z%%M%	%I%	%E% SMI"
32
33. /lib/svc/share/smf_include.sh
34. /lib/svc/share/fs_include.sh
35
36# Mount other file systems to be available in single user mode.
37# Currently, these are /var, /var/adm, /var/run and /tmp.  A change
38# here will require a modification to the following programs (and
39# documentation): /sbin/mountall, /sbin/umountall, and
40# /lib/svc/bin/svc.startd.
41
42for fs in /var /var/adm /tmp; do
43	readvfstab $fs < $vfstab
44	if [ -n "$mountp" ]; then
45		mounted $mountp $mntopts $fstype < /etc/mnttab && continue
46		checkfs $fsckdev $fstype $mountp || exit $SMF_EXIT_ERR_FATAL
47		mountfs -O $mountp $fstype $mntopts - ||
48		    exit $SMF_EXIT_ERR_FATAL
49	fi
50done
51
52mounted /var/run - tmpfs < /etc/mnttab && exit $SMF_EXIT_OK
53mountfs -O /var/run tmpfs - swap || exit $SMF_EXIT_ERR_FATAL
54
55exit $SMF_EXIT_OK
56