[PC-BSD Commits] r4987 - in pcbsd/trunk/pc-sysinstall: backend backend-query conf

svn at pcbsd.org svn at pcbsd.org
Thu Nov 12 17:20:07 PST 2009


Author: kris
Date: 2009-11-12 17:20:07 -0800 (Thu, 12 Nov 2009)
New Revision: 4987

Modified:
   pcbsd/trunk/pc-sysinstall/backend-query/test-netup.sh
   pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh
   pcbsd/trunk/pc-sysinstall/backend/functions-installcomponents.sh
   pcbsd/trunk/pc-sysinstall/conf/pc-sysinstall.conf
Log:

Updated pc-sysinstall a bit further, cleanup the default config, fix the test for internet access,
and added a variable to set the number of tries when using rsync, in case of a bad connection or rsync hiccups
making you restart the whole process



Modified: pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh	2009-11-13 01:18:52 UTC (rev 4986)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh	2009-11-13 01:20:07 UTC (rev 4987)
@@ -121,15 +121,30 @@
   fi
   RSYNCPORT="${VAL}" ; export RSYNCPORT
 
-  rsync -avvzHsR \
-  --rsync-path="rsync --fake-super" \
-  -e "ssh -p ${RSYNCPORT}" \
-  ${RSYNCUSER}@${RSYNCHOST}:${RSYNCPATH}/./ ${FSMNT}
-  if [ "$?" != "0" ]
-  then
-    exit_err "ERROR: Failed rsync command!"
-  fi
+  COUNT="1"
+  while
+  z=1
+  do
+    if [ ${COUNT} -gt ${RSYNCTRIES} ]
+    then
+     exit_err "ERROR: Failed rsync command!"
+     break
+    fi
 
+    rsync -avvzHsR \
+    --rsync-path="rsync --fake-super" \
+    -e "ssh -p ${RSYNCPORT}" \
+    ${RSYNCUSER}@${RSYNCHOST}:${RSYNCPATH}/./ ${FSMNT}
+    if [ "$?" != "0" ]
+    then
+      echo "Rsync failed! Tries: ${COUNT}"
+    else
+      break
+    fi
+
+    COUNT="`expr ${COUNT} + 1`"
+  done 
+
 };
 
 

Modified: pcbsd/trunk/pc-sysinstall/backend/functions-installcomponents.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-installcomponents.sh	2009-11-13 01:18:52 UTC (rev 4986)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-installcomponents.sh	2009-11-13 01:20:07 UTC (rev 4987)
@@ -23,8 +23,8 @@
 		 ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT}
 	    RESULT="$?"
             ;;
-       ftp) ${FETCHCMD} ${NETPATH}/${COMPFILEDIR}/${CFILE} \
-		-o ${FSMNT}/${COMPTMPDIR}/${CFILE} >>${LOGOUT} 2>>${LOGOUT}
+       ftp) curl -o ${FSMNT}/${COMPTMPDIR}/${CFILE} \
+	    ${NETPATH}/${COMPFILEDIR}/${CFILE} >>${LOGOUT} 2>>${LOGOUT}
 	    RESULT="$?"
             ;;
     esac

Modified: pcbsd/trunk/pc-sysinstall/backend-query/test-netup.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend-query/test-netup.sh	2009-11-13 01:18:52 UTC (rev 4986)
+++ pcbsd/trunk/pc-sysinstall/backend-query/test-netup.sh	2009-11-13 01:20:07 UTC (rev 4987)
@@ -5,18 +5,16 @@
 
 rm ${TMPDIR}/.testftp >/dev/null 2>/dev/null
 
-fetch -o ${TMPDIR}/.testftp "${FTPTEST}" >/dev/null 2>/dev/null
+ping -c 2 www.pcbsd.org >/dev/null 2>/dev/null
 if [ "$?" = "0" ]
 then
-   echo "fetch" > ${TMPDIR}/.fetchCMD
    echo "ftp: Up"
    exit 0
 fi
 
-fetch -p -o ${TMPDIR}/.testftp "${FTPTEST}" >/dev/null 2>/dev/null
+ping -c 2 www.freebsd.org >/dev/null 2>/dev/null
 if [ "$?" = "0" ]
 then
-   echo "fetch -p" > ${TMPDIR}/.fetchCMD
    echo "ftp: Up"
    exit 0
 fi

Modified: pcbsd/trunk/pc-sysinstall/conf/pc-sysinstall.conf
===================================================================
--- pcbsd/trunk/pc-sysinstall/conf/pc-sysinstall.conf	2009-11-13 01:18:52 UTC (rev 4986)
+++ pcbsd/trunk/pc-sysinstall/conf/pc-sysinstall.conf	2009-11-13 01:20:07 UTC (rev 4987)
@@ -26,14 +26,14 @@
 GELIKEYDIR="${TMPDIR}/.geli-keys"
 export GELIKEYDIR
 
-# Set the FTP file we use to test if we have a working internet connection
-FTPTEST="ftp.pcbsd.org/pub/README"
-export FTPTEST
-
 # Set our log file
 LOGOUT="${TMPDIR}/pc-sysinstall.log"
 export LOGOUT
 
+# Set the number of rsync tries
+RSYNCTRIES="3"
+export RSYNCTRIES
+
 # Set our mount-points
 CDMNT="/cdmnt"
 FSMNT="/mnt"
@@ -49,45 +49,18 @@
 COMPTMPDIR="/usr/.componenttmp"
 export COMPTMPDIR
 
-
 # Variables to set the location of installation data
-LZMA_FILE="PCBSD.tar.lzma"
 UZIP_FILE="PCBSD.ufs.uzip"
 TAR_FILE="PCBSD.tbz"
+export UZIP_FILE TAR_FILE
 
-export LZMA_FILE UZIP_FILE TAR_FILE
-
-
 # Locations of FreeBSD only install files
-FBSD_LZMA_FILE="fbsd-release.tar.lzma"
 FBSD_UZIP_FILE="fbsd-release.ufs.uzip"
 FBSD_TAR_FILE="fbsd-release.tbz"
+export FBSD_UZIP_FILE FBSD_TAR_FILE
 
-export FBSD_LZMA_FILE FBSD_UZIP_FILE FBSD_TAR_FILE
-
-
-# Commands to use in conjunction with tar when extracting LZMA files
-LZMA_CMD="lzma -d -c"
-LZMA_CMD_NET="lzma -d -c -"
-export LZMA_CMD LZMA_CMD_NET
-
 # Our internet mirror listing file location
 NETSERVER="http://updates.pcbsd.org"
 ARCH="`uname -m`"
 #VERSION="`cat /PCBSDVERSION`"
 MIRRORLIST="${NETSERVER}/mirrors-netinstall.php?ver=${VERSION}&arch=${ARCH}"
-
-# Export our variable if on a network connection
-if [ -e "/tmp/networkURL" ]
-then
-  NETPATH="`cat /tmp/networkURL`/netinstall/" ; export NETPATH
-fi
-
-# Set our fetch command variable
-if [ -e "/tmp/fetchCMD" ]
-then
-  FETCHCMD="`cat /tmp/fetchCMD`" ; export FETCHCMD
-else
-  FETCHCMD="fetch" ; export FETCHCMD
-fi
-



More information about the Commits mailing list