Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst When matching real partitions to "wanted" i...
details: https://anonhg.NetBSD.org/src/rev/c238c8d4d96f
branches: trunk
changeset: 372943:c238c8d4d96f
user: martin <martin%NetBSD.org@localhost>
date: Fri Jan 06 18:19:27 2023 +0000
description:
When matching real partitions to "wanted" install descriptions, skip
all types of special partitions (like raw disk, or the MBR container
partition for the NetBSD part of the disk).
The start of the partition is no unique identifier if we include these
in the matching (e.g. boot partition and raw partition may both start
at sector 0).
diffstat:
usr.sbin/sysinst/bsddisklabel.c | 4 +++-
usr.sbin/sysinst/label.c | 11 ++++++-----
usr.sbin/sysinst/partitions.h | 5 ++++-
3 files changed, 13 insertions(+), 7 deletions(-)
diffs (76 lines):
diff -r 81b5bfa32b45 -r c238c8d4d96f usr.sbin/sysinst/bsddisklabel.c
--- a/usr.sbin/sysinst/bsddisklabel.c Fri Jan 06 18:14:56 2023 +0000
+++ b/usr.sbin/sysinst/bsddisklabel.c Fri Jan 06 18:19:27 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bsddisklabel.c,v 1.71 2022/12/27 13:12:10 martin Exp $ */
+/* $NetBSD: bsddisklabel.c,v 1.72 2023/01/06 18:19:27 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1703,6 +1703,8 @@
if (!parts->pscheme->get_part_info(parts, pno, &t))
continue;
+ if (t.flags & PTI_SPECIAL_PARTS)
+ continue;
for (i = 0; i < wanted->num; i++) {
if (wanted->infos[i].cur_part_id != NO_PART)
diff -r 81b5bfa32b45 -r c238c8d4d96f usr.sbin/sysinst/label.c
--- a/usr.sbin/sysinst/label.c Fri Jan 06 18:14:56 2023 +0000
+++ b/usr.sbin/sysinst/label.c Fri Jan 06 18:19:27 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: label.c,v 1.47 2023/01/06 15:07:22 martin Exp $ */
+/* $NetBSD: label.c,v 1.48 2023/01/06 18:19:27 martin Exp $ */
/*
* Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.47 2023/01/06 15:07:22 martin Exp $");
+__RCSID("$NetBSD: label.c,v 1.48 2023/01/06 18:19:27 martin Exp $");
#endif
#include <sys/types.h>
@@ -74,9 +74,7 @@
if (info->size == 0)
return true;
- if (info->flags &
- (PTI_PSCHEME_INTERNAL|PTI_WHOLE_DISK|PTI_SEC_CONTAINER|
- PTI_RAW_PART))
+ if (info->flags & PTI_SPECIAL_PARTS)
return true;
return false;
@@ -513,6 +511,9 @@
continue;
if (pset->infos[i].cur_flags != info.flags)
continue;
+ if ((info.flags & PTI_SPECIAL_PARTS) !=
+ (pset->infos[i].flags & PTI_SPECIAL_PARTS))
+ continue;
if ((info.fs_type != FS_UNUSED &&
info.fs_type == pset->infos[i].fs_type) ||
(pset->infos[i].type ==
diff -r 81b5bfa32b45 -r c238c8d4d96f usr.sbin/sysinst/partitions.h
--- a/usr.sbin/sysinst/partitions.h Fri Jan 06 18:14:56 2023 +0000
+++ b/usr.sbin/sysinst/partitions.h Fri Jan 06 18:19:27 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: partitions.h,v 1.28 2022/06/09 18:26:06 martin Exp $ */
+/* $NetBSD: partitions.h,v 1.29 2023/01/06 18:19:27 martin Exp $ */
/*
* Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -132,6 +132,9 @@
* persistent; may only be
* set for a single partition!
*/
+#define PTI_SPECIAL_PARTS \
+ (PTI_PSCHEME_INTERNAL|PTI_WHOLE_DISK|PTI_SEC_CONTAINER|PTI_RAW_PART)
+
/* A single partition */
struct disk_part_info {
Home |
Main Index |
Thread Index |
Old Index