Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst On device where we do not want a MBR (raid, ...
details: https://anonhg.NetBSD.org/src/rev/f6a9b2f824fe
branches: trunk
changeset: 845941:f6a9b2f824fe
user: martin <martin%NetBSD.org@localhost>
date: Fri Oct 25 12:49:58 2019 +0000
description:
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.
diffstat:
usr.sbin/sysinst/disks.c | 10 ++++++----
usr.sbin/sysinst/partitions.c | 6 ++++--
usr.sbin/sysinst/partitions.h | 4 ++--
3 files changed, 12 insertions(+), 8 deletions(-)
diffs (83 lines):
diff -r 884b46ee9452 -r f6a9b2f824fe usr.sbin/sysinst/disks.c
--- a/usr.sbin/sysinst/disks.c Fri Oct 25 12:24:34 2019 +0000
+++ b/usr.sbin/sysinst/disks.c Fri Oct 25 12:49:58 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disks.c,v 1.53 2019/10/21 16:10:54 martin Exp $ */
+/* $NetBSD: disks.c,v 1.54 2019/10/25 12:49:58 martin 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 884b46ee9452 -r f6a9b2f824fe usr.sbin/sysinst/partitions.c
--- a/usr.sbin/sysinst/partitions.c Fri Oct 25 12:24:34 2019 +0000
+++ b/usr.sbin/sysinst/partitions.c Fri Oct 25 12:49:58 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: partitions.c,v 1.2 2019/08/14 13:02:23 martin Exp $ */
+/* $NetBSD: partitions.c,v 1.3 2019/10/25 12:49:58 martin 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,8 @@
return NULL;
for (ps = available_part_schemes; *ps; ps++) {
+ if (no_mbr && (*ps)->name == MSG_parttype_mbr)
+ continue;
struct disk_partitions *parts =
(*ps)->read_from_disk(dev, 0, disk_size, *ps);
if (parts)
diff -r 884b46ee9452 -r f6a9b2f824fe usr.sbin/sysinst/partitions.h
--- a/usr.sbin/sysinst/partitions.h Fri Oct 25 12:24:34 2019 +0000
+++ b/usr.sbin/sysinst/partitions.h Fri Oct 25 12:49:58 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: partitions.h,v 1.6 2019/08/14 13:02:23 martin Exp $ */
+/* $NetBSD: partitions.h,v 1.7 2019/10/25 12:49:58 martin 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