From nobody Thu Oct 05 11:10:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S1TPJ2lz4z4wLGZ; Thu, 5 Oct 2023 11:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S1TPJ2Wngz3Tmc; Thu, 5 Oct 2023 11:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696504228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VDBZgzeua14uHlW6pZSlLlg1NRmzkS6sDQ7U2gnddSE=; b=WWm+BvP0+7xfOGZI0pDZrDl9Bq8j32zt8y67t052VD8IuxM6o5oFa8nGqz5gVF2qq94ILj Mz091HCX5hC/lvdFmihJnNqICzRCzsUIAjWfBokDCPSWyoiP7UXIl+BbwSPElPJHQE8jYe sAjXSXIG8BoeeQXsek71o1h8ZRSzNzqocJcXi2pAoQygaRSTKih8Ek0DnaSWyNrYCAo0oo 4a21s5oDf7XFYE1M5+SyYmjxtckqXlVdNlxTyMTHMXPOHZcnzuPeVj82hVZh4X7nj3XDI5 OdeZZZKSfyP1MECrFPOd4K6WhE1Qr0JSMtdn4oRWJxesT4/KNGbQ1JaCoQR+4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696504228; a=rsa-sha256; cv=none; b=ZF0UWVkVjfTNMsF8xjwfJQTjveZvQ7L3HVWbpZxxhFlp/qU6bU1LBJa5jiKSYaUMzh3UDh uK8CYiWJJRS10R+3imS1pklmxFiwf2HhTO1rRMDobR+KGVEB3lPYbF8Jf9fYrxkZe44ARX U1rV+HIoq42WmxlJf4vRzunxkO7XA1NR4BB5w8LQpq+M4RJMpsyxCvweefWV8k4BtTBVIx GepbMgRI2MMn5t4nNMwoRcs7bnRPDpMNed9rp9E9YeMkv2raA9YaiGkpR3F89U36tTlvWs 9NVyjd06/hHr0iU1wuJT/VN5G2yHkP46ghKgxxV5ehPEt2HjaOV2Ziv4zDQLOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696504228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VDBZgzeua14uHlW6pZSlLlg1NRmzkS6sDQ7U2gnddSE=; b=X/ZCbDZK5JKxDUOymI4dDZbBWLzeLx+mh2Fva3Q4VBNz0ZDBzrFbxGXaTfHGvSjAFMInA6 NOdNLhYiLVafHfXmB2RgrqoKUvKre0HAKwJ8OOqlmTGlolNmm1PxXSCaB6UA0Dk+1pn+NR zlVFGc72gtusMaJ6xb4Jec8Calx1Gwqe1m/ecg1aFIdufjHlrvDRWVJhbvv3A/kr9XQsiW 51YHeziuLmd71NRQ4JilXmTCcsVLpVbQ5M35aL1/XUAK+ZsR4SozuL5p6rFIzlMib/ZsiO 4BNLUBoOQltJrN1IavqiqkiGxEHY7Nggk3HhnJHorE0vLpLn8+VyxO7Vs3ElmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S1TPJ1bD3z1HFd; Thu, 5 Oct 2023 11:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 395BAS8x070925; Thu, 5 Oct 2023 11:10:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 395BASgZ070922; Thu, 5 Oct 2023 11:10:28 GMT (envelope-from git) Date: Thu, 5 Oct 2023 11:10:28 GMT Message-Id: <202310051110.395BASgZ070922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 77e93191b92e - main - bsdconfig: drop support for floppies List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77e93191b92eed7842f56154eed1d1d0519dd65c Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=77e93191b92eed7842f56154eed1d1d0519dd65c commit 77e93191b92eed7842f56154eed1d1d0519dd65c Author: Baptiste Daroussin AuthorDate: 2023-10-05 08:37:39 +0000 Commit: Baptiste Daroussin CommitDate: 2023-10-05 11:09:54 +0000 bsdconfig: drop support for floppies Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D42083 --- usr.sbin/bsdconfig/include/media.hlp | 7 - usr.sbin/bsdconfig/include/messages.subr | 9 -- usr.sbin/bsdconfig/include/options.hlp | 4 +- usr.sbin/bsdconfig/share/device.subr | 14 +- usr.sbin/bsdconfig/share/media/Makefile | 2 +- usr.sbin/bsdconfig/share/media/any.subr | 3 - usr.sbin/bsdconfig/share/media/floppy.subr | 228 --------------------------- usr.sbin/bsdconfig/share/media/options.subr | 1 - usr.sbin/bsdconfig/share/packages/index.subr | 2 - usr.sbin/bsdconfig/share/script.subr | 1 - 10 files changed, 3 insertions(+), 268 deletions(-) diff --git a/usr.sbin/bsdconfig/include/media.hlp b/usr.sbin/bsdconfig/include/media.hlp index 6fd609473810..1f07789ec0a4 100644 --- a/usr.sbin/bsdconfig/include/media.hlp +++ b/usr.sbin/bsdconfig/include/media.hlp @@ -16,13 +16,6 @@ You can install from the following types of media: get the distribution files from there. - Floppy Get distribution files from one or more DOS or UFS - formatted floppies. Such floppies are assumed to - contain the appropriate distribution pieces - see - ABOUT.TXT for more information about making floppy - distribution media. - - FTP Get the distribution files from an anonymous ftp server (you will be presented with a list). Please note that you may invoke FTP in "Active"/"Passive" auto-mode, or diff --git a/usr.sbin/bsdconfig/include/messages.subr b/usr.sbin/bsdconfig/include/messages.subr index 63c8f4925c0f..b9ddd8e2f466 100644 --- a/usr.sbin/bsdconfig/include/messages.subr +++ b/usr.sbin/bsdconfig/include/messages.subr @@ -77,7 +77,6 @@ msg_checking_access_to="Checking access to\n %s" 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" @@ -129,7 +128,6 @@ msg_enter_a_fully_qualified_pathname_for_the_directory="Enter a fully qualified 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" @@ -141,7 +139,6 @@ msg_failed_to_reach_wpa_supplicant="Failed to reach wpa_supplicant: %s" msg_file_system="File System" msg_finance_desc="Monetary, financial and related applications." msg_finland="Finland" -msg_floppy="Floppy" msg_forget_all="Forget All" msg_forget_all_confirm="WARNING! Are you really sure you want to forget all known networks\nby re-initializing wpa_supplicant.conf(5)? This cannot be undone." msg_forget_all_help="Reset wpa_supplicant(8) configuration, forgetting all known networks" @@ -171,7 +168,6 @@ 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" @@ -257,7 +253,6 @@ 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" @@ -297,11 +292,8 @@ msg_please_enter_the_full_nfs_file_specification="Please enter the full NFS file 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." @@ -447,7 +439,6 @@ 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" diff --git a/usr.sbin/bsdconfig/include/options.hlp b/usr.sbin/bsdconfig/include/options.hlp index f47df27a6b88..257c5011fb9e 100644 --- a/usr.sbin/bsdconfig/include/options.hlp +++ b/usr.sbin/bsdconfig/include/options.hlp @@ -85,9 +85,7 @@ Release Name: Which release to attempt to load from installation media. You should only change this option if you're really sure you know what you are doing! This will change the release name used by - bsdconfig when fetching components of any distributions, and - is a useful way of using a more recent installation boot floppy - with an older release (say, on CDROM). + bsdconfig when fetching components of any distributions. Media Type: Which media type is being used. diff --git a/usr.sbin/bsdconfig/share/device.subr b/usr.sbin/bsdconfig/share/device.subr index c60ad303acfc..4ca2a80c69a5 100644 --- a/usr.sbin/bsdconfig/share/device.subr +++ b/usr.sbin/bsdconfig/share/device.subr @@ -77,7 +77,6 @@ f_struct_define DEVICE_INFO \ setvar DEVICE_TYPE_ANY "any" # Any setvar DEVICE_TYPE_NONE "NONE" # Unknown setvar DEVICE_TYPE_DISK "DISK" # GEOM `DISK' -setvar DEVICE_TYPE_FLOPPY "FD" # GEOM `FD' setvar DEVICE_TYPE_FTP "FTP" # Dynamic network device setvar DEVICE_TYPE_NETWORK "NETWORK" # See f_device_get_all_network setvar DEVICE_TYPE_CDROM "CDROM" # GEOM `DISK' @@ -440,14 +439,6 @@ f_device_probe_geom() return $retval ;; - $GEOM_CLASS_FD) - f_dprintf "Found floppy device named %s" "$devname" - debug= f_device_register device "$devname" "$desc" \ - "/dev/$devname" $DEVICE_TYPE_FLOPPY 1 \ - f_media_init_floppy f_media_get_floppy \ - f_media_shutdown_floppy "" "$capacity" - return $? - ;; $GEOM_CLASS_LABEL) : fall through to below section # reduces indentation level ;; @@ -936,7 +927,6 @@ f_device_desc() case "$__type" in $DEVICE_TYPE_CDROM) __cp="" ;; $DEVICE_TYPE_DISK) __cp="" ;; - $DEVICE_TYPE_FLOPPY) __cp="" ;; $DEVICE_TYPE_USB) __cp="" ;; $DEVICE_TYPE_NETWORK) __cp="" ;; *) @@ -1247,7 +1237,6 @@ f_device_menu() # f_cdrom() { f_device_catalog_set $DEVICE_TYPE_CDROM "$1" "$2"; } f_disk() { f_device_catalog_set $DEVICE_TYPE_DISK "$1" "$2"; } -f_floppy() { f_device_catalog_set $DEVICE_TYPE_FLOPPY "$1" "$2"; } f_usb() { f_device_catalog_set $DEVICE_TYPE_USB "$1" "$2"; } f_network() { f_device_catalog_set $DEVICE_TYPE_NETWORK "$1" "$2"; } @@ -1262,7 +1251,7 @@ f_network() { f_device_catalog_set $DEVICE_TYPE_NETWORK "$1" "$2"; } DEVICE_CATALOG_APPEND_ONLY=1 # Make initial loading faster -# CDROM, Disk, Floppy, and USB devices/names +# CDROM, Disk, and USB devices/names f_cdrom "cd%d" "SCSI CDROM drive" f_cdrom "mcd%d" "Mitsumi (old model) CDROM drive" f_cdrom "scd%d" "Sony CDROM drive - CDU31/33A type" @@ -1277,7 +1266,6 @@ f_disk "mfid%d" "LSI MegaRAID SAS array" f_disk "mlxd%d" "Mylex RAID disk" f_disk "twed%d" "3ware ATA RAID array" f_disk "vtbd%d" "VirtIO Block Device" -f_floppy "fd%d" "Floppy Drive unit A" f_usb "da%da" "USB Mass Storage Device" # Network interfaces/names diff --git a/usr.sbin/bsdconfig/share/media/Makefile b/usr.sbin/bsdconfig/share/media/Makefile index d6b77d96ee7f..2cbce2d492b2 100644 --- a/usr.sbin/bsdconfig/share/media/Makefile +++ b/usr.sbin/bsdconfig/share/media/Makefile @@ -1,7 +1,7 @@ FILESDIR= ${SHAREDIR}/bsdconfig/media FILES= any.subr cdrom.subr common.subr directory.subr dos.subr \ - floppy.subr ftp.subr http.subr httpproxy.subr network.subr \ + ftp.subr http.subr httpproxy.subr network.subr \ nfs.subr options.subr tcpip.subr ufs.subr usb.subr wlan.subr .include diff --git a/usr.sbin/bsdconfig/share/media/any.subr b/usr.sbin/bsdconfig/share/media/any.subr index d98f58567bfa..ea4fef0b5151 100644 --- a/usr.sbin/bsdconfig/share/media/any.subr +++ b/usr.sbin/bsdconfig/share/media/any.subr @@ -34,7 +34,6 @@ f_include $BSDCFG_SHARE/dialog.subr f_include $BSDCFG_SHARE/media/cdrom.subr f_include $BSDCFG_SHARE/media/directory.subr f_include $BSDCFG_SHARE/media/dos.subr -f_include $BSDCFG_SHARE/media/floppy.subr f_include $BSDCFG_SHARE/media/ftp.subr f_include $BSDCFG_SHARE/media/http.subr f_include $BSDCFG_SHARE/media/httpproxy.subr @@ -78,7 +77,6 @@ f_media_get_type() '6 $msg_nfs' '$msg_install_over_nfs' '7 $msg_dos' '$msg_install_from_a_dos_partition' '8 $msg_ufs' '$msg_install_from_a_ufs_partition' - '9 $msg_floppy' '$msg_install_from_a_floppy_disk_set' 'A $msg_usb' '$msg_install_from_a_usb_drive' 'X $msg_options' '$msg_view_set_various_media_options' " # END-QUOTE @@ -128,7 +126,6 @@ f_media_get_type() ?" $msg_dos") f_media_set_dos ;; ?" $msg_nfs") f_media_set_nfs ;; ?" $msg_ufs") f_media_set_ufs ;; - ?" $msg_floppy") f_media_set_floppy ;; ?" $msg_usb") f_media_set_usb ;; ?" $msg_options") f_media_options_menu diff --git a/usr.sbin/bsdconfig/share/media/floppy.subr b/usr.sbin/bsdconfig/share/media/floppy.subr deleted file mode 100644 index ae17ee27f282..000000000000 --- a/usr.sbin/bsdconfig/share/media/floppy.subr +++ /dev/null @@ -1,228 +0,0 @@ -if [ ! "$_MEDIA_FLOPPY_SUBR" ]; then _MEDIA_FLOPPY_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. -# -# -############################################################ INCLUDES - -BSDCFG_SHARE="/usr/share/bsdconfig" -. $BSDCFG_SHARE/common.subr || exit 1 -f_dprintf "%s: loading includes..." media/floppy.subr -f_include $BSDCFG_SHARE/device.subr -f_include $BSDCFG_SHARE/dialog.subr -f_include $BSDCFG_SHARE/media/common.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 - -FLOPPY_MOUNTED= -FLOPPY_DISTWANTED= - -############################################################ FUNCTIONS - -# f_media_set_floppy -# -# Return success if we both found and set the media type to be a floppy. -# -f_media_set_floppy() -{ - f_media_close - - local devs ndevs - f_device_find "" $DEVICE_TYPE_FLOPPY devs - f_count ndevs $devs - - if [ ${ndevs:=0} -eq 0 ]; then - f_interactive && f_show_msg "$msg_no_floppy_devices_found" - return $FAILURE - elif [ $ndevs -eq 1 ]; then - f_struct_copy $devs device_media - else - local dev - local title="$msg_choose_a_floppy_drive" - local prompt="$msg_please_select_a_floppy_drive" - local hline= - - dev=$( f_device_menu \ - "$title" "$prompt" "$hline" $DEVICE_TYPE_FLOPPY \ - 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || - return $FAILURE - - f_struct_copy "$dev" device_media - fi - - f_struct device_media && - device_media unset private - - f_struct device_media || return $FAILURE -} - -# f_media_init_floppy $device -# -# Initializes the Floppy media device. Returns success if able to mount the -# Floppy disk device using either mount_msdosfs(8) or mount(8) (tried in that -# order). -# -f_media_init_floppy() -{ - local funcname=f_media_init_floppy - local dev="$1" devname err - - $dev get devname devname || return $FAILURE - f_dprintf "Init floppy called for %s distribution. devname=[%s]" \ - "${FLOPPY_DISTWANTED:-some}" "$devname" - - if [ "$FLOPPY_MOUNTED" ]; then - f_dprintf "Floppy device already mounted." - return $SUCCESS - fi - - local mp - $dev get private mp - if [ ! -e "${mp:=$MOUNTPOINT}" ] && ! f_quietly mkdir -p "$mp"; then - f_show_msg "$msg_unable_to_make_directory_mountpoint" \ - "$mp" "$devname" - return $FAILURE - fi - - if f_interactive; then - local desc - $dev get desc desc - if [ "$FLOPPY_DISTWANTED" ]; then - f_show_msg "$msg_please_insert_floppy_in_drive" "$desc" - else - f_show_msg "$msg_please_insert_floppy_containing" \ - "$FLOPPY_DISTWANTED" "$desc" - fi - fi - - if ! { - f_eval_catch -dk err $funcname mount_msdosfs \ - 'mount_msdosfs -o ro -m 0777 -u 0 -g 0 "%s" "%s"' \ - "$devname" "$mp" || - f_eval_catch -dk err $funcname mount \ - 'mount -o ro "%s" "%s"' "$devname" "$mp" - }; then - err="${err#mount: }"; err="${err#*: }" - local name - $dev get name name - f_show_msg "$msg_error_mounting_floppy_device" \ - "$name" "$devname" "$mp" "$err" - return $FAILURE - fi - FLOPPY_MOUNTED=1 - FLOPPY_DISTWANTED= - return $SUCCESS -} - -# f_media_get_floppy $device $file [$probe_type] -# -# Returns data from $file on a mounted Floppy disk device. Similar to cat(1). -# If $probe_type is present and non-NULL, limits retries to zero and returns -# success if $file exists. If $probe_type is equal to $PROBE_SIZE, prints the -# size of $file in bytes to standard-out. -# -f_media_get_floppy() -{ - local funcname=f_media_get_floppy - local dev="$1" file="$2" probe_type="$3" - local name - - $dev get name name - f_dprintf "f_media_get_floppy: dev=[%s] file=[%s] probe_type=%s" \ - "$name" "$file" "$probe_type" - - # - # floppies don't use f_media_generic_get() because it's too expensive - # to speculatively open files on a floppy disk. Make user get it - # right or give up with floppies. - # - local mp - $dev get private mp - local fp="${mp:=$MOUNTPOINT}/$file" - if ! [ -f "$fp" -a -r "$fp" ]; then - local nretries=4 - [ "$probe_type" = "$PROBE_SIZE" ] && echo "-1" - [ "$probe_type" ] && return $FAILURE - while ! [ -f "$fp" -a -r "$fp" ]; do - if [ $nretries -eq 0 ]; then - f_show_msg "$msg_failed_to_get_floppy_file" \ - "$fp" - [ "$probe_type" = "$PROBE_SIZE" ] && echo "-1" - return $FAILURE - fi - FLOPPY_DISTWANTED="$fp" - f_media_shutdown_floppy "$dev" - f_media_init_floppy "$dev" || return $FAILURE - nretries=$(( $nretries - 1 )) - done - fi - # - # If we reach here, $file exists - # - if [ "$probe_type" = "$PROBE_SIZE" ]; then - local size - f_eval_catch -dk size $funcname stat 'stat -f %%z "%s"' "$fp" - f_isinteger "$size" || size=-1 - echo "$size" - fi - [ "$probe_type" ] && return $SUCCESS - cat "$fp" -} - -# f_media_shutdown_floppy $device -# -# Shuts down the Floppy disk device using umount(8). Return status should be -# ignored. -# -f_media_shutdown_floppy() -{ - local funcname=f_media_shutdown_floppy - local dev="$1" err mp - - [ "$FLOPPY_MOUNTED" ] || return $FAILURE - - $dev get private mp - if f_eval_catch -d $funcname umount \ - 'umount -f "%s"' "${mp:=$MOUNTPOINT}" - then - FLOPPY_MOUNTED= - if f_interactive && [ "$_systemState" != "fixit" ]; then - local desc - $dev get desc desc - f_show_msg "$msg_you_may_remove_the_floppy" "$desc" - fi - fi -} - -############################################################ MAIN - -f_dprintf "%s: Successfully loaded." media/floppy.subr - -fi # ! $_MEDIA_FLOPPY_SUBR diff --git a/usr.sbin/bsdconfig/share/media/options.subr b/usr.sbin/bsdconfig/share/media/options.subr index 340619a50ac1..a4de6395127e 100644 --- a/usr.sbin/bsdconfig/share/media/options.subr +++ b/usr.sbin/bsdconfig/share/media/options.subr @@ -158,7 +158,6 @@ f_media_options_menu() $DEVICE_TYPE_UFS|$DEVICE_TYPE_DISK) cp="$msg_file_system" ;; $DEVICE_TYPE_DIRECTORY) cp="$msg_directory" ;; - $DEVICE_TYPE_FLOPPY) cp="$msg_floppy" ;; $DEVICE_TYPE_FTP) cp="$msg_ftp" ;; $DEVICE_TYPE_HTTP_PROXY) cp="$msg_http_proxy" ;; $DEVICE_TYPE_HTTP) cp="$msg_http_direct" ;; diff --git a/usr.sbin/bsdconfig/share/packages/index.subr b/usr.sbin/bsdconfig/share/packages/index.subr index dd432adf6adf..bd29b882d0d9 100644 --- a/usr.sbin/bsdconfig/share/packages/index.subr +++ b/usr.sbin/bsdconfig/share/packages/index.subr @@ -90,8 +90,6 @@ f_index_initialize() case "$__type" in $DEVICE_TYPE_DIRECTORY) __site="file://$__data/packages/$PKG_ABI" ;; - $DEVICE_TYPE_FLOPPY) - __site="file://${__data:-$MOUNTPOINT}/packages/$PKG_ABI" ;; $DEVICE_TYPE_FTP) f_getvar $VAR_FTP_PATH __site __site="$__site/packages/$PKG_ABI" ;; diff --git a/usr.sbin/bsdconfig/share/script.subr b/usr.sbin/bsdconfig/share/script.subr index feac3b47bdef..055202f1bd93 100644 --- a/usr.sbin/bsdconfig/share/script.subr +++ b/usr.sbin/bsdconfig/share/script.subr @@ -171,7 +171,6 @@ f_resword_new mediaGetType f_media_get_type # media/any.subr f_resword_new mediaSetCDROM f_media_set_cdrom # media/cdrom.subr f_resword_new mediaSetDOS f_media_set_dos # media/dos.subr f_resword_new mediaSetDirectory f_media_set_directory # media/directory.subr -f_resword_new mediaSetFloppy f_media_set_floppy # media/floppy.subr f_resword_new mediaSetNFS f_media_set_nfs # media/nfs.subr f_resword_new mediaSetUFS f_media_set_ufs # media/ufs.subr f_resword_new mediaSetUSB f_media_set_usb # media/usb.subr