Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sysinst When we did not magically find any CD mediu...



details:   https://anonhg.NetBSD.org/src/rev/40d7aade942e
branches:  trunk
changeset: 945368:40d7aade942e
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Oct 27 15:28:01 2020 +0000

description:
When we did not magically find any CD medium with sets, offer a manual
override (so ISO images on USB sticks or Xen's xbd(4) work).

diffstat:

 usr.sbin/sysinst/menus.mi  |   7 ++++---
 usr.sbin/sysinst/msg.mi.de |  13 +++++++++++--
 usr.sbin/sysinst/msg.mi.en |  13 ++++++++++---
 usr.sbin/sysinst/msg.mi.es |  13 ++++++++++---
 usr.sbin/sysinst/msg.mi.fr |  13 ++++++++++---
 usr.sbin/sysinst/msg.mi.pl |  13 ++++++++++---
 usr.sbin/sysinst/util.c    |  20 +++++++++++---------
 7 files changed, 66 insertions(+), 26 deletions(-)

diffs (224 lines):

diff -r 8d054703c1c6 -r 40d7aade942e usr.sbin/sysinst/menus.mi
--- a/usr.sbin/sysinst/menus.mi Tue Oct 27 13:50:57 2020 +0000
+++ b/usr.sbin/sysinst/menus.mi Tue Oct 27 15:28:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menus.mi,v 1.22 2020/10/24 16:13:15 martin Exp $       */
+/*     $NetBSD: menus.mi,v 1.23 2020/10/27 15:28:01 martin Exp $       */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -463,14 +463,15 @@
 
 menu cdromsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
        display action { const char suff[] = "." SETS_TAR_SUFF;
-               msg_display_subst(MSG_cdromsource, 1, &suff); };
+               msg_display_add_subst(MSG_cdromsource, 1, &suff); };
        option {src_legend(menu, MSG_Device, cdrom_dev);},
                action { src_prompt(MSG_dev, cdrom_dev, sizeof cdrom_dev); };
        option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);},
                action { src_prompt(MSG_Set_dir_bin, set_dir_bin, sizeof set_dir_bin); };
        option {src_legend(menu, MSG_Set_dir_src, set_dir_src);},
                action { src_prompt(MSG_Set_dir_src, set_dir_src, sizeof set_dir_src); };
-       option MSG_exit_menu_generic, exit, action { *((int*)arg) = SET_RETRY; };
+       option MSG_abort_install, exit, action { *((int*)arg) = SET_ABANDON; };
+       option MSG_source_sel_retry, exit, action { *((int*)arg) = SET_RETRY; };
 
 menu localfssource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
        display action { const char suff[] = "." SETS_TAR_SUFF;
diff -r 8d054703c1c6 -r 40d7aade942e usr.sbin/sysinst/msg.mi.de
--- a/usr.sbin/sysinst/msg.mi.de        Tue Oct 27 13:50:57 2020 +0000
+++ b/usr.sbin/sysinst/msg.mi.de        Tue Oct 27 15:28:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.de,v 1.25 2020/10/24 16:13:15 martin Exp $      */
+/*     $NetBSD: msg.mi.de,v 1.26 2020/10/27 15:28:01 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -551,7 +551,16 @@
 }
 
 message No_cd_found
-{Kein CD Laufwerk enthält eine CD mit den Distributions-Dateien!}
+{Kein CD Laufwerk enthält eine CD mit den Distributions-Dateien!  
+Geben Sie die korrekten Daten manuel ein, oder legen Sie eine CD
+ein und versuchen Sie es erneut. 
+}
+
+message abort_install
+{Installation abbrechen}
+
+message source_sel_retry
+{Zurück zur Quellauswahl}
 
 message Available_cds
 {Verfügbare CDs}
diff -r 8d054703c1c6 -r 40d7aade942e usr.sbin/sysinst/msg.mi.en
--- a/usr.sbin/sysinst/msg.mi.en        Tue Oct 27 13:50:57 2020 +0000
+++ b/usr.sbin/sysinst/msg.mi.en        Tue Oct 27 15:28:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.en,v 1.33 2020/10/24 16:13:15 martin Exp $      */
+/*     $NetBSD: msg.mi.en,v 1.34 2020/10/27 15:28:01 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -530,8 +530,15 @@
 }
 
 message No_cd_found
-{Could not locate a CD medium in any drive with the distribution sets. 
-Check the proper medium and retry!}
+{Could not locate a CD medium in any drive with the distribution sets! 
+Enter the correct data manually, or insert a disk and retry. 
+}
+
+message abort_install
+{Cancel installation}
+
+message source_sel_retry
+{Back to source selection & retry}
 
 message Available_cds
 {Available CDs }
diff -r 8d054703c1c6 -r 40d7aade942e usr.sbin/sysinst/msg.mi.es
--- a/usr.sbin/sysinst/msg.mi.es        Tue Oct 27 13:50:57 2020 +0000
+++ b/usr.sbin/sysinst/msg.mi.es        Tue Oct 27 15:28:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.es,v 1.27 2020/10/24 16:13:15 martin Exp $      */
+/*     $NetBSD: msg.mi.es,v 1.28 2020/10/27 15:28:01 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -546,8 +546,15 @@
 }
 
 message No_cd_found
-{Could not locate a CD medium in any drive with the distribution sets. 
-Check the proper medium and retry!}
+{Could not locate a CD medium in any drive with the distribution sets! 
+Enter the correct data manually, or insert a disk and retry. 
+}
+
+message abort_install
+{Cancel installation}
+
+message source_sel_retry
+{Back to source selection & retry}
 
 message Available_cds
 {Available CDs}
diff -r 8d054703c1c6 -r 40d7aade942e usr.sbin/sysinst/msg.mi.fr
--- a/usr.sbin/sysinst/msg.mi.fr        Tue Oct 27 13:50:57 2020 +0000
+++ b/usr.sbin/sysinst/msg.mi.fr        Tue Oct 27 15:28:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.fr,v 1.32 2020/10/24 16:13:15 martin Exp $      */
+/*     $NetBSD: msg.mi.fr,v 1.33 2020/10/27 15:28:01 martin Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -542,8 +542,15 @@
 }
 
 message No_cd_found
-{Could not locate a CD medium in any drive with the distribution sets. 
-Check the proper medium and retry!}
+{Could not locate a CD medium in any drive with the distribution sets! 
+Enter the correct data manually, or insert a disk and retry. 
+}
+
+message abort_install
+{Cancel installation}
+
+message source_sel_retry
+{Back to source selection & retry}
 
 message Available_cds
 {CD-ROM disponibles}
diff -r 8d054703c1c6 -r 40d7aade942e usr.sbin/sysinst/msg.mi.pl
--- a/usr.sbin/sysinst/msg.mi.pl        Tue Oct 27 13:50:57 2020 +0000
+++ b/usr.sbin/sysinst/msg.mi.pl        Tue Oct 27 15:28:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.pl,v 1.33 2020/10/24 16:13:15 martin Exp $      */
+/*     $NetBSD: msg.mi.pl,v 1.34 2020/10/27 15:28:01 martin Exp $      */
 /*     Based on english version: */
 /*     NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp       */
 
@@ -524,8 +524,15 @@
 }
 
 message No_cd_found
-{Could not locate a CD medium in any drive with the distribution sets. 
-Check the proper medium and retry!}
+{Could not locate a CD medium in any drive with the distribution sets! 
+Enter the correct data manually, or insert a disk and retry. 
+}
+
+message abort_install
+{Cancel installation}
+
+message source_sel_retry
+{Back to source selection & retry}
 
 message Available_cds
 {Dostepne napedy CD}
diff -r 8d054703c1c6 -r 40d7aade942e usr.sbin/sysinst/util.c
--- a/usr.sbin/sysinst/util.c   Tue Oct 27 13:50:57 2020 +0000
+++ b/usr.sbin/sysinst/util.c   Tue Oct 27 15:28:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.51 2020/10/26 20:18:33 martin Exp $ */
+/*     $NetBSD: util.c,v 1.52 2020/10/27 15:28:01 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -539,6 +539,11 @@
 static int
 cd_has_sets(void)
 {
+
+       /* sanity check */
+       if (cdrom_dev[0] == 0)
+               return 0;
+
        /* Mount it */
        if (run_program(RUN_SILENT, "/sbin/mount -rt cd9660 /dev/%s /mnt2",
            cdrom_dev) != 0)
@@ -596,7 +601,6 @@
        menu_ent cd_menu[MAX_CD_INFOS];
        struct stat sb;
        int rv, num_cds, menu_cd, i, selected_cd = 0;
-       bool silent = false;
        int mib[2];
        char rootdev[SSTRSIZE] = "";
        size_t varlen;
@@ -616,8 +620,8 @@
        memset(cd_menu, 0, sizeof(cd_menu));
        num_cds = get_available_cds();
        if (num_cds <= 0) {
-               hit_enter_to_continue(MSG_No_cd_found, NULL);
-               return SET_RETRY;
+               msg_display(MSG_No_cd_found);
+               cdrom_dev[0] = 0;
        } else if (num_cds == 1) {
                /* single CD found, check for sets on it */
                strcpy(cdrom_dev, cds[0].device_name);
@@ -644,9 +648,7 @@
                        return SET_OK;
        }
 
-       if (silent)
-               msg_display("");
-       else {
+       if (num_cds >= 1 && mnt2_mounted) {
                umount_mnt2();
                hit_enter_to_continue(MSG_cd_path_not_found, NULL);
        }
@@ -654,8 +656,8 @@
        /* ask for paths on the CD */
        rv = -1;
        process_menu(MENU_cdromsource, &rv);
-       if (rv == SET_RETRY)
-               return SET_RETRY;
+       if (rv == SET_RETRY || rv == SET_ABANDON)
+               return rv;
 
        if (cd_has_sets())
                return SET_OK;



Home | Main Index | Thread Index | Old Index