xref: /titanic_44/usr/src/cmd/stmsboot/stmsboot.sh (revision a4aeef46cda1835da2b19f8f62b4526de6521e6c)
1#!/sbin/sh -p
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 (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 2010 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#
27PATH=/usr/bin:/usr/sbin:$PATH; export PATH
28STMSBOOTUTIL=/lib/mpxio/stmsboot_util
29STMSMETHODSCRIPT=/lib/svc/method/mpxio-upgrade
30KDRVCONF=
31DRVCONF=
32TMPDRVCONF=
33TMPDRVCONF_MPXIO_ENTRY=
34TMPDRVCONF_SATA_ENTRY=
35DRVLIST=
36GUID=
37VFSTAB=/etc/vfstab
38SAVEDIR=/etc/mpxio
39BOOTDEVICES=$SAVEDIR/boot-devices
40RECOVERFILE=$SAVEDIR/recover_instructions
41SVCCFG_RECOVERY=$SAVEDIR/svccfg_recover
42SUPPORTED_DRIVERS="fp|mpt|mpt_sas|pmcs"
43USAGE=`gettext "Usage: stmsboot [-D $SUPPORTED_DRIVERS] -e | -d | -u | -L | -l controller_number"`
44TEXTDOMAIN=SUNW_OST_OSCMD
45export TEXTDOMAIN
46STMSINSTANCE=svc:system/device/mpxio-upgrade:default
47STMSBOOT=/usr/sbin/stmsboot
48BOOTADM=/sbin/bootadm
49MOUNT=/usr/sbin/mount
50EEPROM=/usr/sbin/eeprom
51EGREP=/usr/bin/egrep
52GREP=/usr/bin/grep
53AWK=/usr/bin/awk
54CP=/usr/bin/cp
55DF=/usr/bin/df
56LS=/usr/bin/ls
57MV=/usr/bin/mv
58RM=/usr/bin/rm
59SORT=/usr/bin/sort
60UNIQ=/usr/bin/uniq
61EXPR=/usr/bin/expr
62MKDIR=/usr/bin/mkdir
63REBOOT=/usr/sbin/reboot
64SED=/usr/bin/sed
65SVCPROP=/usr/bin/svcprop
66SVCCFG=/usr/sbin/svccfg
67SVCS=/usr/bin/svcs
68SVCADM=/usr/sbin/svcadm
69
70NOW=`/usr/bin/date +%G%m%d_%H%M`
71MACH=`/usr/bin/uname -p`
72BOOTENV_FILE=bootenv.rc
73reboot_needed=0
74new_bootpath=""
75CLIENT_TYPE_PHCI=""
76CLIENT_TYPE_VHCI="/scsi_vhci"
77
78#
79# Copy all entries (including comments) from source driver.conf
80# to destination driver.conf except those entries which contain
81# the mpxio-disable property.
82# Take into consideration entries that spawn more than one line.
83#
84# $1	source driver.conf file
85# $2	destination driver.conf file
86#
87# Returns 0 on success, non zero on failure.
88#
89delete_mpxio_disable_entries()
90{
91	# be careful here, we've got embedded \t characters
92	# in sed's pattern space.
93	$SED '
94		/^[ 	]*#/{ p
95			      d
96			    }
97		s/[ 	]*$//
98		/^$/{ p
99		      d
100		    }
101		/mpxio-disable[ 	]*=.*;$/{ w '$3'
102						  d
103						}
104		/disable-sata-mpxio[ 	]*=.*;$/{ w '$4'
105						  d
106						}
107		/;$/{ p
108		      d
109		    }
110		:rdnext
111		N
112		s/[ 	]*$//
113		/[^;]$/b rdnext
114		/mpxio-disable[ 	]*=/{ s/\n/ /g
115					      w '$3'
116					      d
117					    }
118		' $1 > $2
119
120	return $?
121}
122
123#
124# backup the last saved copy of the specified files.
125# $*	files to backup
126#
127backup_lastsaved()
128{
129	for file in $*
130	do
131		newfile=`basename $file`
132		$CP $file $SAVEDIR/$newfile.$cmd.$NOW
133	done
134}
135
136#
137# build recover instructions
138#
139# $1	1 to include boot script in the instructions
140#	0 otherwise
141#
142build_recover()
143{
144	gettext "Instructions to recover your previous STMS configuration (if in case the system does not boot):\n\n" > $RECOVERFILE
145	echo "\tboot net \c"  >> $RECOVERFILE
146	gettext "(or from a cd/dvd/another disk)\n" >> $RECOVERFILE
147	echo "\tfsck <your-root-device>" >> $RECOVERFILE
148	echo "\tmount <your-root-device> /mnt" >> $RECOVERFILE
149
150	if [ "$cmd" = "update" ]; then
151		gettext "\tUndo the modifications you made to STMS configuration.\n\tFor example undo any changes you made to " >> $RECOVERFILE
152		echo "/mnt$KDRVCONF." >> $RECOVERFILE
153	else
154		echo "\tcp /mnt${SAVEDIR}/$DRVCONF.$cmd.$NOW /mnt$KDRVCONF" >> $RECOVERFILE
155	fi
156
157	if [ $1 -eq 1 ]; then
158		echo "\tcp /mnt${SAVEDIR}/vfstab.$cmd.$NOW /mnt$VFSTAB" >> $RECOVERFILE
159
160		echo "repository /mnt/etc/svc/repository.db" > $SVCCFG_RECOVERY
161		echo "select $STMSINSTANCE" >> $SVCCFG_RECOVERY
162		echo "setprop general/enabled=false" >> $SVCCFG_RECOVERY
163		echo "exit" >> $SVCCFG_RECOVERY
164
165		echo "\t$SVCCFG -f /mnt$SVCCFG_RECOVERY" >> $RECOVERFILE
166
167		if [ -n "$new_bootpath" -a "$MACH" = "i386" ]; then
168			echo "\tcp /mnt${SAVEDIR}/bootenv.rc.$cmd.$NOW /mnt/boot/solaris/$BOOTENV_FILE" >> $RECOVERFILE
169		fi
170	fi
171
172	rootdisk=`$MOUNT | $GREP "/ on " | cut -f 3 -d " "`
173	echo "\tumount /mnt\n\treboot\n\n${rootdisk} \c" >> $RECOVERFILE
174	gettext "was your root device,\nbut it could be named differently after you boot net.\n" >> $RECOVERFILE
175}
176
177
178#
179# Arrange for /etc/vfstab and dump configuration to be updated
180# during the next reboot. If the cmd is "enable" or "disable", copy
181# $TMPDRVCONF to $KDRVCONF.
182#
183# Returns 0 on success, 1 on failure.
184#
185update_sysfiles()
186{
187
188	gettext "WARNING: This operation will require a reboot.\n"
189	gettext "Do you want to continue ? [y/n] (default: y) "
190	read response
191
192	if [ -n "$response" -a "$response" != "y" -a \
193	    "$response" != "Y" ]; then
194		for d in $DRVLIST; do
195			TMPDRVCONF=/var/run/tmp.$d.conf.$$
196			$RM -f $TMPDRVCONF > /dev/null 2>&1
197		done;
198		return 0;
199	fi
200
201	# set need_bootscript to the number of drivers that
202	# we support.
203	need_bootscript=`echo $SUPPORTED_DRIVERS|$AWK -F"|" '{print NF}'`
204
205	if [ "$cmd" = "enable" -o "$cmd" = "disable" ]; then
206
207		for d in $DRVLIST; do
208			DRVCONF=$d.conf
209			KDRVCONF=/kernel/drv/$d.conf
210			TMPDRVCONF=/var/run/tmp.$d.conf.$$
211
212			$CP $KDRVCONF $SAVEDIR/`basename $KDRVCONF`.$cmd.$NOW
213			if [ -f $TMPDRVCONF ]; then
214				$CP $TMPDRVCONF $KDRVCONF
215				$RM -f $TMPDRVCONF
216			else
217				# if $TMPDRVCONF doesn't exist, then we
218				# haven't made any changes to it
219				continue;
220			fi
221
222			#
223			# there is no need to update the system files in the following
224			# cases:
225			# - we are enabling mpxio and the system has no configured
226			#   disks accessible by phci paths.
227			# - we are disabling mpxio and the system has no configured
228			#   disks accessible by vhci paths.
229			#
230
231			# Function to setup the CLIENT_TYPE_PHCI string based on
232			# the list of drivers that we're operating on. The variable
233			# depends upon the pathname of the parent node in the
234			# device tree, which can be different on x86/x64 and sparc.
235
236			CLIENT_TYPE_PHCI=`$STMSBOOTUTIL -D $d -N`;
237
238			if [ -z "$CLIENT_TYPE_PHCI" ]; then
239				continue;
240			fi
241
242			if [ "$cmd" = "enable" ]; then
243				$LS -l /dev/dsk/*s2 2> /dev/null | \
244				    $EGREP -s "$CLIENT_TYPE_PHCI"
245			else
246				$LS -l /dev/dsk/*s2 2> /dev/null | \
247				    $EGREP -s "$CLIENT_TYPE_VHCI"
248			fi
249
250			if [ $? -ne 0 ]; then
251				need_bootscript=`$EXPR $need_bootscript - 1`
252			fi
253		done
254	fi
255
256	if [ $need_bootscript -gt 0 ]; then
257		need_bootscript=1
258		if [  -n "$new_bootpath" -a "$MACH" = "i386" ]; then
259			#only update bootpath for x86.
260			$CP /boot/solaris/$BOOTENV_FILE $SAVEDIR/$BOOTENV_FILE.$cmd.$NOW
261			$EEPROM bootpath="$new_bootpath"
262		fi
263
264		# Enable the mpxio-upgrade service for the reboot
265		$SVCADM disable -t $STMSINSTANCE
266		$SVCCFG -s $STMSINSTANCE "setprop general/enabled=true"
267	else
268		need_bootscript=0
269	fi
270
271	build_recover $need_bootscript
272
273	if [ "$MACH" = "i386" ]; then
274		$BOOTADM update-archive
275	fi
276
277	gettext "The changes will come into effect after rebooting the system.\nReboot the system now ? [y/n] (default: y) "
278	read response
279
280	if [ -z "$response" -o "$response" = "y" -o \
281	    "$response" = "Y" ]; then
282		$REBOOT
283	fi
284
285	return 0
286}
287
288
289#
290# Enable or disable mpxio as specified by the cmd.
291# Returns 0 on success, 1 on failure.
292#
293# Args: $cmd = {enable | disable}
294#	$d = {fp | mpt | mpt_sas | pmcs}
295#
296# the global variable $DRVLIST is used
297#
298configure_mpxio()
299{
300	# be careful here, we've got embedded \t characters
301	# in sed's pattern space.
302	mpxiodisableno='mpxio-disable[ 	]*=[ 	]*"no"[ 	]*;'
303	mpxiodisableyes='mpxio-disable[ 	]*=[ 	]*"yes"[ 	]*;'
304	satadisableno='disable-sata-mpxio[ 	]*=[ 	]*"no"[ 	]*;'
305	satadisableyes='disable-sata-mpxio[ 	]*=[ 	]*"yes"[ 	]*;'
306
307	if [ "$cmd" = "enable" ]; then
308		mpxiodisable_cur_entry=$mpxiodisableyes
309		satadisable_cur_entry=$satadisableyes
310		propval=no
311		msg=`gettext "STMS already enabled"`
312	else
313		mpxiodisable_cur_entry=$mpxiodisableno
314		satadisable_cur_entry=$satadisableno
315		propval=yes
316		msg=`gettext "STMS already disabled"`
317	fi
318
319	DRVCONF=$d.conf
320	KDRVCONF=/kernel/drv/$d.conf
321	TMPDRVCONF=/var/run/tmp.$d.conf.$$
322	TMPDRVCONF_MPXIO_ENTRY=/var/run/tmp.$d.conf.mpxioentry.$$;
323	TMPDRVCONF_SATA_ENTRY=/var/run/tmp.$d.conf.sataentry.$$;
324
325	if delete_mpxio_disable_entries $KDRVCONF $TMPDRVCONF $TMPDRVCONF_MPXIO_ENTRY $TMPDRVCONF_SATA_ENTRY; then
326
327		if [ -s $TMPDRVCONF_MPXIO_ENTRY ]; then
328			# $DRVCONF does have mpxiodisable entries
329			$EGREP -s "$mpxiodisable_cur_entry" $TMPDRVCONF_MPXIO_ENTRY
330			if [ $? -eq 0 ]; then
331				reboot_needed=`$EXPR $reboot_needed + 1`
332			else
333				# if all mpxiodisable entries are no/yes for
334				# enable/disable mpxio, notify the user
335				$EGREP -s "$satadisable_cur_entry" $TMPDRVCONF_SATA_ENTRY
336				if [ $? -eq 0 -a "$d" = "mpt" ]; then
337					reboot_needed=`$EXPR $reboot_needed + 1`
338				else
339					$RM -f $TMPDRVCONF $TMPDRVCONF_MPXIO_ENTRY $TMPDRVCONF_SATA_ENTRY > /dev/null 2>&1
340					return 0;
341				fi
342			fi
343
344			# If mpxiodisable entries do not exist, always continue update
345		fi
346	else
347		$RM -f $TMPDRVCONF $TMPDRVCONF_MPXIO_ENTRY $TMPDRVCONF_SATA_ENTRY > /dev/null 2>&1
348		gettext "failed to update " 1>&2
349		echo "$KDRVCONF." 1>&2
350		gettext "No changes were made to your STMS configuration.\n" 1>&2
351		return 1
352	fi
353
354	rm $TMPDRVCONF_MPXIO_ENTRY $TMPDRVCONF_SATA_ENTRY > /dev/null 2>&1
355	echo "mpxio-disable=\"${propval}\";" >> $TMPDRVCONF
356	if [ "$d" = "mpt" ]; then
357		echo "disable-sata-mpxio=\"${propval}\";" >> $TMPDRVCONF
358	fi
359
360}
361
362setcmd()
363{
364	if [ "$cmd" = "none" ]; then
365		cmd=$1
366	else
367		echo "$USAGE" 1>&2
368		exit 2
369	fi
370}
371
372#
373# Need to update bootpath on x86 if boot system from FC disk
374# Only update bootpath here when mpxio is enabled
375# If mpxio is currently disabled, then we'll update bootpath in the
376# mpxio-upgrade service method on reboot.
377#
378
379get_newbootpath_for_stmsdev() {
380	if [ "$cmd" = "enable" ]; then
381		return 0
382	fi
383
384	cur_bootpath=`$STMSBOOTUTIL -b`
385	if [ $? != 0 ]; then
386		return 1
387	fi
388
389	# Since on x64 platforms the eeprom command doesn't update the
390	# kernel, the file /boot/solaris/bootenv.rc and the kernel's
391	# bootpath variable have a good chance of differing. We do some
392	# extra handwaving to get the correct bootpath variable setting.
393
394	ONDISKVER=`$AWK '/bootpath/ {print $3}' /boot/solaris/bootenv.rc|\
395		$SED -e"s,',,g"`
396	if [ "$ONDISKVER" != "$cur_bootpath" ]; then
397		cur_bootpath="$ONDISKVER"
398	fi
399
400	NEWBOOTPATH=""
401	for path in $cur_bootpath; do
402		mapped=`$STMSBOOTUTIL -p $path`
403		if [ "$mapped" != "NOT_MAPPED" ]; then
404			if [ "$mapped" != "$path" ]; then
405				NEWBOOTPATH=`echo "$path " | \
406				   $SED -e"s|$path|$mapped|"`" $NEWBOOTPATH"
407			else
408				NEWBOOTPATH="$NEWBOOTPATH $path"
409			fi
410		fi
411	done
412	# now strip off leading and trailing space chars
413	new_bootpath=`echo $NEWBOOTPATH`
414	return 0
415}
416
417#
418# Emit a warning message to the user that by default we
419# operate on all multipath-capable controllers that are
420# attached to the system, and that if they want to operate
421# on only a specific controller type (fp|mpt|mpt_sas|pmcs|....) then
422# they need to re-invoke stmsboot with "-D $driver" in
423# their argument list
424#
425
426emit_driver_warning_msg() {
427
428	# for each driver that we support, grab the list
429	# of controllers attached to the system.
430
431	echo ""
432	gettext "WARNING: stmsboot operates on each supported multipath-capable controller\n"
433	gettext "         detected in a host. In your system, these controllers are\n\n"
434
435	for WARNDRV in `echo $SUPPORTED_DRIVERS| $SED -e"s,|, ,g"`; do
436		$STMSBOOTUTIL -D $WARNDRV -n
437	done;
438
439	echo ""
440	gettext "If you do NOT wish to operate on these controllers, please quit stmsboot\n"
441	gettext "and re-invoke with -D { fp | mpt | mpt_sas | pmcs} to specify which controllers you wish\n"
442	gettext "to modify your multipathing configuration for.\n"
443
444	echo ""
445	gettext "Do you wish to continue? [y/n] (default: y) "
446	read response
447
448	if [ -n "$response" -a "$response" != "Y" -a \
449	    "$response" != "y" ]; then
450		exit
451	fi
452}
453
454
455#
456#
457# main starts here
458#
459
460cmd=none
461# process options
462while getopts D:geduLl: c
463do
464	case $c in
465	e)	setcmd enable;;
466	d)	setcmd disable;;
467	u)	setcmd update;;
468	L)	setcmd listall;;
469	l)	setcmd list
470		controller=$OPTARG;;
471	D)	DRV=$OPTARG;;
472	g)	GUID="-g";;
473	\?)	echo "$USAGE" 1>&2
474		exit 2;;
475	esac
476done
477
478if [ "$cmd" = "none" ]; then
479	echo "$USAGE" 1>&2
480	exit 2
481fi
482
483if [ -z "$DRV" ]; then
484	DRVLIST="fp mpt mpt_sas pmcs"
485else
486	DRVLIST=$DRV
487fi
488
489USERID=`id | $EGREP "uid=0"`
490if [ -z "$USERID" ]; then
491	gettext "You must be super-user to run this script.\n" 1>&2
492	exit 1
493fi
494
495# just a sanity check
496if [ ! -f $STMSBOOTUTIL -o ! -f $STMSMETHODSCRIPT ]; then
497	fmt=`gettext "Can't find %s and/or %s"`
498	printf "$fmt\n" "$STMSBOOTUTIL" "$STMSMETHODSCRIPT" 1>&2
499	exit 1
500fi
501
502# If the old sun4u-specific SMF method is found, remove it
503$SVCCFG -s "platform/sun4u/mpxio-upgrade:default" < /dev/null > /dev/null 2>&1
504if [ $? -eq 0 ]; then
505	$SVCCFG delete "platform/sun4u/mpxio-upgrade:default" > /dev/null 2>&1
506fi
507
508# now import the new service, if necessary
509$SVCPROP -q $STMSINSTANCE < /dev/null > /dev/null 2>&1
510if [ $? -ne 0 ]; then
511	if [ -f /var/svc/manifest/system/device/mpxio-upgrade.xml ]; then
512		$SVCCFG import /var/svc/manifest/system/device/mpxio-upgrade.xml
513		if [ $? -ne 0 ]; then
514
515			fmt=`gettext "Unable to import the %s service"`
516			printf "$fmt\n" "$STMSINSTANCE" 1>&2
517			exit 1
518		else
519			fmt=`gettext "Service %s imported successfully, continuing"`
520			printf "$fmt\n" "$STMSINSTANCE" 1>&2
521		fi
522	else
523		fmt=`gettext "Service %s does not exist on this host"`
524 		printf "$fmt\n" "$STMSINSTANCE" 1>&2
525		exit 1
526	fi
527fi
528
529
530# make sure we can stash our data somewhere private
531if [ ! -d $SAVEDIR ]; then
532	$MKDIR -p $SAVEDIR
533fi
534# prime the cache
535$STMSBOOTUTIL -i
536
537
538if [ "$cmd" = "enable" -o "$cmd" = "disable" -o "$cmd" = "update" ]; then
539	#
540	# The bootup script doesn't work on cache-only-clients as the script
541	# is executed before the plumbing for cachefs mounting of root is done.
542	#
543	if $MOUNT -v | $EGREP -s " on / type (nfs|cachefs) "; then
544		gettext "This command option is not supported on systems with an nfs or cachefs mounted root filesystem.\n" 1>&2
545		exit 1
546	fi
547
548	# if the user has left the system with the mpxio-upgrade service
549	# in a temporarily disabled state (ie, service is armed for the next
550	# reboot), then let them know. We need to ensure that the system is
551	# is in a sane state before allowing any further invocations, so
552	# try to get the system admin to do so
553
554	ISARMED=`$SVCS -l $STMSINSTANCE|$GREP "enabled.*false.*temporary"`
555	if [ ! $? ]; then
556		echo ""
557		gettext "You need to reboot the system in order to complete\n"
558		gettext "the previous invocation of stmsboot.\n"
559		echo ""
560		gettext "Do you wish to reboot the system now? (y/n, default y) "
561		read response
562
563		if [ -z "$response" -o "x$response" = "Y" -o \
564		    "$response" = "y" ]; then
565			$REBOOT
566		else
567			echo ""
568			gettext "Please reboot this system before continuing\n"
569			echo ""
570			exit 1
571		fi
572	fi
573
574	#
575	# keep a copy of the last saved files, useful for manual
576	# recovery in case of a problem.
577	#
578	for d in $DRVLIST; do
579		DRVCONF=$d.conf
580		KDRVCONF=/kernel/drv/$d.conf
581		TMPDRVCONF=/var/run/tmp.$d.conf.$$
582		TMPDRVCONF_MPXIO_ENTRY=/var/run/tmp.$d.conf.mpxioentry.$$;
583		if [ "$MACH" = "sparc" ]; then
584			backup_lastsaved $KDRVCONF $VFSTAB
585		else
586			backup_lastsaved $KDRVCONF $VFSTAB /boot/solaris/$BOOTENV_FILE
587		fi
588	done
589fi
590
591if [ "$cmd" = "enable" -o "$cmd" = "disable" ]; then
592
593	msgneeded=`echo "$DRVLIST" |grep " "`
594	if [ -n "$msgneeded" ]; then
595		emit_driver_warning_msg
596	fi
597	for d in $DRVLIST; do
598		configure_mpxio $cmd $d
599	done
600
601	if [ $reboot_needed -ne 0 ]; then
602		# Need to update bootpath on x86 if our boot device is
603		# now accessed through mpxio.
604		# Only update bootpath before reboot when mpxio is enabled
605		# If mpxio is currently disabled, we will update bootpath
606		# on reboot in the mpxio-upgrade service
607
608		if [ "$cmd" = "disable" ]; then
609			if [ "$MACH" = "i386" ]; then
610				get_newbootpath_for_stmsdev
611				if [ $? -ne 0 ]; then
612					$RM -f $TMPDRVCONF > /dev/null 2>&1
613					gettext "failed to update bootpath.\n" 1>&2
614					gettext "No changes were made to your STMS configuration.\n" 1>&2
615					return 1
616				fi
617			fi
618			# If we're not using ZFS root then we need
619			# to keep track of what / maps to in case
620			# it's an active-active device and we boot from
621			# the other path
622			ROOTSCSIVHCI=`$DF /|$AWK -F":" '{print $1}' | \
623			    $AWK -F"(" '{print $2}'| \
624			    $SED -e"s,dsk,rdsk," -e"s,s.[ ]*),,"`
625			$STMSBOOTUTIL -L | $GREP $ROOTSCSIVHCI | \
626			    $AWK '{print $1}' | $SED -e"s,rdsk,dsk,g" \
627			    >$BOOTDEVICES
628		fi
629		update_sysfiles
630	else
631		echo "STMS is already ${cmd}d. No changes or reboots needed"
632	fi
633
634
635elif [ "$cmd" = "update" ]; then
636	if [ "$MACH" = "i386" ]; then
637	# In this case we always change the bootpath to phci-based
638	# path first. bootpath will later be modified in mpxio-upgrade
639	# to the vhci-based path if mpxio is enabled on root.
640		get_newbootpath_for_stmsdev
641		if [ $? -ne 0 ]; then
642			gettext "failed to update bootpath.\n" 1>&2
643			return 1
644		fi
645	fi
646	update_sysfiles
647
648elif [ "$cmd" = "list" ]; then
649		$STMSBOOTUTIL $GUID -l $controller
650else
651		$STMSBOOTUTIL $GUID -L
652fi
653
654exit $?
655