[PC-BSD Commits] r4870 - in pcbsd/trunk/pc-sysinstall: . backend
svn at pcbsd.org
svn at pcbsd.org
Wed Nov 4 10:39:35 PST 2009
Author: kris
Date: 2009-11-04 10:39:35 -0800 (Wed, 04 Nov 2009)
New Revision: 4870
Modified:
pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh
pcbsd/trunk/pc-sysinstall/pc-sysinstall
Log:
Started support for ftp installs, needs testing / bugfixes, and cleanup log file when
running for a 2nd time
Modified: pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh 2009-11-04 18:18:21 UTC (rev 4869)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh 2009-11-04 18:39:35 UTC (rev 4870)
@@ -4,8 +4,8 @@
. ${BACKEND}/functions-mountoptical.sh
. ${BACKEND}/functions-mountusb.sh
-# Performs the extraction of data to disk from DVD
-start_extract_dvd()
+# Performs the extraction of data to disk from a uzip or tar archive
+start_extract_uzip_tar()
{
if [ -z "$INSFILE" ]
then
@@ -22,13 +22,6 @@
fi
case ${PACKAGETYPE} in
- rsync) echo_log "Starting image extraction..."
- ${LZMA_CMD} ${CDMNT}/${INSFILE} 2>/dev/null | tar -xpvf - -C ${FSMNT} ${TAROPTS} >&1 2>&1
- if [ "$?" != "0" ]
- then
- exit_err "ERROR: Failed extracting the image with: ${CMD}"
- fi
- ;;
uzip) # Start by mounting the uzip image
MDDEVICE=`mdconfig -a -t vnode -o readonly -f ${CDMNT}/${INSFILE}`
mkdir -p ${FSMNT}.uzip
@@ -62,6 +55,13 @@
;;
esac
+ # Check if this was a FTP download and clean it up now
+ if [ "${INSTALLMEDIUM}" = "ftp" ]
+ then
+ echo_log "Cleaning up downloaded archive"
+ rm ${INSFILE}
+ fi
+
};
@@ -69,8 +69,28 @@
# the install
fetch_install_file()
{
+ get_value_from_cfg ftpPath
+ if [ -z "$VAL" ]
+ then
+ exit_err "ERROR: Install medium was set to ftp, but no ftpPath was provided!"
+ fi
+ FTPPATH="${VAL}"
+
+ # Check if we have a /usr partition to save the download
+ if [ -d "${FSMNT}/usr" ]
+ then
+ OUTFILE="${FSMNT}/usr/.fetch-${INSFILE}"
+ else
+ OUTFILE="${FSMNT}/.fetch-${INSFILE}"
+ fi
+ # Do the fetch of the archive now
+ rc_halt_echo "fetch -p -o ${OUTFILE} ${FTPPATH}/${INSFILE}"
+
+ # Done fetching, now reset the INSFILE to our downloaded archived
+ INSFILE="${OUTFILE}" ; export INSFILE
+
};
@@ -104,11 +124,14 @@
case ${INSTALLMEDIUM} in
dvd) # Lets start by mounting the disk
opt_mount
- start_extract_dvd
+ start_extract_uzip_tar
;;
usb) usb_mount
- start_extract_usb ;;
- ftp) start_extract_ftp ;;
+ start_extract_uzip_tar ;;
+ ftp) fetch_install_file
+ start_extract_uzip_tar ;;
+ rsync) start_rsync_copy
+ ;;
*) exit_err "ERROR: Unknown install medium" ;;
esac
Modified: pcbsd/trunk/pc-sysinstall/pc-sysinstall
===================================================================
--- pcbsd/trunk/pc-sysinstall/pc-sysinstall 2009-11-04 18:18:21 UTC (rev 4869)
+++ pcbsd/trunk/pc-sysinstall/pc-sysinstall 2009-11-04 18:39:35 UTC (rev 4870)
@@ -36,6 +36,12 @@
exit 1
fi
+# Check if we need to cleanup and remove an old log file
+if [ -e "${LOGOUT}" ]
+then
+ rm ${LOGOUT}
+fi
+
# Now source our functions.sh
if [ -e "${PROGDIR}/backend/functions.sh" ]
then
More information about the Commits
mailing list