changeset 3467:8cf06bcbb424 onnv_57

6512864 cleanup needed in dboot's bootadm/bfu
author rscott
date Mon, 22 Jan 2007 20:18:41 -0800
parents 4cc6ca6917b5
children 939136a5fa16
files usr/src/cmd/boot/bootadm/bootadm.c usr/src/cmd/boot/bootadm/message.h usr/src/cmd/boot/scripts/create_ramdisk.ksh usr/src/tools/scripts/bfu.sh
diffstat 4 files changed, 20 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/boot/bootadm/bootadm.c	Mon Jan 22 19:26:57 2007 -0800
+++ b/usr/src/cmd/boot/bootadm/bootadm.c	Mon Jan 22 20:18:41 2007 -0800
@@ -428,7 +428,7 @@
 	opterr = 0;
 
 	error = 0;
-	while ((c = getopt(argc, argv, "a:d:fm:no:vCR:xX")) != -1) {
+	while ((c = getopt(argc, argv, "a:d:fm:no:vCR:")) != -1) {
 		switch (c) {
 		case 'a':
 			if (bam_cmd) {
@@ -3188,7 +3188,12 @@
 			continue;
 		}
 
-		/* check for matching module entry (failsafe or normal) */
+		/*
+		 * Check for matching module entry (failsafe or normal).  We
+		 * use a strncmp to match "module" or "module$", since we
+		 * don't know which one it should be.  If it fails to match,
+		 * we go around the loop again.
+		 */
 		lp = lp->next;	/* advance to module line */
 		if ((strncmp(lp->cmd, menu_cmds[MODULE_CMD],
 		    strlen(menu_cmds[MODULE_CMD])) != 0) ||
--- a/usr/src/cmd/boot/bootadm/message.h	Mon Jan 22 19:26:57 2007 -0800
+++ b/usr/src/cmd/boot/bootadm/message.h	Mon Jan 22 20:18:41 2007 -0800
@@ -332,30 +332,30 @@
 #define	NOT_DBOOT \
 	gettext("bootadm set-menu %s may only be run on directboot kernels.\n")
 
-#define	DEFAULT_NOT_BAM	\
-gettext("Default menu.lst entry is not controlled by bootadm.  Exiting\n")
+#define	DEFAULT_NOT_BAM	gettext(	\
+"Default /boot/grub/menu.lst entry is not controlled by bootadm.  Exiting\n")
 
 #define	NO_KERNEL_MATCH	\
 gettext("Unexpected kernel command on line %d.\n\
-** YOU MUST MANUALLY CORRECT menu.lst BEFORE REBOOT! **\n\
+** YOU MUST MANUALLY CORRECT /boot/grub/menu.lst BEFORE REBOOT! **\n\
 For details, see %s\n")
 
 #define	NO_MODULE_MATCH	\
 gettext("Unexpected module command on line %d.\n\
-** YOU MUST MANUALLY CORRECT menu.lst BEFORE REBOOT! **\n\
+** YOU MUST MANUALLY CORRECT /boot/grub/menu.lst BEFORE REBOOT! **\n\
 For details, see %s\n")
 
 #define	NO_KERNELS_FOUND	\
 gettext("Could not find any kernel lines to update.  Only entries created by\n\
 bootadm(1M) and lu(1M) can be updated.  All other must be manually changed.\n\
-** YOU MUST MANUALLY CORRECT menu.lst BEFORE REBOOT! **\n\
+** YOU MUST MANUALLY CORRECT /boot/grub/menu.lst BEFORE REBOOT! **\n\
 For details on updating entries, see %s\n")
 
 #define	HAND_ADDED_ENTRY	\
 gettext("On upgrades, bootadm(1M) will only upgrade entries added by\n\
-bootadm(1M) or lu(1M).  The following entry or entries in menu.lst will\n\
-not be upgraded.  For details on updating entries, see\n\
-%s\n")
+bootadm(1M) or lu(1M).  The following entry or entries in\n\
+/boot/grub/menu.lst will not be upgraded.  For details on updating entries,\n\
+see %s\n")
 
 #define	NOT_ELF_FILE gettext("%s is not an ELF file.\n")
 
--- a/usr/src/cmd/boot/scripts/create_ramdisk.ksh	Mon Jan 22 19:26:57 2007 -0800
+++ b/usr/src/cmd/boot/scripts/create_ramdisk.ksh	Mon Jan 22 20:18:41 2007 -0800
@@ -48,9 +48,11 @@
 			echo "Creating ram disk for $ALT_ROOT"
 		fi
 		;;
-	-n|--nocompress) compress=no ;;
+	-n|--nocompress) compress=no
+		;;
         *)      echo Usage: ${0##*/}: [-R \<root\>] [--nocompress]
-		exit ;;
+		exit
+		;;
         esac
 	shift
 done
--- a/usr/src/tools/scripts/bfu.sh	Mon Jan 22 19:26:57 2007 -0800
+++ b/usr/src/tools/scripts/bfu.sh	Mon Jan 22 20:18:41 2007 -0800
@@ -4625,7 +4625,7 @@
 {
 	if [ "$root" != "/" ] || \
 	    [ -f /boot/x86.miniroot-safe ] || \
-	    [ -x ${GATEPATH}/public/bin/update_failsafe ]; then
+	    [ ! -x ${GATEPATH}/public/bin/update_failsafe ]; then
 		#
 		# Either we're not bfu'ing /, or the failsafe archives were
 		# already installed, or update_failsafe is not available.