Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sysinst Split the available disks (that may be part...



details:   https://anonhg.NetBSD.org/src/rev/d56298ed16cc
branches:  trunk
changeset: 366158:d56298ed16cc
user:      martin <martin%NetBSD.org@localhost>
date:      Mon May 16 18:44:38 2022 +0000

description:
Split the available disks (that may be partitioned) from the
preconfigured wedges (that can be install target, but can not be
partitioned). The latter are only usefull in special setups
and clobber the list of available disks for the usual setup cases.

diffstat:

 usr.sbin/sysinst/disks.c   |  113 +++++++++++++++++++++++++++++++++-----------
 usr.sbin/sysinst/msg.mi.de |    5 +-
 usr.sbin/sysinst/msg.mi.en |    5 +-
 usr.sbin/sysinst/msg.mi.es |    5 +-
 usr.sbin/sysinst/msg.mi.fr |    5 +-
 usr.sbin/sysinst/msg.mi.pl |    5 +-
 6 files changed, 103 insertions(+), 35 deletions(-)

diffs (286 lines):

diff -r 96362c4d97db -r d56298ed16cc usr.sbin/sysinst/disks.c
--- a/usr.sbin/sysinst/disks.c  Mon May 16 17:13:28 2022 +0000
+++ b/usr.sbin/sysinst/disks.c  Mon May 16 18:44:38 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disks.c,v 1.79 2022/05/15 18:27:35 jmcneill Exp $ */
+/*     $NetBSD: disks.c,v 1.80 2022/05/16 18:44:38 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -874,14 +874,18 @@
 {
        struct disk_desc disks[MAX_DISKS];
        /* need two more menu entries: current system + extended partitioning */
-       menu_ent dsk_menu[__arraycount(disks) + 2];
+       menu_ent dsk_menu[__arraycount(disks) + 2],
+           wedge_menu[__arraycount(dsk_menu)];
+       int disk_no[__arraycount(dsk_menu)], wedge_no[__arraycount(dsk_menu)];
        struct disk_desc *disk;
-       int i = 0, skipped = 0;
+       int i = 0, dno, wno, skipped = 0;
        int already_found, numdisks, selected_disk = -1;
-       int menu_no;
+       int menu_no, w_menu_no;
        struct pm_devs *pm_i, *pm_last = NULL;
+       bool any_wedges = false;
 
        memset(dsk_menu, 0, sizeof(dsk_menu));
+       memset(wedge_menu, 0, sizeof(wedge_menu));
 
        /* Find disks. */
        numdisks = get_disks(disks, partman_go <= 0);
@@ -906,49 +910,98 @@
                        return -1;
                } else {
                        /* One or more disks found or current system allowed */
-                       i = 0;
+                       dno = wno = 0;
                        if (allow_cur_system) {
-                               dsk_menu[i].opt_name = MSG_running_system;
-                               dsk_menu[i].opt_flags = OPT_EXIT;
-                               dsk_menu[i].opt_action = set_menu_select;
-                               i++;
+                               dsk_menu[dno].opt_name = MSG_running_system;
+                               dsk_menu[dno].opt_flags = OPT_EXIT;
+                               dsk_menu[dno].opt_action = set_menu_select;
+                               disk_no[dno] = -1;
+                               i++; dno++;
                        }
-                       for (; i < numdisks+allow_cur_system; i++) {
-                               dsk_menu[i].opt_name =
-                                   disks[i-allow_cur_system].dd_descr;
-                               dsk_menu[i].opt_flags = OPT_EXIT;
-                               dsk_menu[i].opt_action = set_menu_select;
+                       for (i = 0; i < numdisks; i++) {
+                               if (disks[i].dd_no_part) {
+                                       any_wedges = true;
+                                       wedge_menu[wno].opt_name =
+                                           disks[i].dd_descr;
+                                       wedge_menu[wno].opt_flags = OPT_EXIT;
+                                       wedge_menu[wno].opt_action =
+                                           set_menu_select;
+                                       wedge_no[wno] = i;
+                                       wno++;
+                               } else {
+                                       dsk_menu[dno].opt_name =
+                                           disks[i].dd_descr;
+                                       dsk_menu[dno].opt_flags = OPT_EXIT;
+                                       dsk_menu[dno].opt_action =
+                                           set_menu_select;
+                                       disk_no[dno] = i;
+                                       dno++;
+                               }
+                       }
+                       if (any_wedges) {
+                               dsk_menu[dno].opt_name = MSG_selectwedge;
+                               dsk_menu[dno].opt_flags = OPT_EXIT;
+                               dsk_menu[dno].opt_action = set_menu_select;
+                               disk_no[dno] = -2;
+                               dno++;
                        }
                        if (partman_go < 0) {
-                               dsk_menu[i].opt_name = MSG_partman;
-                               dsk_menu[i].opt_flags = OPT_EXIT;
-                               dsk_menu[i].opt_action = set_menu_select;
-                               i++;
+                               dsk_menu[dno].opt_name = MSG_partman;
+                               dsk_menu[dno].opt_flags = OPT_EXIT;
+                               dsk_menu[dno].opt_action = set_menu_select;
+                               disk_no[dno] = -3;
+                               dno++;
                        }
+                       w_menu_no = -1;
                        menu_no = new_menu(MSG_Available_disks,
-                               dsk_menu, i, -1,
+                               dsk_menu, dno, -1,
                                 4, 0, 0, MC_SCROLL,
                                NULL, NULL, NULL, NULL, MSG_exit_menu_generic);
                        if (menu_no == -1)
                                return -1;
-                       msg_fmt_display(MSG_ask_disk, "%s", doingwhat);
-                       process_menu(menu_no, &selected_disk);
+                       for (;;) {
+                               msg_fmt_display(MSG_ask_disk, "%s", doingwhat);
+                               i = -1;
+                               process_menu(menu_no, &i);
+                               if (disk_no[i] == -2) {
+                                       /* do wedges menu */
+                                       if (w_menu_no == -1) {
+                                               w_menu_no = new_menu(
+                                                   MSG_Available_wedges,
+                                                   wedge_menu, wno, -1,
+                                                   4, 0, 0, MC_SCROLL,
+                                                   NULL, NULL, NULL, NULL,
+                                                   MSG_exit_menu_generic);
+                                               if (w_menu_no == -1) {
+                                                       selected_disk = -1;
+                                                       break;
+                                               }
+                                       }
+                                       i = -1;
+                                       process_menu(w_menu_no, &i);
+                                       if (i == -1)
+                                               continue;
+                                       selected_disk = wedge_no[i];
+                                       break;
+                               }
+                               selected_disk = disk_no[i];
+                               break;
+                       }
+                       if (w_menu_no >= 0)
+                               free_menu(w_menu_no);
                        free_menu(menu_no);
-                       if (allow_cur_system) {
-                               if (selected_disk == 0) {
-                                       pm = dummy_whole_system_pm();
-                                       return 1;
-                               } else {
-                                       selected_disk--;
-                               }
+                       if (allow_cur_system && selected_disk == -1) {
+                               pm = dummy_whole_system_pm();
+                               return 1;
                        }
                }
-               if (partman_go < 0 && selected_disk == numdisks) {
+               if (partman_go < 0 &&  selected_disk == -3) {
                        partman_go = 1;
                        return -2;
                } else
                        partman_go = 0;
-               if (selected_disk < 0 || selected_disk >= numdisks)
+               if (selected_disk < 0 ||  selected_disk < 0
+                   || selected_disk >= numdisks)
                        return -1;
        }
 
diff -r 96362c4d97db -r d56298ed16cc usr.sbin/sysinst/msg.mi.de
--- a/usr.sbin/sysinst/msg.mi.de        Mon May 16 17:13:28 2022 +0000
+++ b/usr.sbin/sysinst/msg.mi.de        Mon May 16 18:44:38 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.de,v 1.36 2022/04/21 17:30:15 martin Exp $      */
+/*     $NetBSD: msg.mi.de,v 1.37 2022/05/16 18:44:38 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -143,6 +143,8 @@
 message Available_disks
 {Verfügbare Festplatten}
 
+message Available_wedges       {Vordefinierte "wedges"}
+
 message heads
 {Köpfe}
 
@@ -1268,6 +1270,7 @@
 message askfsmountadv {Mountpoint oder 'raid' oder 'cgd' oder 'lvm'?}
 message partman {Erweiterte Partitionierung}
 message editpart {Partitionen bearbeiten}
+message selectwedge {Bereits existierende "wedges" dk(4)}
 
 message fremove {ENTFERNEN}
 message remove {Entfernen}
diff -r 96362c4d97db -r d56298ed16cc usr.sbin/sysinst/msg.mi.en
--- a/usr.sbin/sysinst/msg.mi.en        Mon May 16 17:13:28 2022 +0000
+++ b/usr.sbin/sysinst/msg.mi.en        Mon May 16 18:44:38 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.en,v 1.39 2022/05/15 16:38:25 jmcneill Exp $    */
+/*     $NetBSD: msg.mi.en,v 1.40 2022/05/16 18:44:38 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -134,6 +134,8 @@
 message Available_disks
 {Available disks}
 
+message Available_wedges       {Existing "wedges"}
+
 message heads
 {heads}
 
@@ -1194,6 +1196,7 @@
 message askfsmountadv {Mountpoint (or 'raid', 'cgd', 'lvm')?}
 message partman {Extended partitioning}
 message editpart {Edit partitions}
+message selectwedge {Preconfigured "wedges" dk(4)}
 
 message fremove {REMOVE}
 message remove {Remove}
diff -r 96362c4d97db -r d56298ed16cc usr.sbin/sysinst/msg.mi.es
--- a/usr.sbin/sysinst/msg.mi.es        Mon May 16 17:13:28 2022 +0000
+++ b/usr.sbin/sysinst/msg.mi.es        Mon May 16 18:44:38 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.es,v 1.32 2022/04/21 17:30:15 martin Exp $      */
+/*     $NetBSD: msg.mi.es,v 1.33 2022/05/16 18:44:38 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -141,6 +141,8 @@
 message Available_disks
 {Discos disponibles}
 
+message Available_wedges       {Existing "wedges"}
+
 message heads
 {cabezas}
 
@@ -1245,6 +1247,7 @@
 message askfsmountadv {Punto de montaje o 'raid' o 'CGD' o 'lvm'?}
 message partman {Partición extendida}
 message editpart {Editar particiones}
+message selectwedge {Preconfigured "wedges" dk(4)}
 
 message fremove {QUITAR}
 message remove {Quitar}
diff -r 96362c4d97db -r d56298ed16cc usr.sbin/sysinst/msg.mi.fr
--- a/usr.sbin/sysinst/msg.mi.fr        Mon May 16 17:13:28 2022 +0000
+++ b/usr.sbin/sysinst/msg.mi.fr        Mon May 16 18:44:38 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.fr,v 1.37 2022/04/21 17:30:15 martin Exp $      */
+/*     $NetBSD: msg.mi.fr,v 1.38 2022/05/16 18:44:38 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -143,6 +143,8 @@
 message Available_disks
 {Disques disponibles :}
 
+message Available_wedges       {Existing "wedges"}
+
 message heads
 {têtes}
 
@@ -1284,6 +1286,7 @@
 message askfsmountadv {Point de montage ou de 'raid' ou 'cgd' ou 'lvm'?}
 message partman {Partitionnement étendu}
 message editpart {Modifier les partitions}
+message selectwedge {Preconfigured "wedges" dk(4)}
 
 message fremove {ENLEVER}
 message remove {Supprimer}
diff -r 96362c4d97db -r d56298ed16cc usr.sbin/sysinst/msg.mi.pl
--- a/usr.sbin/sysinst/msg.mi.pl        Mon May 16 17:13:28 2022 +0000
+++ b/usr.sbin/sysinst/msg.mi.pl        Mon May 16 18:44:38 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.pl,v 1.38 2022/04/21 17:30:15 martin Exp $      */
+/*     $NetBSD: msg.mi.pl,v 1.39 2022/05/16 18:44:38 martin Exp $      */
 /*     Based on english version: */
 /*     NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp       */
 
@@ -138,6 +138,8 @@
 message Available_disks
 {Dostepne dyski}
 
+message Available_wedges       {Existing "wedges"}
+
 message heads
 {glowice}
 
@@ -1194,6 +1196,7 @@
 message askfsmountadv {Punkt montowania (lub "raid", "cgd" albo "lvm")?}
 message partman {Partycje rozszerzone}
 message editpart {Edytuj partycje}
+message selectwedge {Preconfigured "wedges" dk(4)}
 
 message fremove {USUN}
 message remove {Usun}



Home | Main Index | Thread Index | Old Index