Module Name: src Committed By: martin Date: Tue Oct 27 15:28:01 UTC 2020
Modified Files: src/usr.sbin/sysinst: menus.mi msg.mi.de msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl util.c Log Message: 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). To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/sysinst/menus.mi cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sysinst/msg.mi.de cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/sysinst/msg.mi.en \ src/usr.sbin/sysinst/msg.mi.pl cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/sysinst/msg.mi.es cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/sysinst/msg.mi.fr cvs rdiff -u -r1.51 -r1.52 src/usr.sbin/sysinst/util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/sysinst/menus.mi diff -u src/usr.sbin/sysinst/menus.mi:1.22 src/usr.sbin/sysinst/menus.mi:1.23 --- src/usr.sbin/sysinst/menus.mi:1.22 Sat Oct 24 16:13:15 2020 +++ src/usr.sbin/sysinst/menus.mi Tue Oct 27 15:28:01 2020 @@ -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 floppysource, y=-4, x=0, w=70, no b 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; Index: src/usr.sbin/sysinst/msg.mi.de diff -u src/usr.sbin/sysinst/msg.mi.de:1.25 src/usr.sbin/sysinst/msg.mi.de:1.26 --- src/usr.sbin/sysinst/msg.mi.de:1.25 Sat Oct 24 16:13:15 2020 +++ src/usr.sbin/sysinst/msg.mi.de Tue Oct 27 15:28:01 2020 @@ -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 @@ die Distribution zu finden ist. } 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} Index: src/usr.sbin/sysinst/msg.mi.en diff -u src/usr.sbin/sysinst/msg.mi.en:1.33 src/usr.sbin/sysinst/msg.mi.en:1.34 --- src/usr.sbin/sysinst/msg.mi.en:1.33 Sat Oct 24 16:13:15 2020 +++ src/usr.sbin/sysinst/msg.mi.en Tue Oct 27 15:28:01 2020 @@ -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 @@ Remember, the directory should contain t } 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 } Index: src/usr.sbin/sysinst/msg.mi.pl diff -u src/usr.sbin/sysinst/msg.mi.pl:1.33 src/usr.sbin/sysinst/msg.mi.pl:1.34 --- src/usr.sbin/sysinst/msg.mi.pl:1.33 Sat Oct 24 16:13:15 2020 +++ src/usr.sbin/sysinst/msg.mi.pl Tue Oct 27 15:28:01 2020 @@ -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 @@ Pamietaj, ze katalog musi zawierac pliki } 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} Index: src/usr.sbin/sysinst/msg.mi.es diff -u src/usr.sbin/sysinst/msg.mi.es:1.27 src/usr.sbin/sysinst/msg.mi.es:1.28 --- src/usr.sbin/sysinst/msg.mi.es:1.27 Sat Oct 24 16:13:15 2020 +++ src/usr.sbin/sysinst/msg.mi.es Tue Oct 27 15:28:01 2020 @@ -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 @@ Recuerde, el directorio debe contener lo } 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} Index: src/usr.sbin/sysinst/msg.mi.fr diff -u src/usr.sbin/sysinst/msg.mi.fr:1.32 src/usr.sbin/sysinst/msg.mi.fr:1.33 --- src/usr.sbin/sysinst/msg.mi.fr:1.32 Sat Oct 24 16:13:15 2020 +++ src/usr.sbin/sysinst/msg.mi.fr Tue Oct 27 15:28:01 2020 @@ -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 @@ tgz. } 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} Index: src/usr.sbin/sysinst/util.c diff -u src/usr.sbin/sysinst/util.c:1.51 src/usr.sbin/sysinst/util.c:1.52 --- src/usr.sbin/sysinst/util.c:1.51 Mon Oct 26 20:18:33 2020 +++ src/usr.sbin/sysinst/util.c Tue Oct 27 15:28:01 2020 @@ -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 @@ get_available_cds(void) 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 @@ get_via_cdrom(void) 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 @@ get_via_cdrom(void) 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 @@ get_via_cdrom(void) 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 @@ get_via_cdrom(void) /* 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;