Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/usr.bin/config Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/ec6dfd124bc2
branches:  netbsd-7
changeset: 799904:ec6dfd124bc2
user:      martin <martin%NetBSD.org@localhost>
date:      Wed May 11 11:21:18 2016 +0000

description:
Pull up following revision(s) (requested by mlelstv in ticket #1164):
        usr.bin/config/sem.c: revision 1.74
        usr.bin/config/config.5: revision 1.35
        usr.bin/config/gram.y: revision 1.53
Extend syntax of config phrase, a quoted string instead of a device name
is passed as root specification string. This can be used to specify a
wedge by name.

diffstat:

 usr.bin/config/config.5 |   8 +++++++-
 usr.bin/config/gram.y   |  14 ++++++++++----
 usr.bin/config/sem.c    |  10 ++++++++--
 3 files changed, 25 insertions(+), 7 deletions(-)

diffs (97 lines):

diff -r 6bacfee5e135 -r ec6dfd124bc2 usr.bin/config/config.5
--- a/usr.bin/config/config.5   Wed May 11 11:08:14 2016 +0000
+++ b/usr.bin/config/config.5   Wed May 11 11:21:18 2016 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: config.5,v 1.24.2.1 2015/03/06 21:00:23 snj Exp $
+.\" $NetBSD: config.5,v 1.24.2.2 2016/05/11 11:21:18 martin Exp $
 .\"
 .\"  Copyright (c) 2006, 2007 The NetBSD Foundation.
 .\"  All rights reserved.
@@ -638,6 +638,12 @@
 parameters can be wildcarded with
 .Dq \&?
 to let the kernel automatically discover those values.
+The
+.Ar device
+can also be specified as a quoted specification string.
+The kernel interprets this string like the console input
+when prompting for a root device. E.g. "wedge:NAME"
+specifies a named disk wedge.
 .Pp
 At least one
 .Ic config
diff -r 6bacfee5e135 -r ec6dfd124bc2 usr.bin/config/gram.y
--- a/usr.bin/config/gram.y     Wed May 11 11:08:14 2016 +0000
+++ b/usr.bin/config/gram.y     Wed May 11 11:21:18 2016 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: gram.y,v 1.39.2.1 2015/03/06 21:00:23 snj Exp $        */
+/*     $NetBSD: gram.y,v 1.39.2.2 2016/05/11 11:21:18 martin Exp $     */
 
 /*
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: gram.y,v 1.39.2.1 2015/03/06 21:00:23 snj Exp $");
+__RCSID("$NetBSD: gram.y,v 1.39.2.2 2016/05/11 11:21:18 martin Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -103,6 +103,7 @@
 #define        new_nx(n, x)    new0(n, NULL, NULL, 0, x)
 #define        new_ns(n, s)    new0(n, s, NULL, 0, NULL)
 #define        new_si(s, i)    new0(NULL, s, NULL, i, NULL)
+#define        new_spi(s, p, i)        new0(NULL, s, p, i, NULL)
 #define        new_nsi(n,s,i)  new0(n, s, NULL, i, NULL)
 #define        new_np(n, p)    new0(n, NULL, p, 0, NULL)
 #define        new_s(s)        new0(NULL, s, NULL, 0, NULL)
@@ -899,9 +900,14 @@
 
 /* device for root fs or dump */
 dev_spec:
-         '?'                           { $$ = new_si(intern("?"),
+         '?'                           { $$ = new_spi(intern("?"),
+                                           NULL,
                                            (long long)NODEV); }
-       | WORD                          { $$ = new_si($1,
+       | QSTRING                       { $$ = new_spi($1,
+                                           __UNCONST("spec"),
+                                           (long long)NODEV); }
+       | WORD                          { $$ = new_spi($1,
+                                           NULL,
                                            (long long)NODEV); }
        | major_minor                   { $$ = new_si(NULL, $1); }
 ;
diff -r 6bacfee5e135 -r ec6dfd124bc2 usr.bin/config/sem.c
--- a/usr.bin/config/sem.c      Wed May 11 11:08:14 2016 +0000
+++ b/usr.bin/config/sem.c      Wed May 11 11:21:18 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sem.c,v 1.43.2.1 2015/03/06 21:00:23 snj Exp $ */
+/*     $NetBSD: sem.c,v 1.43.2.2 2016/05/11 11:21:18 martin Exp $      */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: sem.c,v 1.43.2.1 2015/03/06 21:00:23 snj Exp $");
+__RCSID("$NetBSD: sem.c,v 1.43.2.2 2016/05/11 11:21:18 martin Exp $");
 
 #include <sys/param.h>
 #include <ctype.h>
@@ -928,6 +928,12 @@
                 */
                return (0);
 
+       if (nv->nv_ptr != NULL && strcmp(nv->nv_ptr, "spec") == 0)
+               /*
+                * spec string, interpreted by kernel
+                */
+               return (0);
+
        /*
         * The normal case: things like "ra2b".  Check for partition
         * suffix, remove it if there, and split into name ("ra") and



Home | Main Index | Thread Index | Old Index