svn commit: r234680 - in stable/8/sys: boot/i386/zfsboot i386/conf

Andriy Gapon avg at FreeBSD.org
Wed Apr 25 07:27:14 UTC 2012


Author: avg
Date: Wed Apr 25 07:27:13 2012
New Revision: 234680
URL: http://svn.freebsd.org/changeset/base/234680

Log:
  MFC r234339: zfsboot: honor -q if it's present in boot.config

Modified:
  stable/8/sys/boot/i386/zfsboot/zfsboot.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/i386/conf/XENHVM   (props changed)

Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c
==============================================================================
--- stable/8/sys/boot/i386/zfsboot/zfsboot.c	Wed Apr 25 07:23:35 2012	(r234679)
+++ stable/8/sys/boot/i386/zfsboot/zfsboot.c	Wed Apr 25 07:27:13 2012	(r234680)
@@ -93,6 +93,7 @@ static const char *const dev_nm[NDEV] = 
 static const unsigned char dev_maj[NDEV] = {30, 4, 2};
 
 static char cmd[512];
+static char cmddup[512];
 static char kname[1024];
 static int comspeed = SIOSPD;
 static struct bootinfo bootinfo;
@@ -536,10 +537,15 @@ main(void)
     }
 
     if (*cmd) {
-	if (!OPT_CHECK(RBX_QUIET))
-	    printf("%s: %s", PATH_CONFIG, cmd);
+	/*
+	 * Note that parse() is destructive to cmd[] and we also want
+	 * to honor RBX_QUIET option that could be present in cmd[].
+	 */
+	memcpy(cmddup, cmd, sizeof(cmd));
 	if (parse())
 	    autoboot = 0;
+	if (!OPT_CHECK(RBX_QUIET))
+	    printf("%s: %s", PATH_CONFIG, cmddup);
 	/* Do not process this command twice */
 	*cmd = 0;
     }


More information about the svn-src-stable mailing list