Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 If BTINFO_ROOTDEVICE is set but isn't a dev...



details:   https://anonhg.NetBSD.org/src/rev/965c5a9ec120
branches:  trunk
changeset: 338110:965c5a9ec120
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun May 10 22:18:58 2015 +0000

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

diffstat:

 sys/arch/x86/x86/x86_autoconf.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 48e87ec32b73 -r 965c5a9ec120 sys/arch/x86/x86/x86_autoconf.c
--- a/sys/arch/x86/x86/x86_autoconf.c   Sun May 10 20:30:54 2015 +0000
+++ b/sys/arch/x86/x86/x86_autoconf.c   Sun May 10 22:18:58 2015 +0000
@@ -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 @@
        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 @@
                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);



Home | Main Index | Thread Index | Old Index