[PC-BSD Commits] r5174 - pcbsd/trunk/pc-sysinstall/backend
svn at pcbsd.org
svn at pcbsd.org
Tue Dec 1 09:48:59 PST 2009
Author: kris
Date: 2009-12-01 09:48:59 -0800 (Tue, 01 Dec 2009)
New Revision: 5174
Removed:
pcbsd/trunk/pc-sysinstall/backend/functions-mountusb.sh
Modified:
pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh
pcbsd/trunk/pc-sysinstall/backend/functions-mountoptical.sh
Log:
Updated pc-sysinstall, merge dvd / usb install disk checking, since they are 95% similar anyway
Modified: pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh 2009-12-01 17:06:30 UTC (rev 5173)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh 2009-12-01 17:48:59 UTC (rev 5174)
@@ -2,7 +2,6 @@
# Functions which perform the extraction / installation of system to disk
. ${BACKEND}/functions-mountoptical.sh
-. ${BACKEND}/functions-mountusb.sh
# Performs the extraction of data to disk from a uzip or tar archive
start_extract_uzip_tar()
@@ -176,14 +175,11 @@
# Lets start by figuring out what medium we are using
case ${INSTALLMEDIUM} in
- dvd) # Lets start by mounting the disk
+ dvd|usb) # Lets start by mounting the disk
opt_mount
INSFILE="${CDMNT}/${INSFILE}" ; export INSFILE
start_extract_uzip_tar
;;
- usb) usb_mount
- INSFILE="${CDMNT}/${INSFILE}" ; export INSFILE
- start_extract_uzip_tar ;;
ftp) fetch_install_file
start_extract_uzip_tar ;;
rsync) start_rsync_copy
Modified: pcbsd/trunk/pc-sysinstall/backend/functions-mountoptical.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-mountoptical.sh 2009-12-01 17:06:30 UTC (rev 5173)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-mountoptical.sh 2009-12-01 17:48:59 UTC (rev 5174)
@@ -1,5 +1,5 @@
#!/bin/sh
-# Functions which perform mounting / unmounting and switching of optical media
+# Functions which perform mounting / unmounting and switching of optical / usb media
. ${BACKEND}/functions.sh
. ${BACKEND}/functions-parse.sh
@@ -7,16 +7,16 @@
# Displays an optical failure message
opt_fail()
{
- # If we got here, we must not have a DVD we can find :(
+ # If we got here, we must not have a DVD/USB we can find :(
get_value_from_cfg installInteractive
if [ "${VAL}" = "yes" ]
then
# We are running interactive, and didn't find a DVD, prompt user again
- echo_log "OPT DISK ERROR: Unable to find installation disk!"
+ echo_log "DISK ERROR: Unable to find installation disk!"
echo_log "Please insert the installation disk and press enter."
read tmp
else
- exit_err "ERROR: Unable to locate installation DVD"
+ exit_err "ERROR: Unable to locate installation DVD/USB"
fi
};
@@ -48,7 +48,6 @@
z=1
do
-
# Loop though and look for an installation disk
for i in `ls -1 /dev/acd* /dev/cd* /dev/scd* /dev/rscd* 2>/dev/null`
do
@@ -66,7 +65,39 @@
/sbin/umount ${CDMNT} >/dev/null 2>/dev/null
done
- # We have a valid DVD mounted, break out of loop now
+ # If no DVD found, try USB
+ # Loop though and look for an installation disk
+ for i in `ls -1 /dev/da* 2>/dev/null`
+ do
+ # Check if we can mount this device UFS
+ /sbin/mount $i ${CDMNT}
+
+ # Check the package type to see if we have our install data
+ if [ -e "${CDMNT}/${INSFILE}" ]
+ then
+ echo "${i}" >${TMPDIR}/cdmnt
+ echo_log "FOUND USB: ${i}"
+ FOUND="1"
+ break
+ fi
+ /sbin/umount ${CDMNT} >/dev/null 2>/dev/null
+
+ # Also check if it is a FAT mount
+ /sbin/mount -t msdosfs $i ${CDMNT}
+
+ # Check the package type to see if we have our install data
+ if [ -e "${CDMNT}/${INSFILE}" ]
+ then
+ echo "${i}" >${TMPDIR}/cdmnt
+ echo_log "FOUND USB: ${i}"
+ FOUND="1"
+ break
+ fi
+ /sbin/umount ${CDMNT} >/dev/null 2>/dev/null
+ done
+ fi # End of USB Check
+
+
if [ "$FOUND" = "1" ]
then
break
More information about the Commits
mailing list