Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/usr.sbin/sysinst Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/5d63c657c741
branches:  netbsd-9
changeset: 983251:5d63c657c741
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed May 12 06:53:55 2021 +0000

description:
Pull up following revision(s) (requested by martin in ticket #1271):
        usr.sbin/sysinst/mbr.c: revision 1.39
        usr.sbin/sysinst/label.c: revision 1.33
        usr.sbin/sysinst/arch/evbarm/md.c: revision 1.21
For FS_MSDOS report the MBR type as fs_sub_type.
Keep MSDOS partition size and subtype consistent - some u-boot are picky.
Do not allow editing of start/size/fs-type for partitions that
are already carved in stone (e.g. defined in an outer MBR while we are
editing the inner disklabel).

diffstat:

 usr.sbin/sysinst/arch/evbarm/md.c |  18 ++++++++++--------
 usr.sbin/sysinst/label.c          |  23 ++++++++++++++++++++---
 usr.sbin/sysinst/mbr.c            |   3 ++-
 3 files changed, 32 insertions(+), 12 deletions(-)

diffs (116 lines):

diff -r 7136ce7fb48a -r 5d63c657c741 usr.sbin/sysinst/arch/evbarm/md.c
--- a/usr.sbin/sysinst/arch/evbarm/md.c Sun May 09 07:10:08 2021 +0000
+++ b/usr.sbin/sysinst/arch/evbarm/md.c Wed May 12 06:53:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.8.2.6 2020/11/29 11:36:46 martin Exp $ */
+/*     $NetBSD: md.c,v 1.8.2.7 2021/05/12 06:53:55 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -337,10 +337,12 @@
 md_parts_use_wholedisk(struct disk_partitions *parts)
 {
        struct disk_part_info boot_part = {
-               .size = boardtype == BOARD_TYPE_NORMAL ? 
+               .size = boardtype == BOARD_TYPE_NORMAL ?
                    PART_BOOT_LARGE/parts->bytes_per_sector :
                    PART_BOOT/parts->bytes_per_sector,
-               .fs_type = PART_BOOT_TYPE, .fs_sub_type = MBR_PTYPE_FAT16L,
+               .fs_type = PART_BOOT_TYPE,
+               .fs_sub_type = boardtype == BOARD_TYPE_NORMAL ?
+                   MBR_PTYPE_FAT32L : MBR_PTYPE_FAT16L,
        };
 
        return parts_use_wholedisk(parts, 1, &boot_part);
@@ -372,15 +374,15 @@
 {
        size_t i;
 
-       if (boardtype != BOARD_TYPE_NORMAL)
-               return;
-
        for (i = 0; i < num_usage_infos; i++) {
                if (infos[i].fs_type == PART_BOOT_TYPE &&
                    infos[i].mount[0] != 0 &&
                    strcmp(infos[i].mount, PART_BOOT_MOUNT) == 0) {
-                       infos[i].size = PART_BOOT_LARGE /
-                           my_pm->parts->bytes_per_sector;
+                       infos[i].size = boardtype == BOARD_TYPE_NORMAL ?
+                           PART_BOOT_LARGE/my_pm->parts->bytes_per_sector :
+                           PART_BOOT/my_pm->parts->bytes_per_sector;
+                       infos[i].fs_version = boardtype == BOARD_TYPE_NORMAL ?
+                           MBR_PTYPE_FAT32L : MBR_PTYPE_FAT16L; 
                        return;
                }
        }
diff -r 7136ce7fb48a -r 5d63c657c741 usr.sbin/sysinst/label.c
--- a/usr.sbin/sysinst/label.c  Sun May 09 07:10:08 2021 +0000
+++ b/usr.sbin/sysinst/label.c  Wed May 12 06:53:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: label.c,v 1.10.2.6 2020/10/15 19:36:51 bouyer Exp $    */
+/*     $NetBSD: label.c,v 1.10.2.7 2021/05/12 06:53:55 msaitoh 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.10.2.6 2020/10/15 19:36:51 bouyer Exp $");
+__RCSID("$NetBSD: label.c,v 1.10.2.7 2021/05/12 06:53:55 msaitoh Exp $");
 #endif
 
 #include <sys/types.h>
@@ -1070,9 +1070,23 @@
                            edit->pset->parts, edit->id, attr_no))
                                continue;
                }
+               /*
+                * Do not allow editing of size/start/type when partition
+                * is defined in some outer partition table already
+                */
+               if ((edit->pset->infos[edit->index].flags & PUIFLG_IS_OUTER)
+                   && (m->opts[i].opt_action == edit_fs_type
+                       || m->opts[i].opt_action == edit_fs_start
+                       || m->opts[i].opt_action == edit_fs_size))
+                               continue;
                /* Ok: we want this one */
                m->opts[i].opt_flags &= ~OPT_IGNORE;
        }
+
+       /* Avoid starting at a (now) disabled menu item */
+       while (m->cursel >= 0 && m->cursel < m->numopts
+           && (m->opts[m->cursel].opt_flags & OPT_IGNORE))
+               m->cursel++;
 }
 
 static void
@@ -1123,7 +1137,10 @@
 
        if (m->opts[opt].opt_flags & OPT_IGNORE
            && (opt != 3 || edit->info.fs_type == FS_UNUSED)
-           && m->opts[opt].opt_action != edit_ptn_custom_type) {
+           && m->opts[opt].opt_action != edit_ptn_custom_type
+           && m->opts[opt].opt_action != edit_fs_type
+           && m->opts[opt].opt_action != edit_fs_start
+           && m->opts[opt].opt_action != edit_fs_size) {
                wprintw(m->mw, "%*s -", col_width, "");
                return;
        }
diff -r 7136ce7fb48a -r 5d63c657c741 usr.sbin/sysinst/mbr.c
--- a/usr.sbin/sysinst/mbr.c    Sun May 09 07:10:08 2021 +0000
+++ b/usr.sbin/sysinst/mbr.c    Wed May 12 06:53:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbr.c,v 1.19.2.8 2020/11/04 13:27:08 sborrill Exp $ */
+/*     $NetBSD: mbr.c,v 1.19.2.9 2021/05/12 06:53:55 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1401,6 +1401,7 @@
                case MBR_PTYPE_SPEEDSTOR_16S:
                case MBR_PTYPE_EFI:
                        info->fs_type = FS_MSDOS;
+                       info->fs_sub_type = mp->mbrp_type;
                        break;
                case MBR_PTYPE_LNXEXT2:
                        info->fs_type = FS_EX2FS;



Home | Main Index | Thread Index | Old Index