Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst PR 55378: do not assume RAW_PART to be eith...
details: https://anonhg.NetBSD.org/src/rev/2ff02218d7c8
branches: trunk
changeset: 976643:2ff02218d7c8
user: martin <martin%NetBSD.org@localhost>
date: Mon Sep 28 18:40:23 2020 +0000
description:
PR 55378: do not assume RAW_PART to be either 2 or 3
diffstat:
usr.sbin/sysinst/README.md_defs | 4 ++--
usr.sbin/sysinst/disklabel.c | 20 ++++++++++----------
usr.sbin/sysinst/partitions.c | 10 +++++-----
3 files changed, 17 insertions(+), 17 deletions(-)
diffs (153 lines):
diff -r a719ed31c0fc -r 2ff02218d7c8 usr.sbin/sysinst/README.md_defs
--- a/usr.sbin/sysinst/README.md_defs Mon Sep 28 18:13:25 2020 +0000
+++ b/usr.sbin/sysinst/README.md_defs Mon Sep 28 18:40:23 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: README.md_defs,v 1.4 2020/01/20 21:26:35 martin Exp $ */
+/* $NetBSD: README.md_defs,v 1.5 2020/09/28 18:40:23 martin Exp $ */
The following is trying to document the most important machine dependent
defines used in the sysinst code.
@@ -92,7 +92,7 @@
HAVE_PLAIN_DISKLABEL_BOOT may be undefined, only used on architectures
that have MBR as primary with disklabel as
- secondary partitioning scheme (RAW_PART != 2)
+ secondary partitioning scheme (RAW_PART == 3)
used like:
diff -r a719ed31c0fc -r 2ff02218d7c8 usr.sbin/sysinst/disklabel.c
--- a/usr.sbin/sysinst/disklabel.c Mon Sep 28 18:13:25 2020 +0000
+++ b/usr.sbin/sysinst/disklabel.c Mon Sep 28 18:40:23 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.c,v 1.37 2020/02/19 21:45:09 martin Exp $ */
+/* $NetBSD: disklabel.c,v 1.38 2020/09/28 18:40:23 martin Exp $ */
/*
* Copyright 2018 The NetBSD Foundation, Inc.
@@ -172,7 +172,7 @@
strncpy(parts->l.d_packname, "fictious", sizeof parts->l.d_packname);
-#if RAW_PART > 2
+#if RAW_PART == 3
if (parts->dp.parent != NULL) {
parts->l.d_partitions[RAW_PART-1].p_fstype = FS_UNUSED;
parts->l.d_partitions[RAW_PART-1].p_offset = start;
@@ -231,7 +231,7 @@
close(fd);
return NULL;
}
-#if RAW_PART > 2
+#if RAW_PART == 3
if (parts->l.d_partitions[RAW_PART-1].p_fstype == FS_UNUSED) {
daddr_t dlstart = parts->l.d_partitions[RAW_PART-1].p_offset;
daddr_t dlend = start +
@@ -467,7 +467,7 @@
memset(&parts->l.d_partitions, 0, sizeof(parts->l.d_partitions));
parts->dp.num_part = 0;
-#if RAW_PART > 2
+#if RAW_PART == 3
if (parts->dp.parent != NULL) {
parts->l.d_partitions[RAW_PART-1].p_fstype = FS_UNUSED;
parts->l.d_partitions[RAW_PART-1].p_offset =
@@ -501,7 +501,7 @@
if (ndx == id) {
if (part == RAW_PART
-#if RAW_PART > 2
+#if RAW_PART == 3
|| (part == RAW_PART-1 &&
parts->dp.parent != NULL)
#endif
@@ -543,7 +543,7 @@
daddr_t start = parts->l.d_partitions[part].p_offset;
daddr_t end = start + parts->l.d_partitions[part].p_size;
-#if RAW_PART > 2
+#if RAW_PART == 3
if (parts->dp.parent != NULL &&
part == RAW_PART - 1 && start == r_start &&
r_start + r_size == end)
@@ -759,7 +759,7 @@
parts->l.d_partitions[part].p_fstype == FS_UNUSED)
info->flags |=
PTI_PSCHEME_INTERNAL|PTI_RAW_PART;
-#if RAW_PART > 2
+#if RAW_PART == 3
if (part == (RAW_PART-1) && parts->dp.parent != NULL &&
parts->l.d_partitions[part].p_fstype == FS_UNUSED)
info->flags |=
@@ -906,7 +906,7 @@
for (i = 0; i < parts->l.d_npartitions; i++) {
if (i == RAW_PART)
continue;
-#if RAW_PART > 2
+#if RAW_PART == 3
if (i == RAW_PART-1 && parts->dp.parent != NULL)
continue;
#endif
@@ -1061,7 +1061,7 @@
continue;
if (i == RAW_PART)
continue;
-#if RAW_PART > 2
+#if RAW_PART == 3
if (i == RAW_PART-1 && parts->dp.parent != NULL)
continue;
#endif
@@ -1124,7 +1124,7 @@
continue;
if (i == RAW_PART)
continue;
-#if RAW_PART > 2
+#if RAW_PART == 3
if (i == RAW_PART-1 && parts->dp.parent != NULL)
continue;
#endif
diff -r a719ed31c0fc -r 2ff02218d7c8 usr.sbin/sysinst/partitions.c
--- a/usr.sbin/sysinst/partitions.c Mon Sep 28 18:13:25 2020 +0000
+++ b/usr.sbin/sysinst/partitions.c Mon Sep 28 18:40:23 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: partitions.c,v 1.10 2020/01/28 07:43:42 martin Exp $ */
+/* $NetBSD: partitions.c,v 1.11 2020/09/28 18:40:23 martin Exp $ */
/*
* Copyright 2018 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
extern const struct disk_partitioning_scheme mbr_parts;
#endif
-#if RAW_PART != 2
+#if RAW_PART == 3
static struct disk_partitioning_scheme only_disklabel_parts;
/*
@@ -163,7 +163,7 @@
* only offer very few entries.
*/
static const struct part_scheme_desc all_descs[] = {
-#if RAW_PART == 2 /* only available as primary on some architectures */
+#if RAW_PART != 3 /* only available as primary on some architectures */
{ NULL, &disklabel_parts },
#endif
#ifdef HAVE_GPT
@@ -172,7 +172,7 @@
#ifdef HAVE_MBR
{ NULL, &mbr_parts },
#endif
-#if RAW_PART != 2 /* "whole disk NetBSD" disklabel variant */
+#if RAW_PART == 3 /* "whole disk NetBSD" disklabel variant */
{ NULL, &only_disklabel_parts },
#endif
};
@@ -184,7 +184,7 @@
check_available_binaries();
-#if RAW_PART != 2
+#if RAW_PART == 3
/* generate a variant of disklabel w/o parent scheme */
only_disklabel_parts = disklabel_parts;
only_disklabel_parts.name = MSG_parttype_only_disklabel;
Home |
Main Index |
Thread Index |
Old Index