Print this page
6197 get rid of unused checks in fs-root and fs-usr boot scripts


   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) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24 #
  25 # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
  26 # All rights reserved.

  27 #
  28 #
  29 . /lib/svc/share/smf_include.sh
  30 . /lib/svc/share/fs_include.sh
  31 
  32 UPDATEFILE=/etc/svc/volatile/boot_archive_needs_update
  33 
  34 #
  35 # Once root is read/write we can enable the dedicated dumpdevice if it exists
  36 # locally. This is an optimization as svc-dumpadm will attempt do this later.
  37 #
  38 dump_setup()
  39 {
  40         [ -r /etc/dumpadm.conf ] && . /etc/dumpadm.conf
  41 
  42         readswapdev $DUMPADM_DEVICE < $vfstab
  43 
  44         #
  45         # Make sure that the dump save area has been configured before
  46         # proceeding. If the variable has not been defined or does not exist
  47         # then bail out early. This will prevent us from configuring a
  48         # dump save area before a hostname has been configured (i.e after


  95         [ "$fstype" = nfs ] && mntopts="${mntopts},llock"
  96 
  97         # if root dev is a read-only metadevice then fail
  98         case $special in
  99         /dev/md/dsk/*)
 100                 dd if=/dev/null of=$special count=0 >/dev/null 2>&1 ||
 101                     exit $SMF_EXIT_ERR_FATAL
 102                 ;;
 103         esac
 104 
 105         mountfs -m $mountp $fstype $mntopts - || exit $SMF_EXIT_ERR_FATAL
 106 fi
 107 
 108 #
 109 # Check and remount the /usr file system (formerly mounted read-only).
 110 # Unless root is zfs, in which case we've already mounted /usr read-write
 111 #
 112 if [ "$rootiszfs" = 0 ] ; then
 113         readvfstab /usr < $vfstab
 114         if [ "$mountp" ]; then
 115                 if [ "$fstype" = cachefs ]; then
 116                         mountfs -O $mountp cachefs $mntopts $special ||
 117                             exit $SMF_EXIT_ERR_FATAL
 118                 else
 119                         checkopt ro $mntopts
 120                         if [ "x$option" != xro ]; then
 121                                 checkfs $fsckdev $fstype $mountp ||
 122                                     exit $SMF_EXIT_ERR_FATAL
 123                                 if [ "x$mntopts" != x- ]; then
 124                                         mntopts="remount,$mntopts"
 125                                 else
 126                                         mntopts="remount"
 127                                 fi
 128 
 129                                 # if usr dev is a read-only metadevice then fail
 130                                 case $special in
 131                                 /dev/md/dsk/*)
 132                                         dd if=/dev/null of=$special count=0 \
 133                                             >/dev/null 2>&1 || exit $SMF_EXIT_ERR_FATAL
 134                                         ;;
 135                                 esac
 136 
 137                                 mountfs - /usr $fstype $mntopts - ||
 138                                     exit $SMF_EXIT_ERR_FATAL
 139                         fi
 140                 fi
 141         fi
 142 fi
 143 
 144 #
 145 # Check and mount the /usr/platform file system.  This should only be
 146 # present when a SunOS 5.5 (Solaris 2.5) or greater client is being
 147 # administered by a SunOS 5.4 or less host.
 148 #
 149 readvfstab /usr/platform < $vfstab
 150 if [ "$mountp" ]; then
 151         checkfs $fsckdev $fstype $mountp || exit $SMF_EXIT_ERR_FATAL
 152         mountfs - $mountp $fstype $mntopts - || exit $SMF_EXIT_ERR_FATAL
 153 fi
 154 
 155 #
 156 # Mount the fd file systems if mount point exists.
 157 #
 158 readvfstab /dev/fd < $vfstab
 159 if [ "$mountp" -a -d /dev/fd ]; then
 160         mountfs - /dev/fd - - - || exit $SMF_EXIT_ERR_FATAL
 161 fi




   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) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24 #
  25 # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
  26 # All rights reserved.
  27 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  28 #

  29 . /lib/svc/share/smf_include.sh
  30 . /lib/svc/share/fs_include.sh
  31 
  32 UPDATEFILE=/etc/svc/volatile/boot_archive_needs_update
  33 
  34 #
  35 # Once root is read/write we can enable the dedicated dumpdevice if it exists
  36 # locally. This is an optimization as svc-dumpadm will attempt do this later.
  37 #
  38 dump_setup()
  39 {
  40         [ -r /etc/dumpadm.conf ] && . /etc/dumpadm.conf
  41 
  42         readswapdev $DUMPADM_DEVICE < $vfstab
  43 
  44         #
  45         # Make sure that the dump save area has been configured before
  46         # proceeding. If the variable has not been defined or does not exist
  47         # then bail out early. This will prevent us from configuring a
  48         # dump save area before a hostname has been configured (i.e after


  95         [ "$fstype" = nfs ] && mntopts="${mntopts},llock"
  96 
  97         # if root dev is a read-only metadevice then fail
  98         case $special in
  99         /dev/md/dsk/*)
 100                 dd if=/dev/null of=$special count=0 >/dev/null 2>&1 ||
 101                     exit $SMF_EXIT_ERR_FATAL
 102                 ;;
 103         esac
 104 
 105         mountfs -m $mountp $fstype $mntopts - || exit $SMF_EXIT_ERR_FATAL
 106 fi
 107 
 108 #
 109 # Check and remount the /usr file system (formerly mounted read-only).
 110 # Unless root is zfs, in which case we've already mounted /usr read-write
 111 #
 112 if [ "$rootiszfs" = 0 ] ; then
 113         readvfstab /usr < $vfstab
 114         if [ "$mountp" ]; then




 115                 checkopt ro $mntopts
 116                 if [ "x$option" != xro ]; then
 117                         checkfs $fsckdev $fstype $mountp ||
 118                             exit $SMF_EXIT_ERR_FATAL
 119                         if [ "x$mntopts" != x- ]; then
 120                                 mntopts="remount,$mntopts"
 121                         else
 122                                 mntopts="remount"
 123                         fi
 124 
 125                         # if usr dev is a read-only metadevice then fail
 126                         case $special in
 127                         /dev/md/dsk/*)
 128                                 dd if=/dev/null of=$special count=0 \
 129                                     >/dev/null 2>&1 || exit $SMF_EXIT_ERR_FATAL
 130                                 ;;
 131                         esac
 132 
 133                         mountfs - /usr $fstype $mntopts - ||
 134                             exit $SMF_EXIT_ERR_FATAL
 135                 fi
 136         fi

 137 fi
 138 
 139 #
 140 # Check and mount the /usr/platform file system.  This should only be
 141 # present when a SunOS 5.5 (Solaris 2.5) or greater client is being
 142 # administered by a SunOS 5.4 or less host.
 143 #
 144 readvfstab /usr/platform < $vfstab
 145 if [ "$mountp" ]; then
 146         checkfs $fsckdev $fstype $mountp || exit $SMF_EXIT_ERR_FATAL
 147         mountfs - $mountp $fstype $mntopts - || exit $SMF_EXIT_ERR_FATAL
 148 fi
 149 
 150 #
 151 # Mount the fd file systems if mount point exists.
 152 #
 153 readvfstab /dev/fd < $vfstab
 154 if [ "$mountp" -a -d /dev/fd ]; then
 155         mountfs - /dev/fd - - - || exit $SMF_EXIT_ERR_FATAL
 156 fi