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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/milestone/fs-usr
          +++ new/usr/src/cmd/svc/milestone/fs-usr
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17  # fields enclosed by brackets "[]" replaced with your own identifying
  18   18  # information: Portions Copyright [yyyy] [name of copyright owner]
  19   19  #
  20   20  # CDDL HEADER END
  21   21  #
  22   22  #
  23   23  # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24  #
  25   25  # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
  26   26  # All rights reserved.
       27 +# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  27   28  #
  28      -#
  29   29  . /lib/svc/share/smf_include.sh
  30   30  . /lib/svc/share/fs_include.sh
  31   31  
  32   32  UPDATEFILE=/etc/svc/volatile/boot_archive_needs_update
  33   33  
  34   34  #
  35   35  # Once root is read/write we can enable the dedicated dumpdevice if it exists
  36   36  # locally. This is an optimization as svc-dumpadm will attempt do this later.
  37   37  #
  38   38  dump_setup()
↓ open down ↓ 66 lines elided ↑ open up ↑
 105  105          mountfs -m $mountp $fstype $mntopts - || exit $SMF_EXIT_ERR_FATAL
 106  106  fi
 107  107  
 108  108  #
 109  109  # Check and remount the /usr file system (formerly mounted read-only).
 110  110  # Unless root is zfs, in which case we've already mounted /usr read-write
 111  111  #
 112  112  if [ "$rootiszfs" = 0 ] ; then
 113  113          readvfstab /usr < $vfstab
 114  114          if [ "$mountp" ]; then
 115      -                if [ "$fstype" = cachefs ]; then
 116      -                        mountfs -O $mountp cachefs $mntopts $special ||
      115 +                checkopt ro $mntopts
      116 +                if [ "x$option" != xro ]; then
      117 +                        checkfs $fsckdev $fstype $mountp ||
 117  118                              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
      119 +                        if [ "x$mntopts" != x- ]; then
      120 +                                mntopts="remount,$mntopts"
      121 +                        else
      122 +                                mntopts="remount"
      123 +                        fi
 128  124  
 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
      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
 136  132  
 137      -                                mountfs - /usr $fstype $mntopts - ||
 138      -                                    exit $SMF_EXIT_ERR_FATAL
 139      -                        fi
      133 +                        mountfs - /usr $fstype $mntopts - ||
      134 +                            exit $SMF_EXIT_ERR_FATAL
 140  135                  fi
 141  136          fi
 142  137  fi
 143  138  
 144  139  #
 145  140  # Check and mount the /usr/platform file system.  This should only be
 146  141  # present when a SunOS 5.5 (Solaris 2.5) or greater client is being
 147  142  # administered by a SunOS 5.4 or less host.
 148  143  #
 149  144  readvfstab /usr/platform < $vfstab
↓ open down ↓ 52 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX