Module Name:    src
Committed By:   christos
Date:           Thu Apr  3 15:21:52 UTC 2014

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

Log Message:
- prevent matchbiosdisks from being called twice. This could happen
  via raid autoconf calling cpu_rootconf() once and then init main
  calling cpu_rootconf() a second time.
- separate booted_device setup into cpu_bootconf(), a new optional function.
  This function can be called before raid autoconfiguration to determine
  the booted device. This needs to be done before raid autoconfiguration,
  otherwise if we are using wedges, the raid will autoconfigure wedges,
  and we'll be unable to open the underlying devices later to determine
  the booted device.
- fix a debugging comment.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 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.69 src/sys/arch/x86/x86/x86_autoconf.c:1.70
--- src/sys/arch/x86/x86/x86_autoconf.c:1.69	Tue Apr  1 22:14:08 2014
+++ src/sys/arch/x86/x86/x86_autoconf.c	Thu Apr  3 11:21:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_autoconf.c,v 1.69 2014/04/02 02:14:08 christos Exp $	*/
+/*	$NetBSD: x86_autoconf.c,v 1.70 2014/04/03 15:21:52 christos 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.69 2014/04/02 02:14:08 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.70 2014/04/03 15:21:52 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -101,6 +101,8 @@ matchbiosdisks(void)
 	int dklist_size;
 	int numbig;
 
+	if (x86_ndisks)
+		return;
 	big = lookup_bootinfo(BTINFO_BIOSGEOM);
 
 	numbig = big ? big->num : 0;
@@ -257,7 +259,7 @@ match_bootdisk(device_t dv, struct btinf
 	int found = 0;
 
 	if (device_is_a(dv, "dk")) {
-		DPRINTF(("%s: not dk %s\n", __func__, device_xname(dv)));
+		DPRINTF(("%s: dk %s\n", __func__, device_xname(dv)));
 		return 0;
 	}
 
@@ -509,11 +511,16 @@ findroot(void)
 }
 
 void
-cpu_rootconf(void)
+cpu_bootconf(void)
 {
-
 	findroot();
 	matchbiosdisks();
+}
+
+void
+cpu_rootconf(void)
+{
+	cpu_bootconf();
 
 	aprint_normal("boot device: %s\n",
 	    booted_device ? device_xname(booted_device) : "<unknown>");

Reply via email to