Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sysinst Add support for explicitly selecting "EFI s...



details:   https://anonhg.NetBSD.org/src/rev/e1c864149452
branches:  trunk
changeset: 366702:e1c864149452
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jun 09 18:26:06 2022 +0000

description:
Add support for explicitly selecting "EFI system partition" as a partition
type.

diffstat:

 usr.sbin/sysinst/disks.c      |   4 +++-
 usr.sbin/sysinst/label.c      |  31 ++++++++++++++++++++++++++-----
 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 ++-
 usr.sbin/sysinst/partitions.h |  16 +++++++++++++---
 8 files changed, 52 insertions(+), 14 deletions(-)

diffs (219 lines):

diff -r e90bf35304b3 -r e1c864149452 usr.sbin/sysinst/disks.c
--- a/usr.sbin/sysinst/disks.c  Thu Jun 09 17:39:21 2022 +0000
+++ b/usr.sbin/sysinst/disks.c  Thu Jun 09 18:26:06 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disks.c,v 1.81 2022/06/02 15:36:08 martin Exp $ */
+/*     $NetBSD: disks.c,v 1.82 2022/06/09 18:26:06 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -112,6 +112,8 @@
                return "tmpfs";
        else if (f == FS_MFS)
                return "mfs";
+       else if (f == FS_EFI_SP)
+               return msg_string(MSG_fs_type_efi_sp);
        else if (f == FS_BSDFFS && f_version > 0)
                return f_version == 2 ?
                    msg_string(MSG_fs_type_ffsv2) : msg_string(MSG_fs_type_ffs);
diff -r e90bf35304b3 -r e1c864149452 usr.sbin/sysinst/label.c
--- a/usr.sbin/sysinst/label.c  Thu Jun 09 17:39:21 2022 +0000
+++ b/usr.sbin/sysinst/label.c  Thu Jun 09 18:26:06 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: label.c,v 1.33 2021/05/09 11:06:20 martin Exp $        */
+/*     $NetBSD: label.c,v 1.34 2022/06/09 18:26:06 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.33 2021/05/09 11:06:20 martin Exp $");
+__RCSID("$NetBSD: label.c,v 1.34 2022/06/09 18:26:06 martin Exp $");
 #endif
 
 #include <sys/types.h>
@@ -525,11 +525,12 @@
  * Most often used file system types, we offer them in a first level menu.
  */
 static const uint edit_fs_common_types[] =
-    { FS_BSDFFS, FS_SWAP, FS_MSDOS, FS_BSDLFS, FS_EX2FS };
+    { FS_BSDFFS, FS_SWAP, FS_MSDOS, FS_EFI_SP, FS_BSDLFS, FS_EX2FS };
 
 /*
  * Functions for uncommon file system types - we offer the full list,
- * but put FFSv2 and FFSv1 at the front.
+ * but put FFSv2 and FFSv1 at the front and duplicat FS_MSDOS as
+ * EFI system partition.
  */
 static void
 init_fs_type_ext(menudesc *menu, void *arg)
@@ -561,6 +562,13 @@
                        menu->cursel = ndx;
                        break;
                }
+               if (i == FS_MSDOS) {
+                       ndx++;
+                       if (t == FS_EFI_SP) {
+                               menu->cursel = ndx;
+                               break;
+                       }
+               }
                ndx++;
        }
 }
@@ -596,6 +604,14 @@
                        goto found_type;
                }
                ndx++;
+               if (i == FS_MSDOS) {
+                       ndx++;
+                       if (ndx == (size_t)menu->cursel) {
+                               edit->info.fs_type = FS_EFI_SP;
+                               edit->info.fs_sub_type = 0;
+                               goto found_type;
+                       }
+               }
        }
        return 1;
 
@@ -623,7 +639,7 @@
        int m;
        size_t i, ndx, cnt;
 
-       cnt = __arraycount(fstypenames);
+       cnt = __arraycount(fstypenames)+1;
        opts = calloc(cnt, sizeof(*opts));
        if (opts == NULL)
                return 1;
@@ -645,6 +661,11 @@
                opts[ndx].opt_name = fstypenames[i];
                opts[ndx].opt_action = set_fstype_ext;
                ndx++;
+               if (i == FS_MSDOS) {
+                       opts[ndx] = opts[ndx-1];
+                       opts[ndx].opt_name = getfslabelname(FS_EFI_SP, 0);
+                       ndx++;
+               }
        }
        opts[ndx].opt_name = msg_string(MSG_fs_type_ext2old);
        opts[ndx].opt_action = set_fstype_ext;
diff -r e90bf35304b3 -r e1c864149452 usr.sbin/sysinst/msg.mi.de
--- a/usr.sbin/sysinst/msg.mi.de        Thu Jun 09 17:39:21 2022 +0000
+++ b/usr.sbin/sysinst/msg.mi.de        Thu Jun 09 18:26:06 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.de,v 1.38 2022/05/18 16:39:03 martin Exp $      */
+/*     $NetBSD: msg.mi.de,v 1.39 2022/06/09 18:26:06 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1401,6 +1401,7 @@
 
 message        fs_type_ffsv2   {FFSv2}
 message        fs_type_ffs     {FFS}
+message        fs_type_efi_sp  {EFI Systempartition}
 message fs_type_ext2old        {Linux Ext2 (alt)}
 message        other_fs_type   {Anderer Typ}
 
diff -r e90bf35304b3 -r e1c864149452 usr.sbin/sysinst/msg.mi.en
--- a/usr.sbin/sysinst/msg.mi.en        Thu Jun 09 17:39:21 2022 +0000
+++ b/usr.sbin/sysinst/msg.mi.en        Thu Jun 09 18:26:06 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.en,v 1.41 2022/05/18 16:39:03 martin Exp $      */
+/*     $NetBSD: msg.mi.en,v 1.42 2022/06/09 18:26:06 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1328,6 +1328,7 @@
 
 message        fs_type_ffsv2   {FFSv2}
 message        fs_type_ffs     {FFS}
+message        fs_type_efi_sp  {EFI system partition}
 message fs_type_ext2old        {Linux Ext2 (old)}
 message        other_fs_type   {Other type}
 
diff -r e90bf35304b3 -r e1c864149452 usr.sbin/sysinst/msg.mi.es
--- a/usr.sbin/sysinst/msg.mi.es        Thu Jun 09 17:39:21 2022 +0000
+++ b/usr.sbin/sysinst/msg.mi.es        Thu Jun 09 18:26:06 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.es,v 1.34 2022/05/18 16:39:03 martin Exp $      */
+/*     $NetBSD: msg.mi.es,v 1.35 2022/06/09 18:26:06 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_efi_sp  {EFI system partition}
 message fs_type_ext2old        {Linux Ext2 (old)}
 message        other_fs_type   {Other type}
 
diff -r e90bf35304b3 -r e1c864149452 usr.sbin/sysinst/msg.mi.fr
--- a/usr.sbin/sysinst/msg.mi.fr        Thu Jun 09 17:39:21 2022 +0000
+++ b/usr.sbin/sysinst/msg.mi.fr        Thu Jun 09 18:26:06 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.fr,v 1.39 2022/05/18 16:39:03 martin Exp $      */
+/*     $NetBSD: msg.mi.fr,v 1.40 2022/06/09 18:26:06 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1417,6 +1417,7 @@
 
 message        fs_type_ffsv2   {FFSv2}
 message        fs_type_ffs     {FFS}
+message        fs_type_efi_sp  {EFI system partition}
 message fs_type_ext2old        {Linux Ext2 (old)}
 message        other_fs_type   {Other type}
 
diff -r e90bf35304b3 -r e1c864149452 usr.sbin/sysinst/msg.mi.pl
--- a/usr.sbin/sysinst/msg.mi.pl        Thu Jun 09 17:39:21 2022 +0000
+++ b/usr.sbin/sysinst/msg.mi.pl        Thu Jun 09 18:26:06 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.pl,v 1.40 2022/05/18 16:39:03 martin Exp $      */
+/*     $NetBSD: msg.mi.pl,v 1.41 2022/06/09 18:26:06 martin Exp $      */
 /*     Based on english version: */
 /*     NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp       */
 
@@ -1325,6 +1325,7 @@
 
 message        fs_type_ffsv2   {FFSv2}
 message        fs_type_ffs     {FFS}
+message        fs_type_efi_sp  {EFI system partition}
 message fs_type_ext2old        {Linux Ext2 (old)}
 message        other_fs_type   {Inny typ}
 
diff -r e90bf35304b3 -r e1c864149452 usr.sbin/sysinst/partitions.h
--- a/usr.sbin/sysinst/partitions.h     Thu Jun 09 17:39:21 2022 +0000
+++ b/usr.sbin/sysinst/partitions.h     Thu Jun 09 18:26:06 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: partitions.h,v 1.27 2022/05/24 06:18:34 andvar Exp $   */
+/*     $NetBSD: partitions.h,v 1.28 2022/06/09 18:26:06 martin Exp $   */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -55,11 +55,21 @@
 #include <sys/disklabel.h>
 #undef FSTYPE_ENUMNAME
 
+/*
+ * Use random values (outside uint8_t range) to mark special file system
+ * types that are not in the FSTYPE enumeration.
+ */
 #ifndef        FS_TMPFS
-#define        FS_TMPFS        256     /* random value (outside uint8_t range) */
+#define        FS_TMPFS        256     /* tmpfs (prefered for /tmp if available) */
 #endif
 #ifndef        FS_MFS
-#define        FS_MFS          257     /* another random (out of range) value */
+#define        FS_MFS          257     /* mfs, alternative to tmpfs if that is
+                                  not available */
+#endif
+#ifndef        FS_EFI_SP
+#define        FS_EFI_SP       258     /* EFI system partition, uses FS_MSDOS,
+                                  but may have a different partition
+                                  type */
 #endif
 
 #define        MAX_LABEL_LEN           128     /* max. length of a partition label */



Home | Main Index | Thread Index | Old Index