Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Accept root device specification as NAME=label



details:   https://anonhg.NetBSD.org/src/rev/d181bdd794e8
branches:  trunk
changeset: 1003357:d181bdd794e8
user:      manu <manu%NetBSD.org@localhost>
date:      Fri Sep 13 01:33:20 2019 +0000

description:
Accept root device specification as NAME=label

diffstat:

 sys/kern/kern_subr.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 5876c2699230 -r d181bdd794e8 sys/kern/kern_subr.c
--- a/sys/kern/kern_subr.c      Thu Sep 12 23:46:11 2019 +0000
+++ b/sys/kern/kern_subr.c      Fri Sep 13 01:33:20 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_subr.c,v 1.224 2019/08/18 06:28:42 mlelstv Exp $  */
+/*     $NetBSD: kern_subr.c,v 1.225 2019/09/13 01:33:20 manu Exp $     */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.224 2019/08/18 06:28:42 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.225 2019/09/13 01:33:20 manu Exp $");
 
 #include "opt_ddb.h"
 #include "opt_md.h"
@@ -229,6 +229,16 @@
         */
        setroot_nfs(bootdv);
 
+
+       /*
+        * Try to lookup by wedge label name
+        */
+       if (bootdv == NULL && rootspec != NULL &&
+           strncmp(rootspec, "NAME=", 5) == 0) {
+               if ((bootdv = dkwedge_find_by_wname(rootspec + 5)) != NULL)
+                       rootspec = bootdv->dv_xname;
+       }
+
        /*
         * If no bootdv was found by MD code and no
         * root specified ask the user.



Home | Main Index | Thread Index | Old Index