Module Name: src
Committed By: martin
Date: Tue Oct 13 11:28:32 UTC 2020
Modified Files:
src/usr.sbin/sysinst: label.c
Log Message:
When renumbering partitions (after deletions) be slightly more lax
in matching, to cope with differences between MBR EFI partitions and
disklabel MSDOS partitions.
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/sysinst/label.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/sysinst/label.c
diff -u src/usr.sbin/sysinst/label.c:1.28 src/usr.sbin/sysinst/label.c:1.29
--- src/usr.sbin/sysinst/label.c:1.28 Sat Oct 10 19:42:19 2020
+++ src/usr.sbin/sysinst/label.c Tue Oct 13 11:28:32 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: label.c,v 1.28 2020/10/10 19:42:19 martin Exp $ */
+/* $NetBSD: label.c,v 1.29 2020/10/13 11:28:32 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.28 2020/10/10 19:42:19 martin Exp $");
+__RCSID("$NetBSD: label.c,v 1.29 2020/10/13 11:28:32 martin Exp $");
#endif
#include <sys/types.h>
@@ -413,12 +413,15 @@ renumber_partitions(struct partition_usa
continue;
if (pset->infos[i].cur_flags != info.flags)
continue;
- if (pset->infos[i].type != info.nat_type->generic_ptype)
- continue;
- memcpy(&ninfos[pno], &pset->infos[i],
- sizeof(ninfos[pno]));
- ninfos[pno].cur_part_id = pno;
- break;
+ if ((info.fs_type != FS_UNUSED &&
+ info.fs_type == pset->infos[i].fs_type) ||
+ (pset->infos[i].type ==
+ info.nat_type->generic_ptype)) {
+ memcpy(&ninfos[pno], &pset->infos[i],
+ sizeof(ninfos[pno]));
+ ninfos[pno].cur_part_id = pno;
+ break;
+ }
}
}