Module Name:    src
Committed By:   mlelstv
Date:           Sun May 10 22:18:58 UTC 2015

Modified Files:
        src/sys/arch/x86/x86: x86_autoconf.c

Log Message:
If BTINFO_ROOTDEVICE is set but isn't a device name, then treat it
as a root specification. This allows strings like wedge:wedgename.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/x86/x86/x86_autoconf.c

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

Modified files:

Index: src/sys/arch/x86/x86/x86_autoconf.c
diff -u src/sys/arch/x86/x86/x86_autoconf.c:1.72 src/sys/arch/x86/x86/x86_autoconf.c:1.73
--- src/sys/arch/x86/x86/x86_autoconf.c:1.72	Sun Sep 21 16:52:26 2014
+++ src/sys/arch/x86/x86/x86_autoconf.c	Sun May 10 22:18:58 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_autoconf.c,v 1.72 2014/09/21 16:52:26 christos Exp $	*/
+/*	$NetBSD: x86_autoconf.c,v 1.73 2015/05/10 22:18:58 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.72 2014/09/21 16:52:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.73 2015/05/10 22:18:58 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -324,6 +324,7 @@ findroot(void)
 	struct btinfo_biosgeom *big;
 	device_t dv;
 	deviter_t di;
+	static char bootspecbuf[sizeof(biv->devname)+1];
 
 	if (booted_device)
 		return;
@@ -365,6 +366,12 @@ findroot(void)
 		deviter_release(&di);
 		if (dv != NULL)
 			return;
+
+		if (biv->devname[0] != '\0') {
+			strlcpy(bootspecbuf, biv->devname, sizeof(bootspecbuf));
+			bootspec = bootspecbuf;
+			return;
+		}
 	}
 
 	bid = lookup_bootinfo(BTINFO_BOOTDISK);

Reply via email to