device.subr (260678) | device.subr (263980) |
---|---|
1if [ ! "$_DEVICE_SUBR" ]; then _DEVICE_SUBR=1 2# | 1if [ ! "$_DEVICE_SUBR" ]; then _DEVICE_SUBR=1 2# |
3# Copyright (c) 2012-2013 Devin Teske | 3# Copyright (c) 2012-2014 Devin Teske |
4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: 9# 1. Redistributions of source code must retain the above copyright 10# notice, this list of conditions and the following disclaimer. 11# 2. Redistributions in binary form must reproduce the above copyright --- 7 unchanged lines hidden (view full) --- 19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25# SUCH DAMAGE. 26# | 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: 9# 1. Redistributions of source code must retain the above copyright 10# notice, this list of conditions and the following disclaimer. 11# 2. Redistributions in binary form must reproduce the above copyright --- 7 unchanged lines hidden (view full) --- 19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25# SUCH DAMAGE. 26# |
27# $FreeBSD: stable/10/usr.sbin/bsdconfig/share/device.subr 260678 2014-01-15 07:49:17Z dteske $ | 27# $FreeBSD: stable/10/usr.sbin/bsdconfig/share/device.subr 263980 2014-04-01 00:19:13Z dteske $ |
28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_dprintf "%s: loading includes..." device.subr 34f_include $BSDCFG_SHARE/dialog.subr 35f_include $BSDCFG_SHARE/strings.subr --- 129 unchanged lines hidden (view full) --- 165# Reset the registered device chain. 166# 167f_device_reset() 168{ 169 local dev 170 for dev in $DEVICES; do 171 f_device_shutdown $dev 172 | 28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_dprintf "%s: loading includes..." device.subr 34f_include $BSDCFG_SHARE/dialog.subr 35f_include $BSDCFG_SHARE/strings.subr --- 129 unchanged lines hidden (view full) --- 165# Reset the registered device chain. 166# 167f_device_reset() 168{ 169 local dev 170 for dev in $DEVICES; do 171 f_device_shutdown $dev 172 |
173 # 174 # XXX this potentially leaks $dev->private if it's being | 173 # XXX This potentially leaks $dev->private if it's being |
175 # used to point to something dynamic, but you're not supposed 176 # to call this routine at such times that some open instance | 174 # used to point to something dynamic, but you're not supposed 175 # to call this routine at such times that some open instance |
177 # has its private member pointing somewhere anyway. XXX | 176 # has its private member pointing somewhere anyway. |
178 # 179 f_struct_free device_$dev 180 done 181 DEVICES= 182} 183 184# f_device_reset_network 185# --- 134 unchanged lines hidden (view full) --- 320 done 321 322 # Finally go get the disks and look for partitions to register 323 local diskname slices index type rest slice part 324 for diskname in $( sysctl -n kern.disks ); do 325 326 case "$diskname" in 327 cd*) | 177 # 178 f_struct_free device_$dev 179 done 180 DEVICES= 181} 182 183# f_device_reset_network 184# --- 134 unchanged lines hidden (view full) --- 319 done 320 321 # Finally go get the disks and look for partitions to register 322 local diskname slices index type rest slice part 323 for diskname in $( sysctl -n kern.disks ); do 324 325 case "$diskname" in 326 cd*) |
328 # XXX 329 # Due to unknown reasons, kern.disks returns SCSI | 327 # XXX Due to unknown reasons, kern.disks returns SCSI |
330 # CDROM as a valid disk. This will prevent bsdconfig 331 # from presenting SCSI CDROMs as available disks in 332 # various menus. Why GEOM treats SCSI CDROM as a disk 333 # is beyond me and that should be investigated. 334 # For temporary workaround, ignore SCSI CDROM device. 335 # 336 continue ;; 337 esac --- 690 unchanged lines hidden --- | 328 # CDROM as a valid disk. This will prevent bsdconfig 329 # from presenting SCSI CDROMs as available disks in 330 # various menus. Why GEOM treats SCSI CDROM as a disk 331 # is beyond me and that should be investigated. 332 # For temporary workaround, ignore SCSI CDROM device. 333 # 334 continue ;; 335 esac --- 690 unchanged lines hidden --- |