Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst Apply patch provided by Izumi Tsutsui in PR...
details: https://anonhg.NetBSD.org/src/rev/afb00889e606
branches: trunk
changeset: 1014703:afb00889e606
user: martin <martin%NetBSD.org@localhost>
date: Tue Sep 29 15:29:17 2020 +0000
description:
Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.
diffstat:
usr.sbin/sysinst/bsddisklabel.c | 18 ++++++++++--------
usr.sbin/sysinst/disklabel.c | 8 +++++++-
usr.sbin/sysinst/mbr.c | 9 ++++++++-
usr.sbin/sysinst/partitions.h | 4 +++-
4 files changed, 28 insertions(+), 11 deletions(-)
diffs (151 lines):
diff -r facaad960d1d -r afb00889e606 usr.sbin/sysinst/bsddisklabel.c
--- a/usr.sbin/sysinst/bsddisklabel.c Tue Sep 29 14:29:56 2020 +0000
+++ b/usr.sbin/sysinst/bsddisklabel.c Tue Sep 29 15:29:17 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bsddisklabel.c,v 1.44 2020/09/28 18:13:25 martin Exp $ */
+/* $NetBSD: bsddisklabel.c,v 1.45 2020/09/29 15:29:17 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -76,7 +76,7 @@
#endif
#ifdef PART_BOOT_TYPE
.fs_type = PART_BOOT_TYPE,
-#if PART_BOOT_TYPE == FS_MSDOS
+#if (PART_BOOT_TYPE == FS_MSDOS) || (PART_BOOT_TYPE == FS_EX2FS)
.flags = PUIFLAG_ADD_OUTER,
#endif
#endif
@@ -100,7 +100,7 @@
#endif
#ifdef PART_BOOT1_TYPE
.fs_type = PART_BOOT1_TYPE,
-#if PART_BOOT1_TYPE == FS_MSDOS
+#if (PART_BOOT1_TYPE == FS_MSDOS) || (PART_BOOT1_TYPE == FS_EX2FS)
.flags = PUIFLAG_ADD_OUTER,
#endif
#endif
@@ -119,7 +119,7 @@
#endif
#ifdef PART_BOOT2_TYPE
.fs_type = PART_BOOT2_TYPE,
-#if PART_BOOT2_TYPE == FS_MSDOS
+#if (PART_BOOT2_TYPE == FS_MSDOS) || (PART_BOOT2_TYPE == FS_EX2FS)
.flags = PUIFLAG_ADD_OUTER,
#endif
#endif
@@ -974,7 +974,8 @@
wanted->infos[i].type = pt->generic_ptype;
}
if (wanted->parts->parent != NULL &&
- wanted->infos[i].fs_type == FS_MSDOS)
+ (wanted->infos[i].fs_type == FS_MSDOS ||
+ wanted->infos[i].fs_type == FS_EX2FS))
wanted->infos[i].flags |=
PUIFLG_ADD_INNER|PUIFLAG_ADD_OUTER;
@@ -1021,8 +1022,8 @@
* empty disk. Merge the partitions in target range that are already
* there (match with wanted) or are there additionaly.
* The only thing outside of target range that we care for
- * are FAT partitions and a potential swap partition - we assume one
- * is enough.
+ * are FAT partitions, EXT2FS partitions, and a potential
+ * swap partition - we assume one is enough.
*/
size_t num = wanted->num;
if (parts->parent) {
@@ -1033,7 +1034,8 @@
parts->parent, pno, &info))
continue;
if (info.nat_type->generic_ptype != PT_swap &&
- info.fs_type != FS_MSDOS)
+ info.fs_type != FS_MSDOS &&
+ info.fs_type != FS_EX2FS)
continue;
merge_part_with_wanted(parts->parent, pno, &info,
wanted, num, true);
diff -r facaad960d1d -r afb00889e606 usr.sbin/sysinst/disklabel.c
--- a/usr.sbin/sysinst/disklabel.c Tue Sep 29 14:29:56 2020 +0000
+++ b/usr.sbin/sysinst/disklabel.c Tue Sep 29 15:29:17 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.c,v 1.38 2020/09/28 18:40:23 martin Exp $ */
+/* $NetBSD: disklabel.c,v 1.39 2020/09/29 15:29:17 martin Exp $ */
/*
* Copyright 2018 The NetBSD Foundation, Inc.
@@ -582,6 +582,9 @@
pt = PT_root; break;
case FS_SWAP: pt = PT_swap; break;
case FS_MSDOS: pt = PT_FAT; break;
+ case FS_EX2FS: pt = PT_EXT2; break;
+ case FS_SYSVBFS:
+ pt = PT_SYSVBFS; break;
default: pt = PT_unknown; break;
}
dl_types[i].generic_ptype = pt;
@@ -707,6 +710,9 @@
case PT_FAT:
case PT_EFI_SYSTEM:
nt = FS_MSDOS; break;
+ case PT_EXT2: nt = FS_EX2FS; break;
+ case PT_SYSVBFS:
+ nt = FS_SYSVBFS; break;
default: nt = FS_UNUSED; break;
}
diff -r facaad960d1d -r afb00889e606 usr.sbin/sysinst/mbr.c
--- a/usr.sbin/sysinst/mbr.c Tue Sep 29 14:29:56 2020 +0000
+++ b/usr.sbin/sysinst/mbr.c Tue Sep 29 15:29:17 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mbr.c,v 1.32 2020/04/22 23:43:12 joerg Exp $ */
+/* $NetBSD: mbr.c,v 1.33 2020/09/29 15:29:17 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1117,6 +1117,8 @@
return PT_FAT;
case MBR_PTYPE_EFI:
return PT_EFI_SYSTEM;
+ case MBR_PTYPE_LNXEXT2:
+ return PT_EXT2;
case MBR_PTYPE_NETBSD:
return PT_root;
}
@@ -1279,6 +1281,8 @@
return mbr_get_gen_type_desc(MBR_PTYPE_NETBSD);
case PT_FAT:
return mbr_get_gen_type_desc(MBR_PTYPE_FAT32L);
+ case PT_EXT2:
+ return mbr_get_gen_type_desc(MBR_PTYPE_LNXEXT2);
case PT_EFI_SYSTEM:
return mbr_get_gen_type_desc(MBR_PTYPE_EFI);
default:
@@ -1386,6 +1390,9 @@
case MBR_PTYPE_EFI:
info->fs_type = FS_MSDOS;
break;
+ case MBR_PTYPE_LNXEXT2:
+ info->fs_type = FS_EX2FS;
+ break;
case MBR_PTYPE_XENIX_ROOT:
case MBR_PTYPE_XENIX_USR:
info->fs_type = FS_SYSV;
diff -r facaad960d1d -r afb00889e606 usr.sbin/sysinst/partitions.h
--- a/usr.sbin/sysinst/partitions.h Tue Sep 29 14:29:56 2020 +0000
+++ b/usr.sbin/sysinst/partitions.h Tue Sep 29 15:29:17 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: partitions.h,v 1.15 2020/01/27 21:21:22 martin Exp $ */
+/* $NetBSD: partitions.h,v 1.16 2020/09/29 15:29:17 martin Exp $ */
/*
* Copyright 2018 The NetBSD Foundation, Inc.
@@ -91,6 +91,8 @@
PT_root, /* the NetBSD / partition (bootable) */
PT_swap, /* the NetBSD swap partition */
PT_FAT, /* boot partition (e.g. for u-boot) */
+ PT_EXT2, /* boot partition (for Linux appliances) */
+ PT_SYSVBFS, /* boot partition (for some SYSV machines) */
PT_EFI_SYSTEM, /* (U)EFI boot partition */
};
Home |
Main Index |
Thread Index |
Old Index