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) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24 #
25 #
26 PATH=/usr/bin:/usr/sbin:$PATH; export PATH
27 STMSBOOTUTIL=/lib/mpxio/stmsboot_util
28 STMSMETHODSCRIPT=/lib/svc/method/mpxio-upgrade
29 KDRVCONF=
30 DRVCONF=
31 TMPDRVCONF=
32 TMPDRVCONF_MPXIO_ENTRY=
33 TMPDRVCONF_SATA_ENTRY=
34 DRVLIST=
35 GUID=
36 VFSTAB=/etc/vfstab
37 SAVEDIR=/etc/mpxio
38 BOOTDEVICES=$SAVEDIR/boot-devices
39 RECOVERFILE=$SAVEDIR/recover_instructions
40 SVCCFG_RECOVERY=$SAVEDIR/svccfg_recover
41 SUPPORTED_DRIVERS="fp|mpt|mpt_sas|pmcs"
42 USAGE=`gettext "Usage: stmsboot [-D $SUPPORTED_DRIVERS] -e | -d | -u | -L | -l controller_number"`
43 TEXTDOMAIN=SUNW_OST_OSCMD
532 fmt=`gettext "Service %s imported successfully, continuing"`
533 printf "$fmt\n" "$STMSINSTANCE" 1>&2
534 fi
535 else
536 fmt=`gettext "Service %s does not exist on this host"`
537 printf "$fmt\n" "$STMSINSTANCE" 1>&2
538 exit 1
539 fi
540 fi
541
542
543 # make sure we can stash our data somewhere private
544 if [ ! -d $SAVEDIR ]; then
545 $MKDIR -p $SAVEDIR
546 fi
547 # prime the cache
548 $STMSBOOTUTIL -i
549
550
551 if [ "$cmd" = "enable" -o "$cmd" = "disable" -o "$cmd" = "update" ]; then
552 #
553 # The bootup script doesn't work on cache-only-clients as the script
554 # is executed before the plumbing for cachefs mounting of root is done.
555 #
556 if $MOUNT -v | $EGREP -s " on / type (nfs|cachefs) "; then
557 gettext "This command option is not supported on systems with an nfs or cachefs mounted root filesystem.\n" 1>&2
558 exit 1
559 fi
560
561 # if the user has left the system with the mpxio-upgrade service
562 # in a temporarily disabled state (ie, service is armed for the next
563 # reboot), then let them know. We need to ensure that the system is
564 # is in a sane state before allowing any further invocations, so
565 # try to get the system admin to do so
566
567 ISARMED=`$SVCS -l $STMSINSTANCE|$GREP "enabled.*false.*temporary"`
568 if [ ! $? ]; then
569 echo ""
570 gettext "You need to reboot the system in order to complete\n"
571 gettext "the previous invocation of stmsboot.\n"
572 echo ""
573 gettext "Do you wish to reboot the system now? (y/n, default y) "
574 read response
575
576 if [ -z "$response" -o "x$response" = "Y" -o \
577 "$response" = "y" ]; then
|
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) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
25 #
26 #
27 PATH=/usr/bin:/usr/sbin:$PATH; export PATH
28 STMSBOOTUTIL=/lib/mpxio/stmsboot_util
29 STMSMETHODSCRIPT=/lib/svc/method/mpxio-upgrade
30 KDRVCONF=
31 DRVCONF=
32 TMPDRVCONF=
33 TMPDRVCONF_MPXIO_ENTRY=
34 TMPDRVCONF_SATA_ENTRY=
35 DRVLIST=
36 GUID=
37 VFSTAB=/etc/vfstab
38 SAVEDIR=/etc/mpxio
39 BOOTDEVICES=$SAVEDIR/boot-devices
40 RECOVERFILE=$SAVEDIR/recover_instructions
41 SVCCFG_RECOVERY=$SAVEDIR/svccfg_recover
42 SUPPORTED_DRIVERS="fp|mpt|mpt_sas|pmcs"
43 USAGE=`gettext "Usage: stmsboot [-D $SUPPORTED_DRIVERS] -e | -d | -u | -L | -l controller_number"`
44 TEXTDOMAIN=SUNW_OST_OSCMD
533 fmt=`gettext "Service %s imported successfully, continuing"`
534 printf "$fmt\n" "$STMSINSTANCE" 1>&2
535 fi
536 else
537 fmt=`gettext "Service %s does not exist on this host"`
538 printf "$fmt\n" "$STMSINSTANCE" 1>&2
539 exit 1
540 fi
541 fi
542
543
544 # make sure we can stash our data somewhere private
545 if [ ! -d $SAVEDIR ]; then
546 $MKDIR -p $SAVEDIR
547 fi
548 # prime the cache
549 $STMSBOOTUTIL -i
550
551
552 if [ "$cmd" = "enable" -o "$cmd" = "disable" -o "$cmd" = "update" ]; then
553 if $MOUNT -v | $EGREP -s " on / type nfs "; then
554 gettext "This command option is not supported on systems with an nfs mounted root filesystem.\n" 1>&2
555 exit 1
556 fi
557
558 # if the user has left the system with the mpxio-upgrade service
559 # in a temporarily disabled state (ie, service is armed for the next
560 # reboot), then let them know. We need to ensure that the system is
561 # is in a sane state before allowing any further invocations, so
562 # try to get the system admin to do so
563
564 ISARMED=`$SVCS -l $STMSINSTANCE|$GREP "enabled.*false.*temporary"`
565 if [ ! $? ]; then
566 echo ""
567 gettext "You need to reboot the system in order to complete\n"
568 gettext "the previous invocation of stmsboot.\n"
569 echo ""
570 gettext "Do you wish to reboot the system now? (y/n, default y) "
571 read response
572
573 if [ -z "$response" -o "x$response" = "Y" -o \
574 "$response" = "y" ]; then
|