Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/i386 Select first disk device as boot device if...



details:   https://anonhg.NetBSD.org/src/rev/c7cc33499fcb
branches:  trunk
changeset: 566012:c7cc33499fcb
user:      cl <cl%NetBSD.org@localhost>
date:      Sun Apr 25 14:40:02 2004 +0000

description:
Select first disk device as boot device if no boot device is selected
from the command line.

diffstat:

 sys/arch/xen/i386/autoconf.c |  18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diffs (48 lines):

diff -r 6b9ab846bc31 -r c7cc33499fcb sys/arch/xen/i386/autoconf.c
--- a/sys/arch/xen/i386/autoconf.c      Sun Apr 25 14:22:32 2004 +0000
+++ b/sys/arch/xen/i386/autoconf.c      Sun Apr 25 14:40:02 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.4 2004/04/24 18:55:02 cl Exp $  */
+/*     $NetBSD: autoconf.c,v 1.5 2004/04/25 14:40:02 cl Exp $  */
 /*     NetBSD: autoconf.c,v 1.75 2003/12/30 12:33:22 pk Exp    */
 
 /*-
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.4 2004/04/24 18:55:02 cl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.5 2004/04/25 14:40:02 cl Exp $");
 
 #include "opt_compat_oldboot.h"
 #include "opt_multiprocessor.h"
@@ -478,21 +478,23 @@
        }
 
        xen_parse_cmdline(XEN_PARSE_BOOTDEV, &xcp);
-       if (xcp.xcp_bootdev[0] == 0)
-               strcat(xcp.xcp_bootdev, "xbd0");
 
        for (dv = alldevs.tqh_first; dv != NULL; dv = dv->dv_list.tqe_next) {
                if (is_valid_disk(dv) == 0)
                        continue;
 
+               if (xcp.xcp_bootdev[0] == 0) {
+                       booted_device = dv;
+                       break;
+               }
+
                if (strncmp(xcp.xcp_bootdev, dv->dv_xname,
                    strlen(dv->dv_xname)))
                        continue;
 
-               if (strlen(xcp.xcp_bootdev) != strlen(dv->dv_xname)) {
-                       booted_partition =
-                               toupper(xcp.xcp_bootdev[strlen(dv->dv_xname)])
-                               - 'A';
+               if (strlen(xcp.xcp_bootdev) > strlen(dv->dv_xname)) {
+                       booted_partition = toupper(
+                               xcp.xcp_bootdev[strlen(dv->dv_xname)]) - 'A';
                }
 
                booted_device = dv;



Home | Main Index | Thread Index | Old Index