cdrom.subr (256281) | cdrom.subr (258420) |
---|---|
1if [ ! "$_MEDIA_CDROM_SUBR" ]; then _MEDIA_CDROM_SUBR=1 2# 3# Copyright (c) 2012-2013 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: --- 10 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# | 1if [ ! "$_MEDIA_CDROM_SUBR" ]; then _MEDIA_CDROM_SUBR=1 2# 3# Copyright (c) 2012-2013 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: --- 10 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/media/cdrom.subr 256181 2013-10-09 08:12:26Z dteske $ | 27# $FreeBSD: stable/10/usr.sbin/bsdconfig/share/media/cdrom.subr 258420 2013-11-21 03:38:47Z dteske $ |
28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_dprintf "%s: loading includes..." media/cdrom.subr 34f_include $BSDCFG_SHARE/device.subr 35f_include $BSDCFG_SHARE/dialog.subr --- 122 unchanged lines hidden (view full) --- 158 f_dprintf "f_media_get_cdrom: dev=[%s] file=[%s] probe_type=%s" \ 159 "$dev" "$file" "$probe_type" 160 161 f_media_generic_get "$MOUNTPOINT" "$file" "$probe_type" 162} 163 164# f_media_shutdown_cdrom $device 165# | 28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_dprintf "%s: loading includes..." media/cdrom.subr 34f_include $BSDCFG_SHARE/device.subr 35f_include $BSDCFG_SHARE/dialog.subr --- 122 unchanged lines hidden (view full) --- 158 f_dprintf "f_media_get_cdrom: dev=[%s] file=[%s] probe_type=%s" \ 159 "$dev" "$file" "$probe_type" 160 161 f_media_generic_get "$MOUNTPOINT" "$file" "$probe_type" 162} 163 164# f_media_shutdown_cdrom $device 165# |
166# Shuts down the CDROM device and ejects the media using f_media_eject_cdrom(), 167# below. Return status should be ignored. | 166# Shuts down the CDROM device. Return status should be ignored. |
168# 169f_media_shutdown_cdrom() 170{ 171 local dev="$1" err 172 173 [ "$CDROM_MOUNTED" ] || return $FAILURE 174 175 if [ "$CDROM_PREVIOUSLY_MOUNTED" ]; then 176 CDROM_MOUNTED= 177 return $SUCCESS 178 fi 179 180 if ! err=$( umount -f "$MOUNTPOINT" 2>&1 ); then 181 err="${err#umount: }"; err="${err#*: }" 182 f_show_msg "$msg_could_not_unmount_the_cdrom_dvd" \ 183 "$MOUNTPOINT" "$err" 184 else 185 CDROM_MOUNTED= 186 fi | 167# 168f_media_shutdown_cdrom() 169{ 170 local dev="$1" err 171 172 [ "$CDROM_MOUNTED" ] || return $FAILURE 173 174 if [ "$CDROM_PREVIOUSLY_MOUNTED" ]; then 175 CDROM_MOUNTED= 176 return $SUCCESS 177 fi 178 179 if ! err=$( umount -f "$MOUNTPOINT" 2>&1 ); then 180 err="${err#umount: }"; err="${err#*: }" 181 f_show_msg "$msg_could_not_unmount_the_cdrom_dvd" \ 182 "$MOUNTPOINT" "$err" 183 else 184 CDROM_MOUNTED= 185 fi |
187 188 f_media_eject_cdrom "$dev" | |
189} 190 191# f_media_eject_cdrom $device 192# 193# Eject the media from the CDROM device. Returns success. 194# 195f_media_eject_cdrom() 196{ --- 16 unchanged lines hidden --- | 186} 187 188# f_media_eject_cdrom $device 189# 190# Eject the media from the CDROM device. Returns success. 191# 192f_media_eject_cdrom() 193{ --- 16 unchanged lines hidden --- |