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 renumbering partitions (after deletion...



details:   https://anonhg.NetBSD.org/src/rev/aed7b10a07f9
branches:  trunk
changeset: 955833:aed7b10a07f9
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Oct 13 11:28:32 2020 +0000

description:
When renumbering partitions (after deletions) be slightly more lax
in matching, to cope with differences between MBR EFI partitions and
disklabel MSDOS partitions.

diffstat:

 usr.sbin/sysinst/label.c |  19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diffs (40 lines):

diff -r 799cdf3af055 -r aed7b10a07f9 usr.sbin/sysinst/label.c
--- a/usr.sbin/sysinst/label.c  Tue Oct 13 10:44:25 2020 +0000
+++ b/usr.sbin/sysinst/label.c  Tue Oct 13 11:28:32 2020 +0000
@@ -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 @@
                                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;
+                       }
                }
        }
 



Home | Main Index | Thread Index | Old Index