Date: Mon, 16 Apr 2012 10:43:06 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r234339 - head/sys/boot/i386/zfsboot Message-ID: <201204161043.q3GAh6NN028283@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Mon Apr 16 10:43:06 2012 New Revision: 234339 URL: http://svn.freebsd.org/changeset/base/234339 Log: zfsboot: honor -q if it's present in boot.config Before r228267 the option was honored but the original content of boot.config was not preserved. I tried to fix that but missed the idea. Now the proper way of doing things is taken from i386/boo2. Also, a comment is added to explain this a little bit unobvious behavior. Inspired by: jhb MFC after: 5 days Modified: head/sys/boot/i386/zfsboot/zfsboot.c Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Mon Apr 16 10:33:46 2012 (r234338) +++ head/sys/boot/i386/zfsboot/zfsboot.c Mon Apr 16 10:43:06 2012 (r234339) @@ -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; @@ -541,10 +542,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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204161043.q3GAh6NN028283>