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 54065: add optional "old compat" variant...



details:   https://anonhg.NetBSD.org/src/rev/4599b0fd0838
branches:  trunk
changeset: 1005529:4599b0fd0838
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Dec 11 19:23:37 2019 +0000

description:
PR 54065: add optional "old compat" variant of ext2fs in file system
type selection and use that as default for the cobalt boot file system.

diffstat:

 usr.sbin/sysinst/arch/cobalt/md.h |   3 +-
 usr.sbin/sysinst/disks.c          |   9 +++++-
 usr.sbin/sysinst/label.c          |  49 +++++++++++++++++++++++---------------
 usr.sbin/sysinst/msg.mi.de        |   3 +-
 usr.sbin/sysinst/msg.mi.en        |   3 +-
 usr.sbin/sysinst/msg.mi.es        |   3 +-
 usr.sbin/sysinst/msg.mi.fr        |   3 +-
 usr.sbin/sysinst/msg.mi.pl        |   3 +-
 8 files changed, 49 insertions(+), 27 deletions(-)

diffs (241 lines):

diff -r 0921c3ed3898 -r 4599b0fd0838 usr.sbin/sysinst/arch/cobalt/md.h
--- a/usr.sbin/sysinst/arch/cobalt/md.h Wed Dec 11 16:16:13 2019 +0000
+++ b/usr.sbin/sysinst/arch/cobalt/md.h Wed Dec 11 19:23:37 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.h,v 1.4 2019/10/02 11:16:01 maya Exp $      */
+/*     $NetBSD: md.h,v 1.5 2019/12/11 19:23:38 martin Exp $    */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -48,6 +48,7 @@
 #define PART_BOOT              (5 * 1024 * 1024)       /* 5MB boot partition */
 #define PART_BOOT_MIN          (1 * 1024 * 1024)       /* 1MB minimum */
 #define        PART_BOOT_TYPE          FS_EX2FS
+#define        PART_BOOT_SUBT          1                       /* use "old" ext2 */
 #define        PART_BOOT_MOUNT         "/stand"
 
 /* default partition size */
diff -r 0921c3ed3898 -r 4599b0fd0838 usr.sbin/sysinst/disks.c
--- a/usr.sbin/sysinst/disks.c  Wed Dec 11 16:16:13 2019 +0000
+++ b/usr.sbin/sysinst/disks.c  Wed Dec 11 19:23:37 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disks.c,v 1.57 2019/11/16 20:26:59 martin Exp $ */
+/*     $NetBSD: disks.c,v 1.58 2019/12/11 19:23:37 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -113,6 +113,8 @@
        else if (f == FS_BSDFFS && f_version > 0)
                return f_version == 2 ?
                    msg_string(MSG_fs_type_ffsv2) : msg_string(MSG_fs_type_ffs);
+       else if (f == FS_EX2FS && f_version == 1)
+               return msg_string(MSG_fs_type_ext2old);
        else if (f >= __arraycount(fstypenames) || fstypenames[f] == NULL)
                return "invalid";
        return fstypenames[f];
@@ -1177,7 +1179,10 @@
                        fsname = "v7fs";
                        break;
                case FS_EX2FS:
-                       asprintf(&newfs, "/sbin/newfs_ext2fs");
+                       asprintf(&newfs,
+                           ptn->fs_version == 1 ?
+                               "/sbin/newfs_ext2fs -O 0" :
+                               "/sbin/newfs_ext2fs");
                        mnt_opts = "-text2fs";
                        fsname = "ext2fs";
                        break;
diff -r 0921c3ed3898 -r 4599b0fd0838 usr.sbin/sysinst/label.c
--- a/usr.sbin/sysinst/label.c  Wed Dec 11 16:16:13 2019 +0000
+++ b/usr.sbin/sysinst/label.c  Wed Dec 11 19:23:37 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: label.c,v 1.14 2019/11/13 18:57:26 martin Exp $        */
+/*     $NetBSD: label.c,v 1.15 2019/12/11 19:23:37 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.14 2019/11/13 18:57:26 martin Exp $");
+__RCSID("$NetBSD: label.c,v 1.15 2019/12/11 19:23:37 martin Exp $");
 #endif
 
 #include <sys/types.h>
@@ -461,6 +461,9 @@
                else
                        menu->cursel = 1;
                return;
+       } else if (t == FS_EX2FS && edit->info.fs_sub_type == 1) {
+               menu->cursel = FSMAXTYPES;
+               return;
        }
        /* skip the two FFS entries, and do not add FFS later again */
        for (ndx = 2, i = 0; i < FSMAXTYPES && ndx < max; i++) {
@@ -488,13 +491,11 @@
        if (menu->cursel == 0 || menu->cursel == 1) {
                edit->info.fs_type = FS_BSDFFS;
                edit->info.fs_sub_type = menu->cursel == 0 ? 2 : 1;
-               edit->info.nat_type = edit->pset->parts->pscheme->
-                   get_fs_part_type(edit->info.fs_type,
-                   edit->info.fs_sub_type);
-               edit->wanted->type = edit->info.nat_type->generic_ptype;
-               edit->wanted->fs_type = edit->info.fs_type;
-               edit->wanted->fs_version = edit->info.fs_sub_type;
-               return 1;
+               goto found_type;
+       } else if (menu->cursel == FSMAXTYPES) {
+               edit->info.fs_type = FS_EX2FS;
+               edit->info.fs_sub_type = 1;
+               goto found_type;
        }
 
        for (ndx = 2, i = 0; i < FSMAXTYPES && ndx < max; i++) {
@@ -508,19 +509,22 @@
                if (ndx == (size_t)menu->cursel) {
                        edit->info.fs_type = i;
                        edit->info.fs_sub_type = 0;
-                       edit->info.nat_type = edit->pset->parts->pscheme->
-                           get_fs_part_type(i, 0);
-                       if (edit->info.nat_type == NULL)
-                               edit->info.nat_type = edit->pset->parts->
-                                   pscheme->get_generic_part_type(PT_root);
-                       edit->wanted->type = edit->info.nat_type->generic_ptype;
-                       edit->wanted->fs_type = edit->info.fs_type;
-                       edit->wanted->fs_version = edit->info.fs_sub_type;
-                       break;
+                       goto found_type;
                }
                ndx++;
        }
        return 1;
+
+found_type:
+       edit->info.nat_type = edit->pset->parts->pscheme->
+           get_fs_part_type(edit->info.fs_type, edit->info.fs_sub_type);
+       if (edit->info.nat_type == NULL)
+               edit->info.nat_type = edit->pset->parts->pscheme->
+                   get_generic_part_type(PT_root);
+       edit->wanted->type = edit->info.nat_type->generic_ptype;
+       edit->wanted->fs_type = edit->info.fs_type;
+       edit->wanted->fs_version = edit->info.fs_sub_type;
+       return 1;
 }
 
 /*
@@ -534,7 +538,7 @@
        int m;
        size_t i, ndx, cnt;
 
-       cnt = __arraycount(fstypenames)-1;
+       cnt = __arraycount(fstypenames);
        opts = calloc(cnt, sizeof(*opts));
        if (opts == NULL)
                return 1;
@@ -557,6 +561,9 @@
                opts[ndx].opt_action = set_fstype_ext;
                ndx++;
        }
+       opts[ndx].opt_name = msg_string(MSG_fs_type_ext2old);
+       opts[ndx].opt_action = set_fstype_ext;
+       ndx++;
        assert(ndx == cnt);
        m = new_menu(MSG_Select_the_type, opts, ndx,
                30, 6, 10, 0, MC_SUBMENU | MC_SCROLL,
@@ -644,6 +651,10 @@
        /*
         * Shortcut to full menu if we have an exotic value
         */
+       if (edit->info.fs_type == FS_EX2FS && edit->info.fs_sub_type == 1) {
+               edit_fs_type_ext(menu, arg);
+               return 0;
+       }
        for (i = 0; i < __arraycount(edit_fs_common_types); i++)
                if (edit->info.fs_type == edit_fs_common_types[i])
                        break;
diff -r 0921c3ed3898 -r 4599b0fd0838 usr.sbin/sysinst/msg.mi.de
--- a/usr.sbin/sysinst/msg.mi.de        Wed Dec 11 16:16:13 2019 +0000
+++ b/usr.sbin/sysinst/msg.mi.de        Wed Dec 11 19:23:37 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.de,v 1.18 2019/11/16 20:26:59 martin Exp $      */
+/*     $NetBSD: msg.mi.de,v 1.19 2019/12/11 19:23:37 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1346,6 +1346,7 @@
 
 message        fs_type_ffsv2   {FFSv2}
 message        fs_type_ffs     {FFS}
+message fs_type_ext2old        {Linux Ext2 (old)}
 message        other_fs_type   {Anderer Typ}
 
 message        editpack        {Namen der Festplatte festlegen}
diff -r 0921c3ed3898 -r 4599b0fd0838 usr.sbin/sysinst/msg.mi.en
--- a/usr.sbin/sysinst/msg.mi.en        Wed Dec 11 16:16:13 2019 +0000
+++ b/usr.sbin/sysinst/msg.mi.en        Wed Dec 11 19:23:37 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.en,v 1.25 2019/11/16 20:26:59 martin Exp $      */
+/*     $NetBSD: msg.mi.en,v 1.26 2019/12/11 19:23:37 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1276,6 +1276,7 @@
 
 message        fs_type_ffsv2   {FFSv2}
 message        fs_type_ffs     {FFS}
+message fs_type_ext2old        {Linux Ext2 (old)}
 message        other_fs_type   {Other type}
 
 message        editpack        {Edit name of the disk}
diff -r 0921c3ed3898 -r 4599b0fd0838 usr.sbin/sysinst/msg.mi.es
--- a/usr.sbin/sysinst/msg.mi.es        Wed Dec 11 16:16:13 2019 +0000
+++ b/usr.sbin/sysinst/msg.mi.es        Wed Dec 11 19:23:37 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.es,v 1.19 2019/11/16 20:26:59 martin Exp $      */
+/*     $NetBSD: msg.mi.es,v 1.20 2019/12/11 19:23:37 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1326,6 +1326,7 @@
 
 message        fs_type_ffsv2   {FFSv2}
 message        fs_type_ffs     {FFS}
+message fs_type_ext2old        {Linux Ext2 (old)}
 message        other_fs_type   {Other type}
 
 message        editpack        {Edit name of the disk}
diff -r 0921c3ed3898 -r 4599b0fd0838 usr.sbin/sysinst/msg.mi.fr
--- a/usr.sbin/sysinst/msg.mi.fr        Wed Dec 11 16:16:13 2019 +0000
+++ b/usr.sbin/sysinst/msg.mi.fr        Wed Dec 11 19:23:37 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.fr,v 1.23 2019/11/16 20:26:59 martin Exp $      */
+/*     $NetBSD: msg.mi.fr,v 1.24 2019/12/11 19:23:37 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1378,6 +1378,7 @@
 
 message        fs_type_ffsv2   {FFSv2}
 message        fs_type_ffs     {FFS}
+message fs_type_ext2old        {Linux Ext2 (old)}
 message        other_fs_type   {Other type}
 
 message        editpack        {Changer le nom du disque}
diff -r 0921c3ed3898 -r 4599b0fd0838 usr.sbin/sysinst/msg.mi.pl
--- a/usr.sbin/sysinst/msg.mi.pl        Wed Dec 11 16:16:13 2019 +0000
+++ b/usr.sbin/sysinst/msg.mi.pl        Wed Dec 11 19:23:37 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.pl,v 1.26 2019/11/16 20:26:59 martin Exp $      */
+/*     $NetBSD: msg.mi.pl,v 1.27 2019/12/11 19:23:37 martin Exp $      */
 /*     Based on english version: */
 /*     NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp       */
 
@@ -1275,6 +1275,7 @@
 
 message        fs_type_ffsv2   {FFSv2}
 message        fs_type_ffs     {FFS}
+message fs_type_ext2old        {Linux Ext2 (old)}
 message        other_fs_type   {Inny typ}
 
 message        editpack        {Edytuj nazwe dysku}



Home | Main Index | Thread Index | Old Index