diff --git a/usr.sbin/bsdconfig/include/messages.subr b/usr.sbin/bsdconfig/include/messages.subr index 32e116ff0b9f..1c558f20653b 100644 --- a/usr.sbin/bsdconfig/include/messages.subr +++ b/usr.sbin/bsdconfig/include/messages.subr @@ -1,422 +1,421 @@ # Copyright (c) 2012 Ron McDowell # Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ field_password="Password:" field_username="Username:" hline_alnum_arrows_punc_tab_enter="Use alnum, arrows, punctuation, TAB or ENTER" hline_alnum_punc_tab_enter="Use alpha-numeric, punctuation, TAB or ENTER" hline_arrows_tab_enter="Press arrows, TAB or ENTER" hline_arrows_tab_punc_enter="Use arrows, TAB, punctuation, ENTER" hline_choose_help_for_more_information_on_media_types="Choose Help for more information on the various media types" msg_accept_continue="Accept/Continue" msg_accessibility_desc="Ports to help disabled users." msg_adding_package_as_a_dependency_from_media="Adding %s (as a dependency) from %s" msg_adding_package_from_media="Adding %s from %s" msg_afterstep_desc="Ports to support the AfterStep window manager." msg_all="All" msg_all_desc="All available packages in all categories." msg_always_try_sudo_when_run_as="Always try sudo(8) when run as %s" msg_arabic_desc="Ported software for Arab countries." msg_archivers_desc="Utilities for archiving and unarchiving data." msg_armenia="Armenia" msg_assume_network_is_already_configured="Running multi-user, assume that the network is already configured?" msg_assume_yes_to_all_non_critical_dialogs="Assume \"Yes\" answers to all non-critical dialogs" msg_astro_desc="Applications related to astronomy." msg_attempt_automatic_dhcp_configuration="Attempt automatic DHCP configuration of interfaces" msg_attempt_ipv6_configuration_of_interfaces="Attempt IPv6 configuration of interfaces" msg_attempting_to_fetch_file_from_selected_media="Attempting to fetch %s file from selected media." msg_audio_desc="Audio utilities - most require a supported sound card." msg_australia="Australia" msg_austria="Austria" msg_back="Back" msg_becoming_root_via_sudo="Becoming root via sudo(8)..." msg_benchmarks_desc="Utilities for measuring system performance." msg_biology_desc="Software related to biology." msg_brazil="Brazil" msg_building_package_menus="Building package menu(s)..." msg_cad_desc="Computer Aided Design utilities." msg_canada="Canada" msg_cancel="Cancel" msg_cancel_exit="Cancel/Exit" msg_cannot_create_permission_denied="%s: cannot create %s: Permission denied" msg_cannot_resolve_hostname="Cannot resolve \`%s'! Are you sure that your\nname server, gateway and network interface are correctly configured?" msg_cant_find_distribution="Warning: Can't find the \`%s' distribution on this\nFTP server. You may need to visit a different server for\nthe release you are trying to fetch or go to the Options\nmenu and set the release name to explicitly match what's\navailable on %s (or set to \"any\").\n\nWould you like to select another FTP server?" msg_cant_seem_to_write_out_resolv_conf="Can't seem to write out %s. Net cannot be used." msg_cd_dvd="CD/DVD" msg_cdrom="CDROM" msg_checking_access_to="Checking access to\n %s" msg_china="China" msg_chinese_desc="Ported software for the Chinese market." msg_choose_a_cd_dvd_type="Choose a CD/DVD type" msg_choose_a_dos_partition="Choose a DOS partition" msg_choose_a_floppy_drive="Choose a Floppy drive" msg_choose_a_ufs_partition="Choose a UFS partition" msg_choose_a_usb_drive="Choose a USB drive" msg_choose_installation_media="Choose Installation Media" msg_choose_installation_media_description="FreeBSD can be installed from a variety of different installation\nmedia, ranging from floppies to an Internet FTP server. If you're\ninstalling FreeBSD from a supported CD/DVD drive then this is generally\nthe best media to use if you have no overriding reason for using other\nmedia." msg_client_error="Client error, you could try an other server" msg_command_failed_rest_of_script_aborted="Command \`%s' failed - rest of script aborted." msg_comms_desc="Communications utilities." msg_configuration_for_interface="Configuration for Interface" msg_converters_desc="Format conversion utilities." msg_could_not_unmount_the_cdrom_dvd="Could not unmount the CDROM/DVD from %s: %s" msg_could_not_unmount_the_dos_partition="Could not unmount the DOS partition from %s: %s" msg_could_not_unmount_the_nfs_partition="Could not unmount the NFS partition from %s: %s" msg_could_not_unmount_the_ufs_partition="Could not unmount the UFS partition from %s: %s" msg_couldnt_connect_to_ftp_server="Couldn't connect to FTP server" msg_couldnt_connect_to_proxy="Couldn't connect to proxy" msg_couldnt_connect_to_server="Couldn't connect to server" msg_couldnt_open_ftp_connection="Couldn't open FTP connection to %s:\n %s." msg_created_path="Created %s" msg_czech_republic="Czech Republic" msg_databases_desc="Database software." msg_debugging="Debugging" msg_denmark="Denmark" msg_deskutils_desc="Various Desktop utilities." msg_devel_desc="Software development utilities and libraries." msg_device_is_not_configured="The %s device is not configured. You will need to do so\nin the Networking configuration menu before proceeding." msg_dhcp="DHCP" msg_dialog_mixedform_navigation_help="Use / arrows to navigate between fields, TAB to focus buttons, and Enter for OK/Cancel." msg_directory="Directory" msg_directory_not_found="%s: Directory not found." msg_directory_where_package_temporary_files_go="The directory where package temporary files should go" msg_dns_desc="Domain Name Service tools." msg_docs_desc="Meta-ports for FreeBSD documentation." msg_done="Done" msg_dos="DOS" msg_editor="Editor" msg_editors_desc="Editors." msg_elisp_desc="Things related to Emacs Lisp." msg_emit_extra_debugging_output="Emit extra debugging output" msg_emulators_desc="Utilities for emulating other operating systems." msg_enlightenment_desc="Software for the Enlightenment Desktop Environment." msg_enter_a_fully_qualified_pathname_for_the_directory="Enter a fully qualified pathname for the directory\ncontaining the FreeBSD distribution files:" msg_enter_the_device_name_of_a_ufs_formatted_partition="Enter the device-name of a UFS formatted partition" msg_error="Error" msg_error_mounting_device="Error mounting %s on %s: %s" msg_error_mounting_floppy_device="Error mounting floppy %s (%s) on %s: %s" msg_error_mounting_usb_drive="Error mounting USB drive %s on %s: %s" msg_error_when_requesting_url="Error when requesting %s, you could try an other server" msg_estonia="Estonia" msg_exit="Exit" msg_exit_bsdconfig="Exit bsdconfig" msg_extra_options_to_ifconfig="Extra options to ifconfig (usually empty):" msg_failed_to_add_default_route="Failed to add a default route; please check your network configuration" msg_file_system="File System" msg_finance_desc="Monetary, financial and related applications." msg_finland="Finland" msg_floppy="Floppy" msg_france="France" msg_french_desc="Ported software for French countries." msg_ftp="FTP" msg_ftp_desc="FTP client and server utilities." msg_ftp_passive="FTP Passive" msg_ftp_username="FTP username" msg_games_desc="Various games and sundry amusements." msg_geography_desc="Geography-related software." msg_german_desc="Ported software for Germanic countries." msg_germany="Germany" msg_gnome_desc="Components of the Gnome Desktop environment." msg_gnustep_desc="Software for GNUstep desktop environment." msg_graphics_desc="Graphics libraries and utilities." msg_greece="Greece" msg_hamradio_desc="Software for amateur radio." msg_haskell_desc="Software related to the Haskell language." msg_hebrew_desc="Ported software for Hebrew language." msg_help="Help" msg_host_name_including_domain="Host name (including domain)" msg_hostname_variable_not_set="WARNING: hostname variable not set and is a non-optional\nparameter. Please add this to your installation script\nor set the netInteractive variable (see bsdconfig man page)" msg_http_direct="HTTP Direct" msg_http_proxy="HTTP Proxy" msg_hungarian_desc="Ported software for the Hungarian market." msg_iceland="Iceland" msg_install_from_a_dos_partition="Install from a DOS partition" msg_install_from_a_floppy_disk_set="Install from a floppy disk set" msg_install_from_a_freebsd_cd_dvd="Install from a FreeBSD CD/DVD" msg_install_from_a_ufs_partition="Install from a UFS partition" msg_install_from_a_usb_drive="Install from a USB drive" msg_install_from_an_ftp_server="Install from an FTP server" msg_install_from_an_ftp_server_thru_firewall="Install from an FTP server through a firewall" msg_install_from_an_ftp_server_thru_proxy="Install from an FTP server through an HTTP proxy" msg_install_from_an_http_server="Install from an HTTP server" msg_install_from_the_existing_filesystem="Install from the existing filesystem" msg_install_over_nfs="Install over NFS" msg_installed="Installed" msg_installed_lc="installed" msg_installed_desc="Leave package as-is, installed" msg_invalid_gateway_ipv4_address_specified="Invalid gateway IPv4 address specified" msg_invalid_hostname_value="Invalid hostname value" msg_invalid_ipv4_address="Invalid IPv4 address" msg_invalid_name_server_ip_address_specified="Invalid name server IP address specified" msg_invalid_netmask_value="Invalid netmask value" msg_invalid_nfs_path_specification="Invalid NFS path specification. Must be of the form:\nhost:/full/pathname/to/FreeBSD/distdir" msg_io_error_while_reading_in_the_package="I/O error while reading in the %s package." msg_io_or_format_error_on_index_file="I/O or format error on %s file.\nPlease verify media (or path to media) and try again." msg_ipv4_address="IPv4 Address" msg_ipv4_gateway="IPv4 Gateway" msg_ipv6="IPv6" msg_ipv6_desc="IPv6-related software." msg_ipv6_ready="IPv6 ready" msg_irc_desc="Internet Relay Chat utilities." msg_ireland="Ireland" msg_israel="Israel" msg_italy="Italy" msg_japan="Japan" msg_japanese_desc="Ported software for the Japanese market." msg_java_desc="Java language support." msg_kde_desc="Software for the K Desktop Environment." msg_kld_desc="Kernel loadable modules." msg_korea="Korea" msg_korean_desc="Ported software for the Korean market." msg_lang_desc="Computer languages." msg_latvia="Latvia" msg_length_of_specified_url_is_too_long="Length of specified URL is %u characters. Allowable maximum is %u." msg_linux_desc="Linux programs that can run under binary compatibility." msg_lisp_desc="Software related to the Lisp language." msg_lithuania="Lithuania" msg_loading_of_dependent_package_failed="Loading of dependent package %s failed" msg_located_index_now_reading_package_data_from_it="Located INDEX, now reading package data from it..." msg_logging_in_to_user_at_host="Logging in to %s@%s.." msg_looking_up_host="Looking up host %s" msg_mail_desc="Electronic mail packages and utilities." msg_main_menu="Main Menu" msg_main_site="Main Site" msg_math_desc="Mathematical computation software." msg_mbone_desc="Applications and utilities for the MBONE." msg_media_timeout="Media Timeout" msg_media_type="Media Type" msg_menu_text="If you've already installed FreeBSD, you may use\nthis menu to customize it somewhat to suit your\nparticular configuration. Most importantly, you\ncan use the Packages utility to load extra '3rd\nparty' software not provided in the base\ndistributions." msg_misc_desc="Miscellaneous utilities." msg_missing_ftp_host_or_directory="Missing FTP host or directory specification. FTP media not initialized." msg_multimedia_desc="Multimedia software." msg_must_be_root_to_execute="%s: must be root to execute" msg_must_specify_a_host_name_of_some_sort="Must specify a host name of some sort!" msg_name_server="Name server" msg_net_desc="Networking utilities." msg_net_device_init_failed="Net device init failed." msg_net_im_desc="Instant messaging software." msg_net_mgmt_desc="Network management tools." msg_net_p2p_desc="Peer to peer network applications." msg_netherlands="Netherlands" msg_netmask="Netmask" msg_network_configuration="Network Configuration" msg_network_interface_information_required="Network interface information required" msg_new_zealand="New Zealand" msg_news_desc="USENET News support software." msg_next_page="Next page" msg_nfailed_attempts="%u incorrect password attempts" msg_nfs="NFS" msg_nfs_secure="NFS Secure" msg_nfs_server_talks_only_on_a_secure_port="NFS server talks only on a secure port" msg_nfs_slow="NFS Slow" msg_nfs_tcp="NFS TCP" msg_nfs_version_3="NFS version 3" msg_no="No" msg_no_cd_dvd_devices_found="No CD/DVD devices found! Please check that your system's\nconfiguration is correct and that the CD/DVD drive is of a\nsupported type. For more information, consult the hardware\nguide in the Doc menu." msg_no_description_provided="No description provided" msg_no_dos_primary_partitions_found="No DOS primary partitions found! This installation method is unavailable" msg_no_floppy_devices_found="No floppy devices found! Please check that your system's configuration\nis correct. For more information, consult the hardware guide in the Doc\nmenu." msg_no_gateway_has_been_set="No gateway has been set. You will be unable to access hosts\nnot on your local network" msg_no_network_devices="No network devices available!" msg_no_package_name_passed_in_package_variable="No package name passed in package variable" msg_no_packages_were_selected_for_extraction="No packages were selected for extraction." msg_no_such_file_or_directory="%s: %s: No such file or directory" msg_no_usb_devices_found="No USB devices found (try Options/Re-scan Devices)" msg_no_username="No username provided!" msg_norway="Norway" msg_not_a_directory="%s: %s: Not a directory" msg_not_found="not found" msg_not_yet_set="not yet set" msg_ok="OK" msg_options="Options" msg_options_editor="Options Editor" msg_other="other" msg_pkg_delete_failed="Warning: pkg_delete of %s failed.\n Run with debugging for details." msg_package_is_needed_by_other_installed_packages="Warning: Package %s is needed by\n %d other installed package%s." msg_package_not_installed_cannot_delete="Warning: package %s not installed\n No package can be deleted." msg_package_read_successfully_waiting_for_pkg_add="Package %s read successfully - waiting for pkg_add(1)" msg_package_temp="Package Temp" msg_package_was_added_successfully="Package %s was added successfully" msg_packages="packages" msg_page_of_npages="(Page %s of %s)" msg_palm_desc="Software support for the Palm(tm) series." msg_parallel_desc="Applications dealing with parallelism in computing." msg_pear_desc="Software related to the Pear PHP framework." msg_perl5_desc="Utilities/modules for the PERL5 language." msg_permission_denied="%s: %s: Permission denied" msg_pkg_add_apparently_did_not_like_the_package="pkg_add(1) apparently did not like the %s package." msg_plan9_desc="Software from the Plan9 operating system." msg_please_check_the_url_and_try_again="No such directory: %s\nplease check the URL and try again.\n" msg_please_enter_password="Please enter your password for sudo(8):" msg_please_enter_the_address_of_the_http_proxy="Please enter the address of the HTTP proxy in this format:\n hostname:port (the ':port' is optional, default is 3128)" msg_please_enter_the_full_nfs_file_specification="Please enter the full NFS file specification for the remote\nhost and directory containing the FreeBSD distribution files.\nThis should be in the format: hostname:/some/freebsd/dir" msg_please_enter_the_password_for_this_user="Please enter the password for this user:" msg_please_enter_the_username_you_wish_to_login_as="Please enter the username you wish to login as:" msg_please_enter_username_password="Please enter a username and password for sudo(8):" msg_please_insert_floppy_containing="Please insert floppy containing %s in %s" msg_please_insert_floppy_in_drive="Please insert floppy in %s" msg_please_select_a_category_to_display="Please select a category to display." msg_please_select_a_cd_dvd_drive="FreeBSD can be installed directly from a CD/DVD containing a valid\nFreeBSD distribution. If you are seeing this menu it is because\nmore than one CD/DVD drive was found on your system. Please select\none of the following CD/DVD drives as your installation drive." msg_please_select_a_floppy_drive="You have more than one floppy drive. Please choose which drive\nyou would like to use." msg_please_select_a_freebsd_ftp_distribution_site="Please select a FreeBSD FTP distribution site" msg_please_select_a_freebsd_http_distribution_site="Please select a FreeBSD HTTP distribution site" msg_please_select_a_usb_drive="You have more than one USB drive. Please choose which drive\nyou would like to use." msg_please_select_dos_partition="FreeBSD can be installed directly from a DOS partition assuming,\nof course, that you have copied the relevant distributions into\nyour DOS partition before starting this installation. If this is\nnot the case then you should reboot DOS at this time and copy the\ndistributions you wish to install into a \"FREEBSD\" subdirectory\non one of your DOS partitions. Otherwise, please select the DOS\npartition containing the FreeBSD distribution files." msg_please_select_ethernet_device_to_configure="Please select the ethernet or PLIP device to configure." msg_please_select_the_site_closest_to_you_or_other="Please select the site closest to you or \"other\" if you'd like to\nspecify a different choice. Also note that not every site listed here\ncarries more than the base distribution kits. Only Primary sites are\nguaranteed to carry the full range of possible distributions." msg_please_select_ufs_partition="FreeBSD can be installed directly from another FreeBSD partition\nthat is UFS formatted assuming, of course, that you have copied\nthe relevant distributions into said partition before starting\ninstallation." msg_please_specify_a_temporary_directory="Please specify a temporary directory with lots of free space:" msg_please_specify_the_name_of_the_text_editor="Please specify the name of the text editor you wish to use:" msg_please_specify_the_number_of_seconds_to_wait="Please specify the number of seconds to wait for slow media:" msg_please_specify_the_release_you_wish_to_load="Please specify the release you wish to load or\n\"any\" for a generic release install:" msg_please_specify_url_of_a_freebsd_distribution="Please specify the URL of a FreeBSD distribution on a\nremote ftp site. This site must accept either anonymous\nftp or you should have set an ftp username and password\nin the Options screen.\n\nA URL looks like this: ftp:///\nWhere is relative to the anonymous ftp directory or the\nhome directory of the user being logged in as." msg_please_specify_url_of_freebsd_http_distribution="Please specify the URL of a FreeBSD distribution on a\nremote http site.\nA URL looks like this: http:///" msg_poland="Poland" msg_polish_desc="Ported software for the Polish market." msg_ports_mgmt_desc="Utilities for managing ports and packages." msg_portuguese_desc="Ported software for the Portuguese market." msg_previous_page="Previous page" msg_previous_syntax_errors="%s: Not overwriting \`%s' due to previous syntax errors" msg_primary="Primary" msg_print_desc="Utilities for dealing with printing." msg_probing_devices_please_wait_this_can_take_a_while="Probing devices, please wait (this can take a while)..." msg_proceed="Proceed" msg_processing_selection="Processing selection..." msg_python_desc="Software related to the Python language." msg_quick_start_how_to_use_this_menu_system="Quick start - How to use this menu system" msg_reinstall="Reinstall" msg_reinstall_desc="Mark this package for reinstall" msg_release_name="Release Name" msg_required_package_not_found="Warning: %s is a required package but was not found." msg_rerun_bsdconfig_initial_device_probe="Re-run bsdconfig initial device probe" msg_rescan_devices="Re-scan Devices" msg_reset="RESET!" msg_reset_all_values_to_startup_defaults="Reset all values to startup defaults" msg_reuse_old_ftp_site_selection_values="Re-use old FTP site selection values?" msg_reuse_old_http_site_settings="Re-use old HTTP site settings?" msg_review="Review" msg_review_desc="Review/perform pending actions" msg_review_help="Install, Re-Install, or Un-install selected packages and dependencies" msg_reviewing_selected_packages="Reviewing %u selected packages:" msg_ruby_desc="Software related to the Ruby language." msg_rubygems_desc="Ports of RubyGems packages." msg_russia="Russia" msg_russian_desc="Ported software for the Russian market." msg_scanning_for_dhcp_servers="Scanning for DHCP servers..." msg_scanning_for_ra_servers="Scanning for RA servers..." msg_scheme_desc="Software related to the Scheme language." msg_science_desc="Scientific software." msg_secure_mode_requires_root="Secure-mode requires root-access!" msg_secure_mode_requires_x11="Secure-mode requires X11 (use \`-X')!" msg_security_desc="System security software." msg_select="Select" msg_select_a_site_thats_close="Select a site that's close!" msg_selected="selected" msg_server_error_when_requesting_url="Server error when requesting %s, you could try an other server" msg_shells_desc="Various shells (tcsh, bash, etc)." msg_slovak_republic="Slovak Republic" msg_slovenia="Slovenia" msg_sorry_invalid_url="Sorry, %s is an invalid URL!" msg_sorry_package_was_not_found_in_the_index="Sorry, package %s was not found in the INDEX." msg_sorry_try_again="Sorry, try again." msg_south_africa="South Africa" msg_spain="Spain" msg_spanish_desc="Ported software for the Spanish market." msg_specify_some_other_ftp_site="Specify some other ftp site by URL" msg_specify_some_other_http_site="Specify some other http site by URL" msg_sweden="Sweden" msg_switzerland="Switzerland" msg_sysutils_desc="Various system utilities." msg_taiwan="Taiwan" msg_tcl_desc="TCL and packages that depend on it." msg_textproc_desc="Text processing/search utilities." msg_the_current_installation_media_type="The current installation media type." msg_timeout_value_in_seconds_for_slow_media="Timeout value in seconds for slow media." msg_tk_desc="Tk and packages that depend on it." msg_try_dhcp_configuration="Do you want to try DHCP configuration of the interface?" msg_try_ipv6_configuration="Do you want to try IPv6 configuration of the interface?" msg_try_sudo_only_this_once="Try sudo(8) only this once" -msg_turkey="Turkey" msg_ufs="UFS" msg_uk="UK" msg_ukraine="Ukraine" msg_ukrainian_desc="Ported software for the Ukrainian market." msg_unable_to_configure_device="Unable to configure the %s interface!\nThis installation method cannot be used." msg_unable_to_fetch_package_from_selected_media="Unable to fetch package %s from selected media.\nNo package add will be done." msg_unable_to_get_file_from_selected_media="Unable to get %s file from selected media.\n\nThis may be because the packages collection is not available\non the distribution media you've chosen, most likely an FTP site\nwithout the packages collection mirrored. Please verify that\nyour media, or your path to the media, is correct and try again." msg_unable_to_get_proper_ftp_path="Unable to get proper FTP path. FTP media not initialized." msg_unable_to_initialize_media_type_for_package_extract="Unable to initialize media type for package extract." msg_unable_to_make_directory_mountpoint="Unable to make %s directory mountpoint for %s!" msg_unable_to_open="Unable to open %s" msg_uninstall="Uninstall" msg_uninstall_desc="Mark this package for deletion" msg_uninstalling_package_waiting_for_pkg_delete="Uninstalling %s package - waiting for pkg_delete(1)" msg_unknown="unknown" msg_unknown_user="Unknown user: %s" msg_url_was_not_found="%s was not found, maybe directory or release-version are wrong?" msg_usa="USA" msg_usage="Usage" msg_usb="USB" msg_use_defaults="Use Defaults" msg_use_nfs_version_3="Use NFS version 3" msg_use_tcp_protocol_for_nfs="Use TCP protocol for NFS" msg_user_disallowed="User disallowed: %s" msg_user_is_using_a_slow_pc_or_ethernet_card="User is using a slow PC or Ethernet card" msg_username_and_password_to_use="Username and password to use instead of anonymous" msg_using_interface="Using interface %s" msg_using_usb_device="Using USB device: %s" msg_vietnamese_desc="Ported software for the Vietnamese market." msg_view_set_various_media_options="View/Set various media options" msg_what_would_you_like_to_do_with="What would you like to do with %s?" msg_which_release_to_attempt_to_load="Which release to attempt to load from installation media" msg_which_text_editor_to_use="Which text editor to use during installation" msg_windowmaker_desc="Ports to support the WindowMaker window manager." msg_would_you_like_to_bring_interface_up="Would you like to bring the %s interface up right now?" msg_www_desc="Web utilities (browsers, HTTP servers, etc)." msg_x11_clocks_desc="X Window System based clocks." msg_x11_desc="X Window System based utilities." msg_x11_drivers_desc="X Window System drivers." msg_x11_fm_desc="X Window System based file managers." msg_x11_fonts_desc="X Window System fonts and font utilties." msg_x11_servers_desc="X Window System servers." msg_x11_themes_desc="X Window System themes." msg_x11_toolkits_desc="X Window System based development toolkits." msg_x11_wm_desc="X Window System window managers." msg_xfce_desc="Software related to the Xfce Desktop Environment." msg_yes="Yes" msg_yes_to_all="Yes to All" msg_you_are_not_root_but="You are not root but %s can use sudo(8).\nWhat would you like to do?" msg_you_may_remove_the_floppy="You may remove the floppy from %s" msg_youve_already_done_the_network_configuration="You've already done the network configuration once,\nwould you like to skip over it now?" msg_zope_desc="Software related to the Zope platform." tcplayout_extras_help="Any interface-specific options to ifconfig you would like to add" tcplayout_extras_help_for_plip="For PLIP configuration, you must enter the peer's IP address here." tcplayout_gateway_help="IPv4 address of host forwarding packets to non-local destinations" tcplayout_hostname_help="Your fully-qualified hostname, e.g. foo.example.com" tcplayout_ipaddr_help="The IPv4 address to be used for this interface" tcplayout_nameserver_help="IPv4 or IPv6 address of your local DNS server" tcplayout_netmask_help="The netmask for this interface, e.g. 255.255.255.0 for a class C network" diff --git a/usr.sbin/bsdconfig/share/media/ftp.subr b/usr.sbin/bsdconfig/share/media/ftp.subr index 16a10cd23800..dfdff26bc9a3 100644 --- a/usr.sbin/bsdconfig/share/media/ftp.subr +++ b/usr.sbin/bsdconfig/share/media/ftp.subr @@ -1,911 +1,910 @@ if [ ! "$_MEDIA_FTP_SUBR" ]; then _MEDIA_FTP_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ # ############################################################ INCLUDES BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." media/ftp.subr f_include $BSDCFG_SHARE/device.subr f_include $BSDCFG_SHARE/dialog.subr f_include $BSDCFG_SHARE/media/common.subr f_include $BSDCFG_SHARE/media/tcpip.subr f_include $BSDCFG_SHARE/strings.subr f_include $BSDCFG_SHARE/struct.subr f_include $BSDCFG_SHARE/variable.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" f_include_lang $BSDCFG_LIBE/include/messages.subr ############################################################ GLOBALS FTP_SKIP_RESOLV= URL_MAX=261261 # according to actual fetch(1) test-results FTP_DIRS=" . releases/$UNAME_P snapshots/$UNAME_P pub/FreeBSD pub/FreeBSD/releases/$UNAME_P pub/FreeBSD/snapshots/$UNAME_P pub/FreeBSD-Archive/old-releases/$UNAME_P " # END-QUOTE ############################################################ FUNCTIONS # f_dialog_menu_media_ftp # # Prompt the user to select from a range of ``built-in'' FTP servers or specify # their own. If the user makes a choice and doesn't cancel or press Esc, stores # the user's choice in VAR_FTP_PATH (see variables.subr) and returns success. # f_dialog_menu_media_ftp() { f_dialog_title "$msg_please_select_a_freebsd_ftp_distribution_site" local title="$DIALOG_TITLE" btitle="$DIALOG_BACKTITLE" f_dialog_title_restore local prompt="$msg_please_select_the_site_closest_to_you_or_other" local menu_list=" '$msg_main_site' 'ftp.freebsd.org' 'URL' '$msg_specify_some_other_ftp_site' 'IPv6 $msg_main_site' 'ftp.freebsd.org' ' IPv6 $msg_france' 'ftp4.fr.freebsd.org' ' IPv6 $msg_france #8' 'ftp8.fr.freebsd.org' ' IPv6 $msg_ireland' 'ftp3.ie.freebsd.org' ' IPv6 $msg_japan' 'ftp2.jp.freebsd.org' ' IPv6 $msg_sweden' 'ftp4.se.freebsd.org' ' IPv6 $msg_usa' 'ftp4.us.freebsd.org' ' IPv6 $msg_turkey' 'ftp2.tr.freebsd.org' '$msg_primary' 'ftp1.freebsd.org' ' $msg_primary #2' 'ftp2.freebsd.org' ' $msg_primary #3' 'ftp3.freebsd.org' ' $msg_primary #4' 'ftp4.freebsd.org' ' $msg_primary #5' 'ftp5.freebsd.org' ' $msg_primary #6' 'ftp6.freebsd.org' ' $msg_primary #7' 'ftp7.freebsd.org' ' $msg_primary #10' 'ftp10.freebsd.org' ' $msg_primary #11' 'ftp11.freebsd.org' ' $msg_primary #12' 'ftp12.freebsd.org' ' $msg_primary #13' 'ftp13.freebsd.org' ' $msg_primary #14' 'ftp14.freebsd.org' '$msg_armenia' 'ftp1.am.freebsd.org' '$msg_australia' 'ftp.au.freebsd.org' ' $msg_australia #2' 'ftp2.au.freebsd.org' ' $msg_australia #3' 'ftp3.au.freebsd.org' '$msg_austria' 'ftp.at.freebsd.org' '$msg_brazil' 'ftp2.br.freebsd.org' ' $msg_brazil #3' 'ftp3.br.freebsd.org' ' $msg_brazil #4' 'ftp4.br.freebsd.org' '$msg_canada' 'ftp.ca.freebsd.org' '$msg_china' 'ftp.cn.freebsd.org' '$msg_czech_republic' 'ftp.cz.freebsd.org' '$msg_denmark' 'ftp.dk.freebsd.org' '$msg_estonia' 'ftp.ee.freebsd.org' '$msg_finland' 'ftp.fi.freebsd.org' '$msg_france' 'ftp.fr.freebsd.org' ' $msg_france #3' 'ftp3.fr.freebsd.org' ' $msg_france #4' 'ftp4.fr.freebsd.org' ' $msg_france #5' 'ftp5.fr.freebsd.org' ' $msg_france #6' 'ftp6.fr.freebsd.org' ' $msg_france #7' 'ftp7.fr.freebsd.org' ' $msg_france #8' 'ftp8.fr.freebsd.org' '$msg_germany' 'ftp.de.freebsd.org' ' $msg_germany #2' 'ftp2.de.freebsd.org' ' $msg_germany #4' 'ftp4.de.freebsd.org' ' $msg_germany #5' 'ftp5.de.freebsd.org' ' $msg_germany #6' 'ftp6.de.freebsd.org' ' $msg_germany #7' 'ftp7.de.freebsd.org' ' $msg_germany #8' 'ftp8.de.freebsd.org' '$msg_greece' 'ftp.gr.freebsd.org' ' $msg_greece #2' 'ftp2.gr.freebsd.org' '$msg_iceland' 'ftp.is.freebsd.org' '$msg_ireland' 'ftp3.ie.freebsd.org' '$msg_israel' 'ftp.il.freebsd.org' '$msg_italy' 'ftp.it.freebsd.org' '$msg_japan' 'ftp.jp.freebsd.org' ' $msg_japan #2' 'ftp2.jp.freebsd.org' ' $msg_japan #3' 'ftp3.jp.freebsd.org' ' $msg_japan #4' 'ftp4.jp.freebsd.org' ' $msg_japan #5' 'ftp5.jp.freebsd.org' ' $msg_japan #6' 'ftp6.jp.freebsd.org' ' $msg_japan #7' 'ftp7.jp.freebsd.org' ' $msg_japan #8' 'ftp8.jp.freebsd.org' ' $msg_japan #9' 'ftp9.jp.freebsd.org' '$msg_korea' 'ftp.kr.freebsd.org' ' $msg_korea #2' 'ftp2.kr.freebsd.org' '$msg_latvia' 'ftp.lv.freebsd.org' '$msg_lithuania' 'ftp.lt.freebsd.org' '$msg_netherlands' 'ftp.nl.freebsd.org' ' $msg_netherlands #2' 'ftp2.nl.freebsd.org' '$msg_new_zealand' 'ftp.nz.freebsd.org' '$msg_norway' 'ftp.no.freebsd.org' '$msg_poland' 'ftp.pl.freebsd.org' ' $msg_poland #2' 'ftp2.pl.freebsd.org' '$msg_russia' 'ftp.ru.freebsd.org' ' $msg_russia #2' 'ftp2.ru.freebsd.org' ' $msg_russia #4' 'ftp4.ru.freebsd.org' ' $msg_russia #5' 'ftp5.ru.freebsd.org' ' $msg_russia #6' 'ftp6.ru.freebsd.org' '$msg_slovak_republic' 'ftp.sk.freebsd.org' ' $msg_slovak_republic #2' 'ftp2.sk.freebsd.org' '$msg_slovenia' 'ftp.si.freebsd.org' '$msg_south_africa' 'ftp.za.freebsd.org' ' $msg_south_africa #2' 'ftp2.za.freebsd.org' ' $msg_south_africa #4' 'ftp4.za.freebsd.org' '$msg_spain' 'ftp.es.freebsd.org' ' $msg_spain #3' 'ftp3.es.freebsd.org' '$msg_sweden' 'ftp.se.freebsd.org' ' $msg_sweden #2' 'ftp2.se.freebsd.org' ' $msg_sweden #3' 'ftp3.se.freebsd.org' ' $msg_sweden #4' 'ftp4.se.freebsd.org' ' $msg_sweden #5' 'ftp5.se.freebsd.org' ' $msg_sweden #6' 'ftp6.se.freebsd.org' '$msg_switzerland' 'ftp.ch.freebsd.org' '$msg_taiwan' 'ftp.tw.freebsd.org' ' $msg_taiwan #2' 'ftp2.tw.freebsd.org' ' $msg_taiwan #3' 'ftp3.tw.freebsd.org' ' $msg_taiwan #4' 'ftp4.tw.freebsd.org' ' $msg_taiwan #6' 'ftp6.tw.freebsd.org' ' $msg_taiwan #11' 'ftp11.tw.freebsd.org' - '$msg_turkey' 'ftp2.tr.freebsd.org' '$msg_uk' 'ftp.uk.freebsd.org' ' $msg_uk #2' 'ftp2.uk.freebsd.org' ' $msg_uk #3' 'ftp3.uk.freebsd.org' ' $msg_uk #4' 'ftp4.uk.freebsd.org' ' $msg_uk #5' 'ftp5.uk.freebsd.org' '$msg_ukraine' 'ftp.ua.freebsd.org' ' $msg_ukraine #7' 'ftp7.ua.freebsd.org' '$msg_usa #1' 'ftp1.us.freebsd.org' ' $msg_usa #2' 'ftp2.us.freebsd.org' ' $msg_usa #3' 'ftp3.us.freebsd.org' ' $msg_usa #4' 'ftp4.us.freebsd.org' ' $msg_usa #5' 'ftp5.us.freebsd.org' ' $msg_usa #6' 'ftp6.us.freebsd.org' ' $msg_usa #8' 'ftp8.us.freebsd.org' ' $msg_usa #10' 'ftp10.us.freebsd.org' ' $msg_usa #11' 'ftp11.us.freebsd.org' ' $msg_usa #13' 'ftp13.us.freebsd.org' ' $msg_usa #14' 'ftp14.us.freebsd.org' ' $msg_usa #15' 'ftp15.us.freebsd.org' " # END-QUOTE local hline="$msg_select_a_site_thats_close" local height width rows eval f_dialog_menu_size height width rows \ \"\$title\" \ \"\$btitle\" \ \"\$prompt\" \ \"\$hline\" \ $menu_list local mtag mtag=$( eval $DIALOG \ --title \"\$title\" \ --backtitle \"\$btitle\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" \ $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || return $FAILURE f_dialog_data_sanitize mtag case "$mtag" in URL) setvar $VAR_FTP_PATH "other" ;; *) local value value=$( eval f_dialog_menutag2item \"\$mtag\" $menu_list ) setvar $VAR_FTP_PATH "ftp://$value" esac return $SUCCESS } # f_media_set_ftp # # Return success if we both found and set the media type to be an FTP server. # Variables from variable.subr that can be used to script user input: # # VAR_FTP_PATH # Can be a URL (including "ftp://" protocol-prefix) or "other" # (user is prompted to enter FTP URL). If a URL, can optionally # contain directory prefix after hostname/port. Valid examples # include: # ftp://myhost # ftp://somename:21/pub/ # ftp://192.168.2.3/pub/ # ftp://[::1]:21/ # The default port if not specified is 21. # VAR_NAMESERVER [Optional] # If set, overrides resolv.conf(5) and sets the nameserver that # is used to convert names into addresses (when a name converts # into multiple addresses, the first address to successfully # connect is used). # # Meanwhile, the following variables from variable.subr are set after # successful execution: # # VAR_FTP_HOST # The FTP host to connect to, parsed from VAR_FTP_PATH. In the # example case of IPv6 where VAR_FTP_PATH is "ftp://[::1]", this # variable will be set to "::1" (the outer brackets are removed). # VAR_FTP_PORT # The TCP port to connect to, parsed from VAR_FTP_PATH. Usually # 21 unless VAR_FTP_PATH was of one of the following forms: # ftp://hostname:OTHER_PORT # ftp://hostname:OTHER_PORT/* # ftp://ip:OTHER_PORT # ftp://ip:OTHER_PORT/* # ftp://[ip6]:OTHER_PORT # ftp://[ip6]:OTHER_PORT/* # VAR_FTP_DIR # If VAR_FTP_PATH contained a directory element (e.g., # "ftp://localhost/pub") this variable contains only the # directory element (e.g., "/pub"). # f_media_set_ftp() { f_media_close local url f_getvar $VAR_FTP_PATH url # If we've been through here before ... if f_struct device_network && [ "${url#$msg_other}" ]; then f_dialog_yesno "$msg_reuse_old_ftp_site_selection_values" || url= fi if [ ! "$url" ]; then f_dialog_menu_media_ftp || return $FAILURE f_getvar $VAR_FTP_PATH url fi [ "$url" ] || return $FAILURE case "$url" in other) setvar $VAR_FTP_PATH "ftp://" f_variable_get_value $VAR_FTP_PATH \ "$msg_please_specify_url_of_a_freebsd_distribution" f_getvar $VAR_FTP_PATH url if [ ! "${url#ftp://}" ]; then unset $VAR_FTP_PATH return $FAILURE fi if [ ${#url} -gt ${URL_MAX:-261261} ]; then f_show_msg "$msg_length_of_specified_url_is_too_long" \ ${#url} ${URL_MAX:-261261} unset $VAR_FTP_PATH return $FAILURE fi case "$url" in ftp://*) : valid URL ;; *) f_show_msg "$msg_sorry_invalid_url" "$url" unset $VAR_FTP_PATH return $FAILURE esac esac case "$url" in ftp://*) : valid URL ;; *) f_show_msg "$msg_sorry_invalid_url" "$url" unset $VAR_FTP_PATH return $FAILURE esac # Set the name of the FTP device to the URL f_struct_new DEVICE device_ftp device_ftp set name "$url" if ! f_struct device_network || ! f_dialog_yesno "$msg_youve_already_done_the_network_configuration" then f_struct device_network && f_device_shutdown network if ! f_device_select_tcp; then unset $VAR_FTP_PATH return $FAILURE fi local dev f_getvar $VAR_NETWORK_DEVICE dev f_struct_copy "device_$dev" device_network fi if ! f_device_init network; then f_dprintf "f_media_set_ftp: %s" "$msg_net_device_init_failed" unset $VAR_FTP_PATH return $FAILURE fi local hostname="${url#*://}" port=21 dir=/ case "$hostname" in # # The order in-which the below individual cases appear is important! # "["*"]":*/*) # IPv6 address with port and directory f_dprintf "Looks like an IPv6 addr with port/dir: %s" \ "$hostname" hostname="${hostname#\[}" port="${hostname#*\]:}" port="${port%%[!0-9]*}" dir="/${hostname#*/}" hostname="${hostname%%\]:*}" ;; "["*"]":*) # IPv6 address with port f_dprintf "Looks like an IPv6 addr with port: %s" "$hostname" hostname="${hostname#\[}" port="${hostname#*\]:}" port="${port%%[!0-9]*}" hostname="${hostname%%\]:*}" ;; "["*"]"/*) # IPv6 address with directory f_dprintf "Looks like an IPv6 addr with dir: %s" "$hostname" hostname="${hostname#\[}" dir="/${hostname#*/}" hostname="${hostname%%\]*}" ;; "["*"]") # IPv6 address f_dprintf "Looks like an IPv6 addr: %s" "$hostname" hostname="${hostname#\[}" hostname="${hostname%\]}" ;; # # ^^^ IPv6 above / DNS Name or IPv4 below vvv # *:*/*) # DNS name or IPv4 address with port and directory f_dprintf "Looks like a %s with port/dir: %s" \ "DNS name or IPv4 addr" "$hostname" port="${hostname#*:}" port="${port%%[!0-9]*}" dir="/${hostname#*/}" hostname="${hostname%%:*}" ;; *:*) # DNS name or IPv4 address with port f_dprintf "Looks like a DNS name or IPv4 addr with port: %s" \ "$hostname" port="${hostname#*:}" hostname="${hostname%%:*}" ;; */*) # DNS name or IPv4 address with directory f_dprintf "Looks like a DNS name or IPv4 addr with dir: %s" \ "$hostname" dir="/${hostname#*/}" hostname="${hostname%%/*}" ;; *) # DNS name or IPv4 address f_dprintf "Looks like a DNS name or IPv4 addr: %s" "$hostname" : leave hostname as-is esac f_dprintf "hostname = \`%s'" "$hostname" f_dprintf "dir = \`%s'" "$dir" f_dprintf "port \# = \`%d'" "$port" local ns f_getvar $VAR_NAMESERVER ns [ "$ns" ] || f_resolv_conf_nameservers ns if [ "$ns" -a ! "$FTP_SKIP_RESOLV" ] && ! { f_validate_ipaddr "$hostname" || f_validate_ipaddr6 "$hostname" }; then f_show_info "$msg_looking_up_host" "$hostname" f_dprintf "%s: Looking up hostname, %s, using host(1)" \ "f_media_set_ftp" "$hostname" if ! f_quietly f_host_lookup "$hostname"; then f_show_msg "$msg_cannot_resolve_hostname" "$hostname" f_struct device_network && f_device_shutdown network f_struct_free device_network unset $VAR_FTP_PATH return $FAILURE fi f_dprintf "Found DNS entry for %s successfully." "$hostname" fi setvar $VAR_FTP_HOST "$hostname" setvar $VAR_FTP_PORT "$port" setvar $VAR_FTP_DIR "$dir" device_ftp set type $DEVICE_TYPE_FTP device_ftp set init f_media_init_ftp device_ftp set get f_media_get_ftp device_ftp set shutdown f_media_shutdown_ftp device_ftp set private network f_struct_copy device_ftp device_media f_struct_free device_ftp return $SUCCESS } # f_media_set_ftp_active # # Wrapper to f_media_set_ftp to access FTP servers actively. # f_media_set_ftp_active() { setvar $VAR_FTP_STATE "active" f_media_set_ftp } # f_media_set_ftp_passive # # Wrapper to f_media_set_ftp to access FTP servers passively. # f_media_set_ftp_passive() { setvar $VAR_FTP_STATE "passive" f_media_set_ftp } # f_media_set_ftp_userpass # # Prompt the user to enter/confirm the username/password variables that will # be used to communicate with the FTP servers. Returns success if the user does # not cancel or press Esc to either username or password. # # Variables from variable.subr that can be used to script user input: # # VAR_FTP_USER # The username to send via ftp(1) when connecting to an FTP # server. # VAR_FTP_PASS # The password to send with the above username. # # Does not prompt for confirmation of values if VAR_NONINTERACTIVE is set (see # variable.subr for more information). # f_media_set_ftp_userpass() { local user pass f_variable_get_value $VAR_FTP_USER \ "$msg_please_enter_the_username_you_wish_to_login_as" f_getvar $VAR_FTP_USER user if [ "$user" ]; then f_variable_get_value $VAR_FTP_PASS \ "$msg_please_enter_the_password_for_this_user" f_getvar $VAR_FTP_PASS pass else pass= fi [ "$pass" ] # Return status } # f_device_network_up $device # # Brings up attached network device, if any - takes FTP device as arg. # f_device_network_up() { local dev="$1" netDev f_struct device_$dev || return $FAILURE device_$dev get private netDev || return $SUCCESS # No net == happy net f_device_init $netDev } # f_device_network_down $device # # Brings down attached network device, if any - takes FTP device as arg. # f_device_network_down() { local dev="$1" netDev f_struct device_$dev || return $FAILURE device_$dev get private netDev || return $SUCCESS f_device_shutdown $netDev } # f_media_init_ftp $device # # Initializes the FTP media device. Returns success if both able to log into # the FTP server and confirm the existence of at least one known release path # using ftp(1). # # Variables from variable.subr used to initialize the connection are as follows # (all of which are configured by f_media_set_ftp above): # # VAR_FTP_PATH # The unparsed FTP URL representing the server to contact. # Usually "ftp://server" for example. Can contain TCP port number # and/or directory path (but should not contain username/password # info). # VAR_FTP_HOST # The FTP host to connect to. Can be an IPv4 address (e.g., # 127.0.0.1), IPv6 address (e.g., ::1), or DNS hostname. Usually # set automatically in f_media_set_ftp() by parsing VAR_FTP_PATH. # VAR_FTP_PORT # The TCP port to connect to. Usually set automatically in # f_media_set_ftp() by parsing VAR_FTP_PATH. # VAR_FTP_DIR # The base FTP directory to use when downloading files from the # FTP server. Usually set automatically in f_media_set_ftp() by # parsing VAR_FTP_PATH. # VAR_FTP_USER [Optional] # If unset, defaults to using anonymous access. # VAR_FTP_PASS [Optional] # If unset, defaults to a sensible value. # # In addition, the following (managed either manually or by f_media_set_ftp_*): # # VAR_FTP_STATE # Sets FTPMODE for ftp(1) and can be one of: # active active mode FTP only # auto automatic determination of passive or active # (this is the default) # gate gate-ftp mode # passive passive mode FTP only # See ftp(1) for additional information. # # And last, but not least (managed automatically or manually): # # VAR_RELNAME # Defaults to being set to $(uname -r) but can be overridden. # This sets the name of a release to look for as part of a well # known set of paths to search for release data once connected # via FTP. If set to "__RELEASE" or "any" then the VAR_FTP_DIR is # taken as the absolute path to the release and no further # searching is done (see FTP_DIRS above in the GLOBALS section # for a list of well known paths that are used when searching for # a VAR_RELNAME sub-directory). # f_media_init_ftp() { local dev="$1" local url device_$dev get name url f_dprintf "Init routine called for FTP device. url=[%s]" "$url" if [ "$FTP_INITIALIZED" ]; then f_dprintf "FTP device already initialized." return $SUCCESS fi # If we can't initialize the network, bag it! f_device_network_up $dev || return $FAILURE local cp while :; do f_getvar $VAR_FTP_PATH cp if [ ! "$cp" ]; then if ! f_media_set_ftp || ! f_getvar $VAR_FTP_PATH cp || [ ! "$cp" ] then f_show_msg "$msg_unable_to_get_proper_ftp_path" f_device_network_down $dev return $FAILURE fi fi local ftp_host ftp_dir if ! { f_getvar $VAR_FTP_HOST ftp_host && f_getvar $VAR_FTP_DIR ftp_dir }; then f_show_msg "$msg_missing_ftp_host_or_directory" f_device_network_down $dev return $FAILURE fi local ftp_port f_getvar $VAR_FTP_PORT ftp_port local host="$ftp_host" port="${ftp_port:+:$ftp_port}" case "$host" in *:*) host="[$host]"; esac local user pass use_anon= f_getvar $VAR_FTP_USER user if [ ! "$user" ]; then user="anonymous" use_anon=1 fi if ! f_getvar $VAR_FTP_PASS pass; then f_getvar $VAR_HOSTNAME cp if f_running_as_init; then pass="installer@$cp" else local name="$( id -un 2> /dev/null )" pass="${name:-ftp}@$cp" fi fi f_show_info "$msg_logging_in_to_user_at_host" \ "$user" "$ftp_host" local userpass="" if [ ! "$use_anon" ] && [ "$user" -o "$pass" ]; then userpass="$user${pass:+:$( f_uriencode "$pass" )}" userpass="$userpass${userpass:+@}" fi local mode rx f_getvar $VAR_FTP_STATE mode if [ "$ftp_dir" ]; then if ! rx=$( printf 'cd "%s"\npwd\n' "$ftp_dir" | eval \ FTPMODE=\"\$mode\" \ ${use_anon:+FTPANONPASS=\"\$pass\"} \ ftp -V ${use_anon:+-a} \ \"ftp://\$userpass\$host\$port\" \ 2>&1 ); then f_show_msg "$msg_couldnt_open_ftp_connection" \ "$ftp_host" "$rx" break # to failure fi if echo "$rx" | awk -v dir="/${ftp_dir#/}" ' BEGIN { found = 0 if ( dir != "/" ) sub("/$", "", dir) } /^Remote directory: / { sub(/^[^:]*:[[:space:]]*/, "") if ($0 != dir) next found = 1; exit } END { exit ! found } '; then setvar $VAR_FTP_DIR "$ftp_dir" setvar $VAR_FTP_PATH \ "ftp://$ftp_host/${ftp_dir#/}" else f_show_msg \ "$msg_please_check_the_url_and_try_again" \ "ftp://$ftp_host/${ftp_dir#/}" break # to failure fi fi # # Now that we've verified that the path we're given is ok, # let's try to be a bit intelligent in locating the release we # are looking for. First off, if the release is specified as # "__RELEASE" or "any", then just assume that the current # directory is the one we want and give up. # local rel f_getvar $VAR_RELNAME rel f_dprintf "f_media_init_ftp: rel=[%s]" "$rel" case "$rel" in __RELEASE|any) FTP_INITIALIZED=YES return $SUCCESS ;; *) # # Ok, since we have a release variable, let's walk # through the list of directories looking for a release # directory. First successful CWD wins. # if ! rx=$( for dir in $FTP_DIRS; do # Avoid confusing some servers [ "$dir" = "." ] && continue printf 'cd "/%s/%s"\npwd\n' \ "$dir" "$rel" done | eval \ FTPMODE=\"\$mode\" \ ${use_anon:+FTPANONPASS=\"\$pass\"} \ ftp -V ${use_anon:+-a} \ \"ftp://\$userpass\$host\$port\" \ 2>&1 ); then f_show_msg "$msg_couldnt_open_ftp_connection" \ "$ftp_host" "$rx" break # to failure fi local fdir if fdir=$( echo "$rx" | awk ' BEGIN { found = 0 } /^Remote directory: / { sub(/^[^:]*:[[:space:]]*/, "") if ($0 == "/") next # Exit after the first dir found++; print; exit } END { exit ! found } ' ); then setvar $VAR_FTP_DIR "$fdir" setvar $VAR_FTP_PATH "ftp://$ftp_host$fdir" FTP_INITIALIZED=YES return $SUCCESS else f_yesno "$msg_cant_find_distribution" \ "$rel" "$ftp_host" if [ $? -eq $SUCCESS ]; then unset $VAR_FTP_PATH f_media_set_ftp && continue fi fi esac break # to failure done unset FTP_INITIALIZED $VAR_FTP_PATH f_device_network_down $dev return $FAILURE } # f_media_get_ftp $device $file [$probe_type] # # Returns data from $file on an FTP server using ftp(1). Please note that # $device is unused but must be present (even if null). Information is instead # gathered from the environment. If $probe_type is present and non-NULL, # returns success if $file exists. If $probe_type is equal to $PROBE_SIZE, # prints the size of $file in bytes to standard-out. # # Variables from variable.subr used to configure the connection are as follows # (all of which are configured by f_media_set_ftp above): # # VAR_FTP_HOST # FTP host to connect to. Can be an IPv4 address, IPv6 address, # or DNS hostname of your choice. # VAR_FTP_PORT # TCP port to connect on; see f_media_set_ftp() above. # VAR_FTP_USER [Optional] # If unset, defaults to using anonymous access. # VAR_FTP_PASS [Optional] # If unset, defaults to a sensible value. # # In addition, the following (managed either manually or by f_media_set_ftp_*): # # VAR_FTP_STATE # Sets FTPMODE for ftp(1) and can be one of: # active active mode FTP only # auto automatic determination of passive or active # (this is the default) # gate gate-ftp mode # passive passive mode FTP only # See ftp(1) for additional information. # # See variable.subr for additional information. # # Example usage: # f_media_set_ftp # f_media_get_ftp media $file # f_media_get_ftp() { local dev="$1" file="$2" probe_type="$3" hosts= f_dprintf "f_media_get_ftp: dev=[%s] file=[%s] probe_type=%s" \ "$dev" "$file" "$probe_type" local ftp_host ftp_port f_getvar $VAR_FTP_HOST ftp_host f_getvar $VAR_FTP_PORT ftp_port if [ ! "$FTP_INITIALIZED" ]; then f_dprintf "No FTP connection open, can't get file %s" "$file" return $FAILURE fi if ! { f_validate_ipaddr "$ftp_host" || f_validate_ipaddr6 "$ftp_host" || { f_dprintf "%s: Looking up hostname, %s, using host(1)" \ "f_media_get_ftp" "$ftp_host" f_host_lookup "$ftp_host" hosts } }; then # All the above validations failed [ "$hosts" ] && f_dialog_msgbox "$hosts" return $FAILURE elif [ ! "$hosts" ]; then # One of the first two validations passed hosts="$ftp_host" fi local host connected= for host in $hosts; do f_quietly nc -nz "$host" "$ftp_port" || continue connected=1; break done if [ ! "$connected" ]; then f_show_msg "$msg_couldnt_connect_to_ftp_server %s:%s" \ "$ftp_host" "$ftp_port" return $FAILURE fi local user pass use_anon= f_getvar $VAR_FTP_USER user if [ ! "$user" ]; then user="anonymous" use_anon=1 fi if ! f_getvar $VAR_FTP_PASS pass; then f_getvar $VAR_HOSTNAME cp if f_running_as_init; then pass="installer@$cp" else local name="$( id -un 2> /dev/null )" pass="${name:-ftp}@$cp" fi fi local userpass="" if [ ! "$use_anon" ] && [ "$user" -o "$pass" ]; then userpass="$user${pass:+:$( f_uriencode "$pass" )}" userpass="$userpass${userpass:+@}" fi local dir mode rx f_getvar $VAR_FTP_DIR\#/ dir f_getvar $VAR_FTP_STATE mode local port="${ftp_port:+:$ftp_port}" case "$host" in *:*) host="[$host]"; esac f_dprintf "sending ftp request for: %s" "ftp://$host$port/$dir/$file" if [ "$probe_type" ]; then local url="ftp://$userpass$host$port/$dir/$file" size [ "$use_anon" ] && url="ftp://$host$port/$dir/$file" if ! size=$( fetch -s "$url" 2>&1 ) || ! f_isinteger "$size" then f_dprintf "request failed! size response=[%s]" "$size" [ "$probe_type" = "$PROBE_SIZE" ] && echo "-1" return $FAILURE fi [ "$probe_type" = "$PROBE_SIZE" ] && echo "$size" return $SUCCESS fi eval FTPMODE=\"\$mode\" ${use_anon:+FTPANONPASS=\"\$pass\"} \ ftp -V ${use_anon:+-a} -o - \ \"ftp://\$userpass\$host\$port/\$dir/\$file\" 2> /dev/null local retval=$? [ $retval -eq $SUCCESS ] || f_dprintf "request failed!" return $retval } # f_media_shutdown_ftp $device # # Shuts down the FTP device. Return status should be ignored. Note that since # we don't maintain an open connection to the FTP server there's nothing to do. # f_media_shutdown_ftp() { [ "$FTP_INITIALIZED" ] || return $SUCCESS unset FTP_INITIALIZED } ############################################################ MAIN f_dprintf "%s: Successfully loaded." media/ftp.subr fi # ! $_MEDIA_FTP_SUBR diff --git a/usr.sbin/bsdinstall/scripts/mirrorselect b/usr.sbin/bsdinstall/scripts/mirrorselect index b8f7a2c5c80a..aa6c97279aa9 100755 --- a/usr.sbin/bsdinstall/scripts/mirrorselect +++ b/usr.sbin/bsdinstall/scripts/mirrorselect @@ -1,195 +1,194 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ : ${DIALOG_OK=0} : ${DIALOG_CANCEL=1} : ${DIALOG_HELP=2} : ${DIALOG_EXTRA=3} : ${DIALOG_ITEM_HELP=4} : ${DIALOG_ESC=255} exec 3>&1 MIRROR=`dialog --backtitle "FreeBSD Installer" \ --title "Mirror Selection" --extra-button --extra-label "Other" \ --menu "Please select the site closest to you or \"other\" if you'd like to specify a different choice. Also note that not every site listed here carries more than the base distribution kits. Only Primary sites are guaranteed to carry the full range of possible distributions. Select a site that's close!" \ 0 0 0 \ ftp://ftp.freebsd.org "Main Site"\ ftp://ftp.freebsd.org "IPv6 Main Site"\ ftp://ftp3.ie.freebsd.org "IPv6 Ireland"\ ftp://ftp2.jp.freebsd.org "IPv6 Japan"\ ftp://ftp4.se.freebsd.org "IPv6 Sweden"\ ftp://ftp4.us.freebsd.org "IPv6 USA"\ ftp://ftp2.tr.freebsd.org "IPv6 Turkey"\ ftp://ftp1.freebsd.org "Primary"\ ftp://ftp2.freebsd.org "Primary #2"\ ftp://ftp3.freebsd.org "Primary #3"\ ftp://ftp4.freebsd.org "Primary #4"\ ftp://ftp5.freebsd.org "Primary #5"\ ftp://ftp6.freebsd.org "Primary #6"\ ftp://ftp7.freebsd.org "Primary #7"\ ftp://ftp10.freebsd.org "Primary #10"\ ftp://ftp11.freebsd.org "Primary #11"\ ftp://ftp12.freebsd.org "Primary #12"\ ftp://ftp13.freebsd.org "Primary #13"\ ftp://ftp14.freebsd.org "Primary #14"\ ftp://ftp1.am.freebsd.org "Armenia"\ ftp://ftp.au.freebsd.org "Australia"\ ftp://ftp2.au.freebsd.org "Australia #2"\ ftp://ftp3.au.freebsd.org "Australia #3"\ ftp://ftp.at.freebsd.org "Austria"\ ftp://ftp2.br.freebsd.org "Brazil #2"\ ftp://ftp3.br.freebsd.org "Brazil #3"\ ftp://ftp4.br.freebsd.org "Brazil #4"\ ftp://ftp.ca.freebsd.org "Canada"\ ftp://ftp.cn.freebsd.org "China"\ ftp://ftp.cz.freebsd.org "Czech Republic"\ ftp://ftp.dk.freebsd.org "Denmark"\ ftp://ftp.ee.freebsd.org "Estonia"\ ftp://ftp.fi.freebsd.org "Finland"\ ftp://ftp.fr.freebsd.org "France"\ ftp://ftp3.fr.freebsd.org "France #3"\ ftp://ftp4.fr.freebsd.org "IPv6 France #4"\ ftp://ftp5.fr.freebsd.org "France #5"\ ftp://ftp6.fr.freebsd.org "France #6"\ ftp://ftp7.fr.freebsd.org "France #7"\ ftp://ftp8.fr.freebsd.org "IPv6 France #8"\ ftp://ftp.de.freebsd.org "Germany"\ ftp://ftp2.de.freebsd.org "Germany #2"\ ftp://ftp4.de.freebsd.org "Germany #4"\ ftp://ftp5.de.freebsd.org "Germany #5"\ ftp://ftp6.de.freebsd.org "Germany #6"\ ftp://ftp7.de.freebsd.org "Germany #7"\ ftp://ftp8.de.freebsd.org "Germany #8"\ ftp://ftp.gr.freebsd.org "Greece"\ ftp://ftp2.gr.freebsd.org "Greece #2"\ ftp://ftp.is.freebsd.org "Iceland"\ ftp://ftp3.ie.freebsd.org "Ireland #3"\ ftp://ftp.il.freebsd.org "Israel"\ ftp://ftp.it.freebsd.org "Italy"\ ftp://ftp.jp.freebsd.org "Japan"\ ftp://ftp2.jp.freebsd.org "Japan #2"\ ftp://ftp3.jp.freebsd.org "Japan #3"\ ftp://ftp4.jp.freebsd.org "Japan #4"\ ftp://ftp5.jp.freebsd.org "Japan #5"\ ftp://ftp6.jp.freebsd.org "Japan #6"\ ftp://ftp7.jp.freebsd.org "Japan #7"\ ftp://ftp8.jp.freebsd.org "Japan #8"\ ftp://ftp9.jp.freebsd.org "Japan #9"\ ftp://ftp.kr.freebsd.org "Korea"\ ftp://ftp2.kr.freebsd.org "Korea #2"\ ftp://ftp.lv.freebsd.org "Latvia"\ ftp://ftp.lt.freebsd.org "Lithuania"\ ftp://ftp.nl.freebsd.org "Netherlands"\ ftp://ftp2.nl.freebsd.org "Netherlands #2"\ ftp://ftp.nz.freebsd.org "New Zealand"\ ftp://ftp.no.freebsd.org "Norway"\ ftp://ftp.pl.freebsd.org "Poland"\ ftp://ftp2.pl.freebsd.org "Poland #2"\ ftp://ftp.ru.freebsd.org "Russia"\ ftp://ftp2.ru.freebsd.org "Russia #2"\ ftp://ftp4.ru.freebsd.org "Russia #4"\ ftp://ftp5.ru.freebsd.org "Russia #5"\ ftp://ftp6.ru.freebsd.org "Russia #6"\ ftp://ftp.sk.freebsd.org "Slovak Republic"\ ftp://ftp2.sk.freebsd.org "Slovak Republic #2"\ ftp://ftp.si.freebsd.org "Slovenia"\ ftp://ftp.za.freebsd.org "South Africa"\ ftp://ftp2.za.freebsd.org "South Africa #2"\ ftp://ftp4.za.freebsd.org "South Africa #4"\ ftp://ftp.es.freebsd.org "Spain"\ ftp://ftp3.es.freebsd.org "Spain #3"\ ftp://ftp.se.freebsd.org "Sweden"\ ftp://ftp2.se.freebsd.org "Sweden #2"\ ftp://ftp3.se.freebsd.org "Sweden #3"\ ftp://ftp4.se.freebsd.org "Sweden #4"\ ftp://ftp5.se.freebsd.org "Sweden #5"\ ftp://ftp6.se.freebsd.org "Sweden #6"\ ftp://ftp.ch.freebsd.org "Switzerland"\ ftp://ftp.tw.freebsd.org "Taiwan"\ ftp://ftp2.tw.freebsd.org "Taiwan #2"\ ftp://ftp3.tw.freebsd.org "Taiwan #3"\ ftp://ftp4.tw.freebsd.org "Taiwan #4"\ ftp://ftp6.tw.freebsd.org "Taiwan #6"\ ftp://ftp11.tw.freebsd.org "Taiwan #11"\ - ftp://ftp2.tr.freebsd.org "Turkey #2"\ ftp://ftp.uk.freebsd.org "UK"\ ftp://ftp2.uk.freebsd.org "UK #2"\ ftp://ftp3.uk.freebsd.org "UK #3"\ ftp://ftp4.uk.freebsd.org "UK #4"\ ftp://ftp5.uk.freebsd.org "UK #5"\ ftp://ftp.ua.freebsd.org "Ukraine"\ ftp://ftp7.ua.freebsd.org "Ukraine #7"\ ftp://ftp1.us.freebsd.org "USA #1"\ ftp://ftp2.us.freebsd.org "USA #2"\ ftp://ftp3.us.freebsd.org "USA #3"\ ftp://ftp4.us.freebsd.org "USA #4"\ ftp://ftp5.us.freebsd.org "USA #5"\ ftp://ftp6.us.freebsd.org "USA #6"\ ftp://ftp8.us.freebsd.org "USA #8"\ ftp://ftp10.us.freebsd.org "USA #10"\ ftp://ftp11.us.freebsd.org "USA #11"\ ftp://ftp13.us.freebsd.org "USA #13"\ ftp://ftp14.us.freebsd.org "USA #14"\ ftp://ftp15.us.freebsd.org "USA #15"\ 2>&1 1>&3` MIRROR_BUTTON=$? exec 3>&- _UNAME_R=`uname -r` case ${_UNAME_R} in *-CURRENT|*-STABLE|*-BETA*|*-PRERELEASE|*-RC*) RELDIR="snapshots" ;; *) RELDIR="releases" ;; esac BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/${RELDIR}/`uname -m`/`uname -p`/${_UNAME_R}" case $MIRROR_BUTTON in $DIALOG_CANCEL) exit 1 ;; $DIALOG_OK) ;; $DIALOG_EXTRA) exec 3>&1 BSDINSTALL_DISTSITE=`dialog --backtitle "FreeBSD Installer" \ --title "Mirror Selection" \ --inputbox "Please enter the URL to an alternate FreeBSD mirror:" \ 0 0 "$BSDINSTALL_DISTSITE" 2>&1 1>&3` MIRROR_BUTTON=$? exec 3>&- test $MIRROR_BUTTON -eq 0 || exec $0 $@ ;; esac export BSDINSTALL_DISTSITE echo $BSDINSTALL_DISTSITE >&2