Source-Changes-HG archive

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

[src/netbsd-9]: src/usr.sbin/sysinst Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/d055793cc442
branches:  netbsd-9
changeset: 1001061:d055793cc442
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Oct 28 02:53:17 2019 +0000

description:
Pull up following revision(s) (requested by martin in ticket #382):
        usr.sbin/sysinst/part_edit.c: revision 1.10
        usr.sbin/sysinst/part_edit.c: revision 1.9
        usr.sbin/sysinst/partitions.c: revision 1.3
        usr.sbin/sysinst/partitions.c: revision 1.4
        usr.sbin/sysinst/partitions.h: revision 1.7
        usr.sbin/sysinst/bsddisklabel.c: revision 1.29
        usr.sbin/sysinst/disks.c: revision 1.54
Honor the "no_mbr" flag (used especially for raid and xbd devices)
On device where we do not want a MBR (raid, xbd) skip the MBR partitioning
scheme when trying to read partitions from disk. The generic reader will
fall back to disklabel then.
In non-MBR specific files, #ifdef all tests for MBR for architectures
that do not even compile in MBR support.

diffstat:

 usr.sbin/sysinst/bsddisklabel.c |   4 ++--
 usr.sbin/sysinst/disks.c        |  10 ++++++----
 usr.sbin/sysinst/part_edit.c    |   6 +++++-
 usr.sbin/sysinst/partitions.c   |   8 ++++++--
 usr.sbin/sysinst/partitions.h   |   4 ++--
 5 files changed, 21 insertions(+), 11 deletions(-)

diffs (123 lines):

diff -r 466360b61afd -r d055793cc442 usr.sbin/sysinst/bsddisklabel.c
--- a/usr.sbin/sysinst/bsddisklabel.c   Mon Oct 28 02:49:12 2019 +0000
+++ b/usr.sbin/sysinst/bsddisklabel.c   Mon Oct 28 02:53:17 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bsddisklabel.c,v 1.23.2.4 2019/10/23 06:04:44 msaitoh Exp $    */
+/*     $NetBSD: bsddisklabel.c,v 1.23.2.5 2019/10/28 02:53:17 msaitoh Exp $    */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1341,7 +1341,7 @@
                return true;
 
        if (parts == NULL) {
-               pscheme = select_part_scheme(pm, NULL, true, NULL);
+               pscheme = select_part_scheme(pm, NULL, !pm->no_mbr, NULL);
                if (pscheme == NULL)
                        return false;
                parts = pscheme->create_new_for_disk(pm->diskdev,
diff -r 466360b61afd -r d055793cc442 usr.sbin/sysinst/disks.c
--- a/usr.sbin/sysinst/disks.c  Mon Oct 28 02:49:12 2019 +0000
+++ b/usr.sbin/sysinst/disks.c  Mon Oct 28 02:53:17 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disks.c,v 1.44.2.9 2019/10/23 06:30:16 msaitoh Exp $ */
+/*     $NetBSD: disks.c,v 1.44.2.10 2019/10/28 02:53:17 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -901,7 +901,8 @@
                                                pm_i->parts =
                                                    partitions_read_disk(
                                                    pm_i->diskdev,
-                                                   disk->dd_totsec);
+                                                   disk->dd_totsec,
+                                                   disk->dd_no_mbr);
                                        }
                                }
                                continue;
@@ -929,7 +930,8 @@
                        pm->dlsize = disk->dd_cyl * disk->dd_head
                            * disk->dd_sec;
 
-               pm->parts = partitions_read_disk(pm->diskdev, disk->dd_totsec);
+               pm->parts = partitions_read_disk(pm->diskdev,
+                   disk->dd_totsec, disk->dd_no_mbr);
 
 again:
 
@@ -1443,7 +1445,7 @@
                        if (strcmp(disks[n].dd_name, pm->diskdev) == 0)
                                continue;
                        ps = partitions_read_disk(disks[n].dd_name,
-                           disks[n].dd_totsec);
+                           disks[n].dd_totsec, disks[n].dd_no_mbr);
                        if (ps == NULL)
                                continue;
                        if (ps->pscheme->find_by_name == NULL)
diff -r 466360b61afd -r d055793cc442 usr.sbin/sysinst/part_edit.c
--- a/usr.sbin/sysinst/part_edit.c      Mon Oct 28 02:49:12 2019 +0000
+++ b/usr.sbin/sysinst/part_edit.c      Mon Oct 28 02:53:17 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: part_edit.c,v 1.7.2.1 2019/10/28 02:49:12 msaitoh Exp $ */
+/*     $NetBSD: part_edit.c,v 1.7.2.2 2019/10/28 02:53:17 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -1218,6 +1218,10 @@
                if (bootable && p->have_boot_support != NULL &&
                    !p->have_boot_support(dev->diskdev))
                        continue;
+#ifdef HAVE_MBR
+               if (dev->no_mbr && p->name == MSG_parttype_mbr)
+                       continue;
+#endif
                if (p->size_limit && dev->dlsize > p->size_limit) {
                        char buf[255], hum_lim[5];
 
diff -r 466360b61afd -r d055793cc442 usr.sbin/sysinst/partitions.c
--- a/usr.sbin/sysinst/partitions.c     Mon Oct 28 02:49:12 2019 +0000
+++ b/usr.sbin/sysinst/partitions.c     Mon Oct 28 02:53:17 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: partitions.c,v 1.1.2.1 2019/08/18 13:21:40 msaitoh Exp $       */
+/*     $NetBSD: partitions.c,v 1.1.2.2 2019/10/28 02:53:17 msaitoh Exp $       */
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  * Generic reader - query a disk device and read all partitions from it
  */
 struct disk_partitions *
-partitions_read_disk(const char *dev, daddr_t disk_size)
+partitions_read_disk(const char *dev, daddr_t disk_size, bool no_mbr)
 {
        const struct disk_partitioning_scheme **ps;
 
@@ -53,6 +53,10 @@
                return NULL;
 
        for (ps = available_part_schemes; *ps; ps++) {
+#ifdef HAVE_MBR
+               if (no_mbr && (*ps)->name == MSG_parttype_mbr)
+                       continue;
+#endif
                struct disk_partitions *parts =
                    (*ps)->read_from_disk(dev, 0, disk_size, *ps);
                if (parts)
diff -r 466360b61afd -r d055793cc442 usr.sbin/sysinst/partitions.h
--- a/usr.sbin/sysinst/partitions.h     Mon Oct 28 02:49:12 2019 +0000
+++ b/usr.sbin/sysinst/partitions.h     Mon Oct 28 02:53:17 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: partitions.h,v 1.4.2.2 2019/08/18 13:21:40 msaitoh Exp $       */
+/*     $NetBSD: partitions.h,v 1.4.2.3 2019/10/28 02:53:17 msaitoh Exp $       */
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -549,7 +549,7 @@
  * Generic reader - query a disk device and read all partitions from it
  */
 struct disk_partitions *
-partitions_read_disk(const char *, daddr_t disk_size);
+partitions_read_disk(const char *, daddr_t disk_size, bool no_mbr);
 
 /*
  * One time initialization



Home | Main Index | Thread Index | Old Index