Tue Oct 27 15:28:01 2020 UTC ()
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).


(martin)
diff -r1.22 -r1.23 src/usr.sbin/sysinst/menus.mi
diff -r1.25 -r1.26 src/usr.sbin/sysinst/msg.mi.de
diff -r1.33 -r1.34 src/usr.sbin/sysinst/msg.mi.en
diff -r1.33 -r1.34 src/usr.sbin/sysinst/msg.mi.pl
diff -r1.27 -r1.28 src/usr.sbin/sysinst/msg.mi.es
diff -r1.32 -r1.33 src/usr.sbin/sysinst/msg.mi.fr
diff -r1.51 -r1.52 src/usr.sbin/sysinst/util.c

cvs diff -r1.22 -r1.23 src/usr.sbin/sysinst/menus.mi (expand / switch to unified diff)

--- src/usr.sbin/sysinst/menus.mi 2020/10/24 16:13:15 1.22
+++ src/usr.sbin/sysinst/menus.mi 2020/10/27 15:28:01 1.23
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: menus.mi,v 1.22 2020/10/24 16:13:15 martin Exp $ */ 1/* $NetBSD: menus.mi,v 1.23 2020/10/27 15:28:01 martin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2003 The NetBSD Foundation, Inc. 4 * Copyright (c) 2003 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by David Laight. 8 * by David Laight.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -453,34 +453,35 @@ menu floppysource, y=-4, x=0, w=70, no b @@ -453,34 +453,35 @@ menu floppysource, y=-4, x=0, w=70, no b
453 display action { msg_display(MSG_floppysource); }; 453 display action { msg_display(MSG_floppysource); };
454 option {src_legend(menu, MSG_Device, fd_dev);}, 454 option {src_legend(menu, MSG_Device, fd_dev);},
455 action { src_prompt(MSG_dev, fd_dev, sizeof fd_dev); }; 455 action { src_prompt(MSG_dev, fd_dev, sizeof fd_dev); };
456 option {src_legend(menu, MSG_fd_type, fd_type);}, sub menu fd_type; 456 option {src_legend(menu, MSG_fd_type, fd_type);}, sub menu fd_type;
457 option {src_legend(menu, MSG_Xfer_dir, xfer_dir);}, 457 option {src_legend(menu, MSG_Xfer_dir, xfer_dir);},
458 action { src_prompt(MSG_Xfer_dir, xfer_dir, sizeof xfer_dir); }; 458 action { src_prompt(MSG_Xfer_dir, xfer_dir, sizeof xfer_dir); };
459 option {src_legend(menu, MSG_delete_xfer_file, 459 option {src_legend(menu, MSG_delete_xfer_file,
460 clean_xfer_dir ? MSG_Yes : MSG_No);}, 460 clean_xfer_dir ? MSG_Yes : MSG_No);},
461 action {clean_xfer_dir = ask_yesno(MSG_delete_xfer_file); }; 461 action {clean_xfer_dir = ask_yesno(MSG_delete_xfer_file); };
462 option MSG_exit_menu_generic, exit, action { *((int*)arg) = SET_RETRY; }; 462 option MSG_exit_menu_generic, exit, action { *((int*)arg) = SET_RETRY; };
463 463
464menu cdromsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue; 464menu cdromsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
465 display action { const char suff[] = "." SETS_TAR_SUFF; 465 display action { const char suff[] = "." SETS_TAR_SUFF;
466 msg_display_subst(MSG_cdromsource, 1, &suff); }; 466 msg_display_add_subst(MSG_cdromsource, 1, &suff); };
467 option {src_legend(menu, MSG_Device, cdrom_dev);}, 467 option {src_legend(menu, MSG_Device, cdrom_dev);},
468 action { src_prompt(MSG_dev, cdrom_dev, sizeof cdrom_dev); }; 468 action { src_prompt(MSG_dev, cdrom_dev, sizeof cdrom_dev); };
469 option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);}, 469 option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);},
470 action { src_prompt(MSG_Set_dir_bin, set_dir_bin, sizeof set_dir_bin); }; 470 action { src_prompt(MSG_Set_dir_bin, set_dir_bin, sizeof set_dir_bin); };
471 option {src_legend(menu, MSG_Set_dir_src, set_dir_src);}, 471 option {src_legend(menu, MSG_Set_dir_src, set_dir_src);},
472 action { src_prompt(MSG_Set_dir_src, set_dir_src, sizeof set_dir_src); }; 472 action { src_prompt(MSG_Set_dir_src, set_dir_src, sizeof set_dir_src); };
473 option MSG_exit_menu_generic, exit, action { *((int*)arg) = SET_RETRY; }; 473 option MSG_abort_install, exit, action { *((int*)arg) = SET_ABANDON; };
 474 option MSG_source_sel_retry, exit, action { *((int*)arg) = SET_RETRY; };
474 475
475menu localfssource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue; 476menu localfssource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
476 display action { const char suff[] = "." SETS_TAR_SUFF; 477 display action { const char suff[] = "." SETS_TAR_SUFF;
477 msg_display_subst(MSG_localfssource, 1, &suff); }; 478 msg_display_subst(MSG_localfssource, 1, &suff); };
478 option {src_legend(menu, MSG_Device, localfs_dev);}, 479 option {src_legend(menu, MSG_Device, localfs_dev);},
479 action { src_prompt(MSG_dev, localfs_dev, sizeof localfs_dev);}; 480 action { src_prompt(MSG_dev, localfs_dev, sizeof localfs_dev);};
480 option {src_legend(menu, MSG_File_system, localfs_fs);}, 481 option {src_legend(menu, MSG_File_system, localfs_fs);},
481 action { src_prompt(MSG_filesys, localfs_fs, sizeof localfs_fs); }; 482 action { src_prompt(MSG_filesys, localfs_fs, sizeof localfs_fs); };
482 option {src_legend(menu, MSG_Base_dir, localfs_dir);}, 483 option {src_legend(menu, MSG_Base_dir, localfs_dir);},
483 action { src_prompt(MSG_Base_dir, localfs_dir, sizeof localfs_dir);}; 484 action { src_prompt(MSG_Base_dir, localfs_dir, sizeof localfs_dir);};
484 option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);}, 485 option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);},
485 action { src_prompt(MSG_Set_dir_bin, set_dir_bin, sizeof set_dir_bin); }; 486 action { src_prompt(MSG_Set_dir_bin, set_dir_bin, sizeof set_dir_bin); };
486 option {src_legend(menu, MSG_Set_dir_src, set_dir_src);}, 487 option {src_legend(menu, MSG_Set_dir_src, set_dir_src);},

cvs diff -r1.25 -r1.26 src/usr.sbin/sysinst/msg.mi.de (expand / switch to unified diff)

--- src/usr.sbin/sysinst/msg.mi.de 2020/10/24 16:13:15 1.25
+++ src/usr.sbin/sysinst/msg.mi.de 2020/10/27 15:28:01 1.26
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: msg.mi.de,v 1.25 2020/10/24 16:13:15 martin Exp $ */ 1/* $NetBSD: msg.mi.de,v 1.26 2020/10/27 15:28:01 martin Exp $ */
2 2
3/* 3/*
4 * Copyright 1997 Piermont Information Systems Inc. 4 * Copyright 1997 Piermont Information Systems Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Philip A. Nelson for Piermont Information Systems Inc. 7 * Written by Philip A. Nelson for Piermont Information Systems Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -541,27 +541,36 @@ Verzeichnis der Diskette liegen. @@ -541,27 +541,36 @@ Verzeichnis der Diskette liegen.
541} 541}
542 542
543/* Called with: Example 543/* Called with: Example
544 * $0 = sets suffix .tgz 544 * $0 = sets suffix .tgz
545 */ 545 */
546message cdromsource 546message cdromsource
547{Geben Sie das CD-Laufwerk und das entsprechende Verzeichnis an, in dem 547{Geben Sie das CD-Laufwerk und das entsprechende Verzeichnis an, in dem
548die Distribution zu finden ist. 548die Distribution zu finden ist.
549(Das Verzeichnis muss $0 Dateien enthalten.) 549(Das Verzeichnis muss $0 Dateien enthalten.)
550 550
551} 551}
552 552
553message No_cd_found 553message No_cd_found
554{Kein CD Laufwerk enthält eine CD mit den Distributions-Dateien!} 554{Kein CD Laufwerk enthält eine CD mit den Distributions-Dateien!
 555Geben Sie die korrekten Daten manuel ein, oder legen Sie eine CD
 556ein und versuchen Sie es erneut.
 557}
 558
 559message abort_install
 560{Installation abbrechen}
 561
 562message source_sel_retry
 563{Zurück zur Quellauswahl}
555 564
556message Available_cds 565message Available_cds
557{Verfügbare CDs} 566{Verfügbare CDs}
558 567
559message ask_cd 568message ask_cd
560{Es wurden mehrere CDs gefunden. Bitte wählen Sie die Installations CD aus.} 569{Es wurden mehrere CDs gefunden. Bitte wählen Sie die Installations CD aus.}
561 570
562message cd_path_not_found 571message cd_path_not_found
563{Die Installationsdateien wurden auf der ausgewählten CD nicht gefunden. Bitte 572{Die Installationsdateien wurden auf der ausgewählten CD nicht gefunden. Bitte
564prüfen Sie den Gerätenamen und Pfad der Installationsdateien.} 573prüfen Sie den Gerätenamen und Pfad der Installationsdateien.}
565 574
566/* Called with: Example 575/* Called with: Example
567 * $0 = sets suffix .tgz 576 * $0 = sets suffix .tgz

cvs diff -r1.33 -r1.34 src/usr.sbin/sysinst/msg.mi.en (expand / switch to unified diff)

--- src/usr.sbin/sysinst/msg.mi.en 2020/10/24 16:13:15 1.33
+++ src/usr.sbin/sysinst/msg.mi.en 2020/10/27 15:28:01 1.34
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: msg.mi.en,v 1.33 2020/10/24 16:13:15 martin Exp $ */ 1/* $NetBSD: msg.mi.en,v 1.34 2020/10/27 15:28:01 martin Exp $ */
2 2
3/* 3/*
4 * Copyright 1997 Piermont Information Systems Inc. 4 * Copyright 1997 Piermont Information Systems Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Philip A. Nelson for Piermont Information Systems Inc. 7 * Written by Philip A. Nelson for Piermont Information Systems Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -520,28 +520,35 @@ file system. The set files must be in t @@ -520,28 +520,35 @@ file system. The set files must be in t
520} 520}
521 521
522/* Called with: Example 522/* Called with: Example
523 * $0 = sets suffix .tgz 523 * $0 = sets suffix .tgz
524 */ 524 */
525message cdromsource 525message cdromsource
526{Enter the CDROM device to be used and directory on the CDROM where 526{Enter the CDROM device to be used and directory on the CDROM where
527the distribution is located.  527the distribution is located.
528Remember, the directory should contain the $0 files. 528Remember, the directory should contain the $0 files.
529 529
530} 530}
531 531
532message No_cd_found 532message No_cd_found
533{Could not locate a CD medium in any drive with the distribution sets.  533{Could not locate a CD medium in any drive with the distribution sets!
534Check the proper medium and retry!} 534Enter the correct data manually, or insert a disk and retry.
 535}
 536
 537message abort_install
 538{Cancel installation}
 539
 540message source_sel_retry
 541{Back to source selection & retry}
535 542
536message Available_cds 543message Available_cds
537{Available CDs } 544{Available CDs }
538 545
539message ask_cd 546message ask_cd
540{Multiple CDs found. Please select the one containing the install CD.} 547{Multiple CDs found. Please select the one containing the install CD.}
541 548
542message cd_path_not_found 549message cd_path_not_found
543{The installation sets have not been found at the default location on this 550{The installation sets have not been found at the default location on this
544CD. Please check the device and path name.} 551CD. Please check the device and path name.}
545 552
546/* Called with: Example 553/* Called with: Example
547 * $0 = sets suffix .tgz 554 * $0 = sets suffix .tgz

cvs diff -r1.33 -r1.34 src/usr.sbin/sysinst/msg.mi.pl (expand / switch to unified diff)

--- src/usr.sbin/sysinst/msg.mi.pl 2020/10/24 16:13:15 1.33
+++ src/usr.sbin/sysinst/msg.mi.pl 2020/10/27 15:28:01 1.34
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: msg.mi.pl,v 1.33 2020/10/24 16:13:15 martin Exp $ */ 1/* $NetBSD: msg.mi.pl,v 1.34 2020/10/27 15:28:01 martin Exp $ */
2/* Based on english version: */ 2/* Based on english version: */
3/* NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp */ 3/* NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp */
4 4
5/* 5/*
6 * Copyright 1997 Piermont Information Systems Inc. 6 * Copyright 1997 Piermont Information Systems Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Written by Philip A. Nelson for Piermont Information Systems Inc. 9 * Written by Philip A. Nelson for Piermont Information Systems Inc.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -514,28 +514,35 @@ znajdowac sie w glownym katalogu dyskiet @@ -514,28 +514,35 @@ znajdowac sie w glownym katalogu dyskiet
514} 514}
515 515
516/* Called with: Example 516/* Called with: Example
517 * $0 = sets suffix .tgz 517 * $0 = sets suffix .tgz
518 */ 518 */
519message cdromsource 519message cdromsource
520{Podaj urzadzenie CDROM oraz katalog na CDROMie, w ktorym znajduje sie 520{Podaj urzadzenie CDROM oraz katalog na CDROMie, w ktorym znajduje sie
521dystrybucja.  521dystrybucja.
522Pamietaj, ze katalog musi zawierac pliki $0. 522Pamietaj, ze katalog musi zawierac pliki $0.
523 523
524} 524}
525 525
526message No_cd_found 526message No_cd_found
527{Could not locate a CD medium in any drive with the distribution sets.  527{Could not locate a CD medium in any drive with the distribution sets!
528Check the proper medium and retry!} 528Enter the correct data manually, or insert a disk and retry.
 529}
 530
 531message abort_install
 532{Cancel installation}
 533
 534message source_sel_retry
 535{Back to source selection & retry}
529 536
530message Available_cds 537message Available_cds
531{Dostepne napedy CD} 538{Dostepne napedy CD}
532 539
533message ask_cd 540message ask_cd
534{Znaleziono kilka napedow CD, prosze wybrac ten, ktory zawiera 541{Znaleziono kilka napedow CD, prosze wybrac ten, ktory zawiera
535nosnik instalacyjny.} 542nosnik instalacyjny.}
536 543
537message cd_path_not_found 544message cd_path_not_found
538{Zbiory instalacyjne nie zostaly znalezione w domyslnym polozeniu na tym 545{Zbiory instalacyjne nie zostaly znalezione w domyslnym polozeniu na tym
539CD. Prosze sprawdzic urzadzenie i sciezke.} 546CD. Prosze sprawdzic urzadzenie i sciezke.}
540 547
541/* Called with: Example 548/* Called with: Example

cvs diff -r1.27 -r1.28 src/usr.sbin/sysinst/msg.mi.es (expand / switch to unified diff)

--- src/usr.sbin/sysinst/msg.mi.es 2020/10/24 16:13:15 1.27
+++ src/usr.sbin/sysinst/msg.mi.es 2020/10/27 15:28:01 1.28
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: msg.mi.es,v 1.27 2020/10/24 16:13:15 martin Exp $ */ 1/* $NetBSD: msg.mi.es,v 1.28 2020/10/27 15:28:01 martin Exp $ */
2 2
3/* 3/*
4 * Copyright 1997 Piermont Information Systems Inc. 4 * Copyright 1997 Piermont Information Systems Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Philip A. Nelson for Piermont Information Systems Inc. 7 * Written by Philip A. Nelson for Piermont Information Systems Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -536,28 +536,35 @@ en el directorio raíz de los disquetes. @@ -536,28 +536,35 @@ en el directorio raíz de los disquetes.
536} 536}
537 537
538/* Called with: Example 538/* Called with: Example
539 * $0 = sets suffix .tgz 539 * $0 = sets suffix .tgz
540 */ 540 */
541message cdromsource 541message cdromsource
542{Introduzca el dispositivo de CDROM a usar y el directorio del CDROM 542{Introduzca el dispositivo de CDROM a usar y el directorio del CDROM
543donde se encuentre la distribución. 543donde se encuentre la distribución.
544Recuerde, el directorio debe contener los archivos $0. 544Recuerde, el directorio debe contener los archivos $0.
545 545
546} 546}
547 547
548message No_cd_found 548message No_cd_found
549{Could not locate a CD medium in any drive with the distribution sets.  549{Could not locate a CD medium in any drive with the distribution sets!
550Check the proper medium and retry!} 550Enter the correct data manually, or insert a disk and retry.
 551}
 552
 553message abort_install
 554{Cancel installation}
 555
 556message source_sel_retry
 557{Back to source selection & retry}
551 558
552message Available_cds 559message Available_cds
553{Available CDs} 560{Available CDs}
554 561
555message ask_cd 562message ask_cd
556{Multiple CDs found, please select the one containing the install CD.} 563{Multiple CDs found, please select the one containing the install CD.}
557 564
558message cd_path_not_found 565message cd_path_not_found
559{The installation sets have not been found at the default location on this 566{The installation sets have not been found at the default location on this
560CD. Please check device and path name.} 567CD. Please check device and path name.}
561 568
562/* Called with: Example 569/* Called with: Example
563 * $0 = sets suffix .tgz 570 * $0 = sets suffix .tgz

cvs diff -r1.32 -r1.33 src/usr.sbin/sysinst/msg.mi.fr (expand / switch to unified diff)

--- src/usr.sbin/sysinst/msg.mi.fr 2020/10/24 16:13:15 1.32
+++ src/usr.sbin/sysinst/msg.mi.fr 2020/10/27 15:28:01 1.33
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: msg.mi.fr,v 1.32 2020/10/24 16:13:15 martin Exp $ */ 1/* $NetBSD: msg.mi.fr,v 1.33 2020/10/27 15:28:01 martin Exp $ */
2 2
3/* 3/*
4 * Copyright 1997 Piermont Information Systems Inc. 4 * Copyright 1997 Piermont Information Systems Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Philip A. Nelson for Piermont Information Systems Inc. 7 * Written by Philip A. Nelson for Piermont Information Systems Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -532,28 +532,35 @@ Les fichiers d'installation devront se t @@ -532,28 +532,35 @@ Les fichiers d'installation devront se t
532de chaque disquette. 532de chaque disquette.
533 533
534} 534}
535 535
536message cdromsource 536message cdromsource
537{Veuillez spécifier le nom du lecteur CD-ROM à utiliser, 537{Veuillez spécifier le nom du lecteur CD-ROM à utiliser,
538ainsi que le nom du répertoire contenant les fichiers d'installation. 538ainsi que le nom du répertoire contenant les fichiers d'installation.
539Ils doivent être placés à sa racine, sous la forme de fichiers 539Ils doivent être placés à sa racine, sous la forme de fichiers
540tgz. 540tgz.
541 541
542} 542}
543 543
544message No_cd_found 544message No_cd_found
545{Could not locate a CD medium in any drive with the distribution sets.  545{Could not locate a CD medium in any drive with the distribution sets!
546Check the proper medium and retry!} 546Enter the correct data manually, or insert a disk and retry.
 547}
 548
 549message abort_install
 550{Cancel installation}
 551
 552message source_sel_retry
 553{Back to source selection & retry}
547 554
548message Available_cds 555message Available_cds
549{CD-ROM disponibles} 556{CD-ROM disponibles}
550 557
551message ask_cd 558message ask_cd
552{Plusieurs CD-ROM ont été trouvés. Sélectionnez celui contenant le système 559{Plusieurs CD-ROM ont été trouvés. Sélectionnez celui contenant le système
553d'installation de NetBSD.} 560d'installation de NetBSD.}
554 561
555message cd_path_not_found 562message cd_path_not_found
556{Les archives d'installation ne peuvent être trouvées à l'emplacement spécifié 563{Les archives d'installation ne peuvent être trouvées à l'emplacement spécifié
557sur ce CD-ROM. Assurez-vous que le périphérique et le chemin sont les bons.} 564sur ce CD-ROM. Assurez-vous que le périphérique et le chemin sont les bons.}
558 565
559message localfssource 566message localfssource

cvs diff -r1.51 -r1.52 src/usr.sbin/sysinst/util.c (expand / switch to unified diff)

--- src/usr.sbin/sysinst/util.c 2020/10/26 20:18:33 1.51
+++ src/usr.sbin/sysinst/util.c 2020/10/27 15:28:01 1.52
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: util.c,v 1.51 2020/10/26 20:18:33 martin Exp $ */ 1/* $NetBSD: util.c,v 1.52 2020/10/27 15:28:01 martin Exp $ */
2 2
3/* 3/*
4 * Copyright 1997 Piermont Information Systems Inc. 4 * Copyright 1997 Piermont Information Systems Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Philip A. Nelson for Piermont Information Systems Inc. 7 * Written by Philip A. Nelson for Piermont Information Systems Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -529,26 +529,31 @@ get_available_cds(void) @@ -529,26 +529,31 @@ get_available_cds(void)
529 data.num_mounted = m; 529 data.num_mounted = m;
530 } 530 }
531 531
532 enumerate_disks(&data, get_available_cds_helper); 532 enumerate_disks(&data, get_available_cds_helper);
533 533
534 free(data.mounted); 534 free(data.mounted);
535 535
536 return data.count; 536 return data.count;
537} 537}
538 538
539static int 539static int
540cd_has_sets(void) 540cd_has_sets(void)
541{ 541{
 542
 543 /* sanity check */
 544 if (cdrom_dev[0] == 0)
 545 return 0;
 546
542 /* Mount it */ 547 /* Mount it */
543 if (run_program(RUN_SILENT, "/sbin/mount -rt cd9660 /dev/%s /mnt2", 548 if (run_program(RUN_SILENT, "/sbin/mount -rt cd9660 /dev/%s /mnt2",
544 cdrom_dev) != 0) 549 cdrom_dev) != 0)
545 return 0; 550 return 0;
546 551
547 mnt2_mounted = 1; 552 mnt2_mounted = 1;
548 553
549 snprintf(ext_dir_bin, sizeof ext_dir_bin, "%s/%s", "/mnt2", set_dir_bin); 554 snprintf(ext_dir_bin, sizeof ext_dir_bin, "%s/%s", "/mnt2", set_dir_bin);
550 snprintf(ext_dir_src, sizeof ext_dir_src, "%s/%s", "/mnt2", set_dir_src); 555 snprintf(ext_dir_src, sizeof ext_dir_src, "%s/%s", "/mnt2", set_dir_src);
551 return dir_exists_p(ext_dir_bin); 556 return dir_exists_p(ext_dir_bin);
552} 557}
553 558
554/* 559/*
@@ -586,86 +591,83 @@ root_is_read_only(void) @@ -586,86 +591,83 @@ root_is_read_only(void)
586} 591}
587 592
588/* 593/*
589 * Get from a CDROM distribution. 594 * Get from a CDROM distribution.
590 * Also used on "installation using bootable install media" 595 * Also used on "installation using bootable install media"
591 * as the default option in the "distmedium" menu. 596 * as the default option in the "distmedium" menu.
592 */ 597 */
593int 598int
594get_via_cdrom(void) 599get_via_cdrom(void)
595{ 600{
596 menu_ent cd_menu[MAX_CD_INFOS]; 601 menu_ent cd_menu[MAX_CD_INFOS];
597 struct stat sb; 602 struct stat sb;
598 int rv, num_cds, menu_cd, i, selected_cd = 0; 603 int rv, num_cds, menu_cd, i, selected_cd = 0;
599 bool silent = false; 
600 int mib[2]; 604 int mib[2];
601 char rootdev[SSTRSIZE] = ""; 605 char rootdev[SSTRSIZE] = "";
602 size_t varlen; 606 size_t varlen;
603 607
604 /* If root is not md(4) and we have set dir, skip this step. */ 608 /* If root is not md(4) and we have set dir, skip this step. */
605 mib[0] = CTL_KERN; 609 mib[0] = CTL_KERN;
606 mib[1] = KERN_ROOT_DEVICE; 610 mib[1] = KERN_ROOT_DEVICE;
607 varlen = sizeof(rootdev); 611 varlen = sizeof(rootdev);
608 (void)sysctl(mib, 2, rootdev, &varlen, NULL, 0); 612 (void)sysctl(mib, 2, rootdev, &varlen, NULL, 0);
609 if (stat(set_dir_bin, &sb) == 0 && S_ISDIR(sb.st_mode) && 613 if (stat(set_dir_bin, &sb) == 0 && S_ISDIR(sb.st_mode) &&
610 strncmp("md", rootdev, 2) != 0) { 614 strncmp("md", rootdev, 2) != 0) {
611 strlcpy(ext_dir_bin, set_dir_bin, sizeof ext_dir_bin); 615 strlcpy(ext_dir_bin, set_dir_bin, sizeof ext_dir_bin);
612 strlcpy(ext_dir_src, set_dir_src, sizeof ext_dir_src); 616 strlcpy(ext_dir_src, set_dir_src, sizeof ext_dir_src);
613 return SET_OK; 617 return SET_OK;
614 } 618 }
615 619
616 memset(cd_menu, 0, sizeof(cd_menu)); 620 memset(cd_menu, 0, sizeof(cd_menu));
617 num_cds = get_available_cds(); 621 num_cds = get_available_cds();
618 if (num_cds <= 0) { 622 if (num_cds <= 0) {
619 hit_enter_to_continue(MSG_No_cd_found, NULL); 623 msg_display(MSG_No_cd_found);
620 return SET_RETRY; 624 cdrom_dev[0] = 0;
621 } else if (num_cds == 1) { 625 } else if (num_cds == 1) {
622 /* single CD found, check for sets on it */ 626 /* single CD found, check for sets on it */
623 strcpy(cdrom_dev, cds[0].device_name); 627 strcpy(cdrom_dev, cds[0].device_name);
624 if (cd_has_sets()) 628 if (cd_has_sets())
625 return SET_OK; 629 return SET_OK;
626 } else { 630 } else {
627 for (i = 0; i< num_cds; i++) { 631 for (i = 0; i< num_cds; i++) {
628 cd_menu[i].opt_name = cds[i].menu; 632 cd_menu[i].opt_name = cds[i].menu;
629 cd_menu[i].opt_flags = OPT_EXIT; 633 cd_menu[i].opt_flags = OPT_EXIT;
630 cd_menu[i].opt_action = set_menu_select; 634 cd_menu[i].opt_action = set_menu_select;
631 } 635 }
632 /* create a menu offering available choices */ 636 /* create a menu offering available choices */
633 menu_cd = new_menu(MSG_Available_cds, 637 menu_cd = new_menu(MSG_Available_cds,
634 cd_menu, num_cds, -1, 4, 0, 0, 638 cd_menu, num_cds, -1, 4, 0, 0,
635 MC_SCROLL | MC_NOEXITOPT, 639 MC_SCROLL | MC_NOEXITOPT,
636 NULL, NULL, NULL, NULL, NULL); 640 NULL, NULL, NULL, NULL, NULL);
637 if (menu_cd == -1) 641 if (menu_cd == -1)
638 return SET_RETRY; 642 return SET_RETRY;
639 msg_display(MSG_ask_cd); 643 msg_display(MSG_ask_cd);
640 process_menu(menu_cd, &selected_cd); 644 process_menu(menu_cd, &selected_cd);
641 free_menu(menu_cd); 645 free_menu(menu_cd);
642 strcpy(cdrom_dev, cds[selected_cd].device_name); 646 strcpy(cdrom_dev, cds[selected_cd].device_name);
643 if (cd_has_sets()) 647 if (cd_has_sets())
644 return SET_OK; 648 return SET_OK;
645 } 649 }
646 650
647 if (silent) 651 if (num_cds >= 1 && mnt2_mounted) {
648 msg_display(""); 
649 else { 
650 umount_mnt2(); 652 umount_mnt2();
651 hit_enter_to_continue(MSG_cd_path_not_found, NULL); 653 hit_enter_to_continue(MSG_cd_path_not_found, NULL);
652 } 654 }
653 655
654 /* ask for paths on the CD */ 656 /* ask for paths on the CD */
655 rv = -1; 657 rv = -1;
656 process_menu(MENU_cdromsource, &rv); 658 process_menu(MENU_cdromsource, &rv);
657 if (rv == SET_RETRY) 659 if (rv == SET_RETRY || rv == SET_ABANDON)
658 return SET_RETRY; 660 return rv;
659 661
660 if (cd_has_sets()) 662 if (cd_has_sets())
661 return SET_OK; 663 return SET_OK;
662 664
663 return SET_RETRY; 665 return SET_RETRY;
664} 666}
665 667
666 668
667/* 669/*
668 * Get from a pathname inside an unmounted local filesystem 670 * Get from a pathname inside an unmounted local filesystem
669 * (e.g., where sets were preloaded onto a local DOS partition) 671 * (e.g., where sets were preloaded onto a local DOS partition)
670 */ 672 */
671int 673int