Module Name:    src
Committed By:   martin
Date:           Wed May 11 11:21:18 UTC 2016

Modified Files:
        src/usr.bin/config [netbsd-7]: config.5 gram.y sem.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.1 -r1.24.2.2 src/usr.bin/config/config.5
cvs rdiff -u -r1.39.2.1 -r1.39.2.2 src/usr.bin/config/gram.y
cvs rdiff -u -r1.43.2.1 -r1.43.2.2 src/usr.bin/config/sem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/config/config.5
diff -u src/usr.bin/config/config.5:1.24.2.1 src/usr.bin/config/config.5:1.24.2.2
--- src/usr.bin/config/config.5:1.24.2.1	Fri Mar  6 21:00:23 2015
+++ src/usr.bin/config/config.5	Wed May 11 11:21:18 2016
@@ -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 @@ and
 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

Index: src/usr.bin/config/gram.y
diff -u src/usr.bin/config/gram.y:1.39.2.1 src/usr.bin/config/gram.y:1.39.2.2
--- src/usr.bin/config/gram.y:1.39.2.1	Fri Mar  6 21:00:23 2015
+++ src/usr.bin/config/gram.y	Wed May 11 11:21:18 2016
@@ -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 @@ DECL_ALLOCWRAP(condexpr);
 #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 @@ root_spec:
 
 /* 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); }
 ;

Index: src/usr.bin/config/sem.c
diff -u src/usr.bin/config/sem.c:1.43.2.1 src/usr.bin/config/sem.c:1.43.2.2
--- src/usr.bin/config/sem.c:1.43.2.1	Fri Mar  6 21:00:23 2015
+++ src/usr.bin/config/sem.c	Wed May 11 11:21:18 2016
@@ -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 @@ resolve(struct nvlist **nvp, const char 
 		 */
 		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

Reply via email to