4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22 #
23 # Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
24 #
25
26 # Make sure that the libraries essential to this stage of booting can be found.
27 LD_LIBRARY_PATH=/lib; export LD_LIBRARY_PATH
28
29 libc_mount() {
30 #
31 # If there is an optimized libc available in /usr that fits this
32 # processor, mount it on top of the base libc.
33 #
34 LIBC_MOE_32=`/usr/bin/moe -32 '/usr/lib/libc/$HWCAP'`
35 if [ -n "$LIBC_MOE_32" ]; then
36 /usr/sbin/mount | egrep -s "^/lib/libc.so.1 on "
37 if [ $? -ne 0 ]; then
38 /usr/sbin/mount -O -F lofs $LIBC_MOE_32 /lib/libc.so.1
39 fi
40 fi
41
42 ARCH64=`isainfo | awk '{print $1}'`
43 LIBC_MOE_64=`/usr/bin/moe -64 /usr/lib/$ARCH64/libc/'$HWCAP'`
57 # Most of the operations in this script are only necessary in the global
58 # zone but due to the way initialization scripts like this are packaged,
59 # it needs to currently exist for all zones.
60 #
61 if smf_is_nonglobalzone; then
62 libc_mount
63 exit $SMF_EXIT_OK
64 fi
65
66 #
67 # Root is already mounted (by the kernel), but still needs to be
68 # checked, possibly remounted and entered into mnttab. First
69 # mount /usr if it is a separate file system. If the file system
70 # type is something other than zfs, mount it read-only. This must
71 # be done first to allow utilities such as fsck and setmnt to
72 # reside on /usr minimizing the space required by the root file
73 # system.
74 #
75 readvfstab "/usr" < $vfstab
76 if [ -n "$mountp" ]; then
77 if [ "$fstype" = cachefs ]; then
78 #
79 # Mount without the cache initially. We'll enable it
80 # later at remount time. This lets us avoid
81 # teaching the statically linked mount program about
82 # cachefs. Here we determine the backfstype.
83 # This is not pretty, but we have no tools for parsing
84 # the option string until we get /usr mounted...
85 #
86 case "$mntopts" in
87 *backfstype=nfs*)
88 cfsbacktype=nfs
89 ;;
90 *backfstype=hsfs*)
91 cfsbacktype=hsfs
92 ;;
93 *)
94 msg='invalid vfstab entry for /usr'
95 echo $msg
96 echo "$SMF_FMRI:" $msg >/dev/msglog
97 cfsbacktype=nfs
98 ;;
99 esac
100 mountfs - /usr $cfsbacktype ro $special ||
101 exit $SMF_EXIT_ERR_FATAL
102 elif [ "$fstype" = zfs ]; then
103 mountfs - /usr $fstype $mntopts - || exit $SMF_EXIT_ERR_FATAL
104 else
105 #
106 # Must use -o largefiles here to ensure the
107 # read-only mount does not fail as a result of
108 # having a large file present on /usr. This gives
109 # fsck a chance to fix up the largefiles flag
110 # before we remount /usr read-write.
111 #
112 if [ "x$mntopts" = x- ]; then
113 mntopts='ro,largefiles'
114 else
115 checkopt largefiles $mntopts
116 if [ "x$option" != xlargefiles ]; then
117 mntopts="largefiles,$mntopts"
118 fi
119
120 checkopt ro $mntopts
121 if [ "x$option" != xro ]; then
122 mntopts="ro,$mntopts"
|
4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22 #
23 # Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
25 #
26
27 # Make sure that the libraries essential to this stage of booting can be found.
28 LD_LIBRARY_PATH=/lib; export LD_LIBRARY_PATH
29
30 libc_mount() {
31 #
32 # If there is an optimized libc available in /usr that fits this
33 # processor, mount it on top of the base libc.
34 #
35 LIBC_MOE_32=`/usr/bin/moe -32 '/usr/lib/libc/$HWCAP'`
36 if [ -n "$LIBC_MOE_32" ]; then
37 /usr/sbin/mount | egrep -s "^/lib/libc.so.1 on "
38 if [ $? -ne 0 ]; then
39 /usr/sbin/mount -O -F lofs $LIBC_MOE_32 /lib/libc.so.1
40 fi
41 fi
42
43 ARCH64=`isainfo | awk '{print $1}'`
44 LIBC_MOE_64=`/usr/bin/moe -64 /usr/lib/$ARCH64/libc/'$HWCAP'`
58 # Most of the operations in this script are only necessary in the global
59 # zone but due to the way initialization scripts like this are packaged,
60 # it needs to currently exist for all zones.
61 #
62 if smf_is_nonglobalzone; then
63 libc_mount
64 exit $SMF_EXIT_OK
65 fi
66
67 #
68 # Root is already mounted (by the kernel), but still needs to be
69 # checked, possibly remounted and entered into mnttab. First
70 # mount /usr if it is a separate file system. If the file system
71 # type is something other than zfs, mount it read-only. This must
72 # be done first to allow utilities such as fsck and setmnt to
73 # reside on /usr minimizing the space required by the root file
74 # system.
75 #
76 readvfstab "/usr" < $vfstab
77 if [ -n "$mountp" ]; then
78 if [ "$fstype" = zfs ]; then
79 mountfs - /usr $fstype $mntopts - || exit $SMF_EXIT_ERR_FATAL
80 else
81 #
82 # Must use -o largefiles here to ensure the
83 # read-only mount does not fail as a result of
84 # having a large file present on /usr. This gives
85 # fsck a chance to fix up the largefiles flag
86 # before we remount /usr read-write.
87 #
88 if [ "x$mntopts" = x- ]; then
89 mntopts='ro,largefiles'
90 else
91 checkopt largefiles $mntopts
92 if [ "x$option" != xlargefiles ]; then
93 mntopts="largefiles,$mntopts"
94 fi
95
96 checkopt ro $mntopts
97 if [ "x$option" != xro ]; then
98 mntopts="ro,$mntopts"
|