Source-Changes-HG archive

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

[src/netbsd-2-0]: src/distrib/utils/sysinst/arch/i386 Pull up revision 1.102 ...



details:   https://anonhg.NetBSD.org/src/rev/375be1e7278a
branches:  netbsd-2-0
changeset: 561439:375be1e7278a
user:      tron <tron%NetBSD.org@localhost>
date:      Thu Jun 17 09:14:19 2004 +0000

description:
Pull up revision 1.102 (requested by dsl in ticket #491):
Parse a disk name of "raid:no_mbr" to mean "raid" but without any mbr
setup (on i386).  Allows sysinst to install to an existing RAID1 volume.

diffstat:

 distrib/utils/sysinst/arch/i386/md.c |  33 +++++++++++++++------------------
 1 files changed, 15 insertions(+), 18 deletions(-)

diffs (75 lines):

diff -r abc7c4f1d885 -r 375be1e7278a distrib/utils/sysinst/arch/i386/md.c
--- a/distrib/utils/sysinst/arch/i386/md.c      Thu Jun 17 09:14:13 2004 +0000
+++ b/distrib/utils/sysinst/arch/i386/md.c      Thu Jun 17 09:14:19 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.100.2.1 2004/04/28 05:59:20 jmc Exp $ */
+/*     $NetBSD: md.c,v 1.100.2.2 2004/06/17 09:14:19 tron Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -84,6 +84,9 @@
 #define        NETBSD_NAMED    0x0400
 #define        ACTIVE_NAMED    0x0800
 
+       if (no_mbr)
+               return 1;
+
        if (read_mbr(diskdev, &mbr) < 0)
                memset(&mbr.mbr, 0, sizeof mbr.mbr - 2);
        md_bios_info(diskdev);
@@ -263,6 +266,9 @@
 int
 md_pre_disklabel(void)
 {
+       if (no_mbr)
+               return 0;
+
        msg_display(MSG_dofdisk);
 
        /* write edited MBR onto disk. */
@@ -330,8 +336,11 @@
        snprintf(bootxx, sizeof bootxx, "/dev/r%s%c", diskdev, 'a' + rootpart);
        td = open(bootxx, O_RDWR, 0);
        bootxx_filename = md_bootxx_name();
-       sd = open(bootxx_filename, O_RDONLY);
-       free(bootxx_filename);
+       if (bootxx_filename != NULL) {
+               sd = open(bootxx_filename, O_RDONLY);
+               free(bootxx_filename);
+       } else
+               sd = -1;
        if (td == -1 || sd == -1)
                goto bad_bootxx;
        len = read(sd, bootxx, sizeof bootxx);
@@ -422,6 +431,9 @@
        struct mbr_partition *mbrp;
        int i, netbsdpart = -1, oldbsdpart = -1, oldbsdcount = 0;
 
+       if (no_mbr)
+               return;
+
        if (read_mbr(diskdev, &mbr) < 0)
                return;
 
@@ -555,21 +567,6 @@
        return 0;
 }
 
-#if 0
-static int
-count_mbr_parts(pt)
-       struct mbr_partition *pt;
-{
-       int i, count = 0;
-
-       for (i = 0; i < MBR_PART_COUNT; i++)
-               if (pt[i].mbrp_type != 0)
-                       count++;
-
-       return count;
-}
-#endif
-
 static int
 mbr_root_above_chs(void)
 {



Home | Main Index | Thread Index | Old Index