[PC-BSD Commits] r4208 - in pcbsd/trunk/pc-sysinstall: . backend conf

svn at pcbsd.org svn at pcbsd.org
Thu Jul 9 13:28:09 PDT 2009


Author: kris
Date: 2009-07-09 13:28:08 -0700 (Thu, 09 Jul 2009)
New Revision: 4208

Removed:
   pcbsd/trunk/pc-sysinstall/conf/components/
Modified:
   pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh
   pcbsd/trunk/pc-sysinstall/backend/functions-mountoptical.sh
   pcbsd/trunk/pc-sysinstall/backend/functions.sh
   pcbsd/trunk/pc-sysinstall/conf/pc-sysinstall.conf
   pcbsd/trunk/pc-sysinstall/pcinstall.cfg
Log:

Added support for mounting the disk, and starting extraction now in pc-sysinstall



Modified: pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh	2009-07-09 19:00:35 UTC (rev 4207)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh	2009-07-09 20:28:08 UTC (rev 4208)
@@ -1,27 +1,69 @@
 #!/bin/sh
 # Functions which perform the extraction / installation of system to disk
 
-. ${BACKEND}/functions-extractimage.sh
+. ${BACKEND}/functions-mountoptical.sh
 
-# Performs the extraction of data to disk
-start_extract()
+# Performs the extraction of data to disk from DVD
+start_extract_dvd()
 {
+  # Check if we are doing an upgrade, and if so use our exclude list
+  if [ "${INSTALLMODE}" != "fresh" ]
+  then
+   TAROPTS="-X ${PROGDIR}/conf/excUpgrade"
+  else
+   TAROPTS=""
+  fi
 
+  case ${PACKAGETYPE} in
+   lzma) echo "Starting image extraction..." >>${LOGOUT} 
+         ${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) #TODO
+         ;;
+    tar) tar -xpvf -C ${FSMNT} -f ${CDMNT}/${INSFILE} ${TAROPTS} >&1 2>&1
+         if [ "$?" != "0" ]
+         then
+           exit_err "ERROR: Failed extracting the image with: ${CMD}"
+         fi
+         ;;
+  esac
+
 };
 
 # Entrance function, which starts the installation process
 init_extraction()
 {
+ # Lets figure out what file we are working on here and set it
+ if [ "$INSTALLMODE" = "FreeBSD" ]
+ then
+   case $PACKAGETYPE in
+      lzma) INSFILE="${FBSD_LZMA_FILE}" ;;
+      uzip) INSFILE="${FBSD_UZIP_FILE}" ;;
+       tar) INSFILE="${FBSD_TAR_FILE}" ;;
+   esac
+ else
+   case $PACKAGETYPE in
+      lzma) INSFILE="${LZMA_FILE}" ;;
+      uzip) INSFILE="${UZIP_FILE}" ;;
+       tar) INSFILE="${TAR_FILE}" ;;
+   esac
+ fi
+ export INSFILE
 
+
  # Lets start by figuring out what medium we are using
  case ${INSTALLMEDIUM} in
-    dvd) # Lets start by mounting the disk 
-         opt_mount 
-         start_extract
-         ;;
-    usb) ;;
-    ftp) ;;
+   dvd) # Lets start by mounting the disk 
+       opt_mount 
+       start_extract_dvd
+       ;;
+    usb) start_extract_usb ;;
+    ftp) start_extract_ftp ;;
       *) exit_err "ERROR: Unknown install medium" ;;
  esac
 
-}:
+};

Modified: pcbsd/trunk/pc-sysinstall/backend/functions-mountoptical.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-mountoptical.sh	2009-07-09 19:00:35 UTC (rev 4207)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-mountoptical.sh	2009-07-09 20:28:08 UTC (rev 4208)
@@ -7,34 +7,37 @@
 # Performs the extraction of data to disk
 opt_mount()
 {
+ FOUND="0"
 
- # Set the file we are looking for on this disk
- case ${PACKAGETYPE} in
-   lzma) SEARCH_FILE="${CDMNT}/${LZMA_FILE}"  ;;
-   uzip) SEARCH_FILE="${CDMNT}/${UZIP_FILE}"  ;;
-    tar) SEARCH_FILE="${CDMNT}/${TAR_FILE}"  ;;
- esac
- 
 # Setup our loop to search for installation media
  while
  z=1
  do
 
    # Loop though and look for an installation disk
-   for i in `ls -1 /dev/acd* /dev/cd* /dev/scd* /dev/rscd*`
+   for i in `ls -1 /dev/acd* /dev/cd* /dev/scd* /dev/rscd* 2>/dev/null`
    do
      # Find the CD Device
      /sbin/mount_cd9660 $i ${CDMNT}
 
      # Check the package type to see if we have our install data
-     if [ -e "${SEARCH_FILE}" ]
+     if [ -e "${CDMNT}/${INSFILE}" ]
      then
        echo "${i}" >${TMPDIR}/cdmnt
+       echo "FOUND DVD: ${i}" >>${LOGOUT}
+       FOUND="1"
        break
      fi
      /sbin/umount ${CDMNT} >/dev/null 2>/dev/null
    done
+
+   # We have a valid DVD mounted, break out of loop now
+   if [ "$FOUND" = "1" ]
+   then
+     break
+   fi
  
+   # If we got this far, we must not have a DVD we can find :(
    get_value_from_cfg installInteractive
    if [ "${VAL}" = "yes" ]
    then

Modified: pcbsd/trunk/pc-sysinstall/backend/functions.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions.sh	2009-07-09 19:00:35 UTC (rev 4207)
+++ pcbsd/trunk/pc-sysinstall/backend/functions.sh	2009-07-09 20:28:08 UTC (rev 4208)
@@ -62,6 +62,11 @@
 # Displays an error message and exits with error 1
 exit_err()
 {
+   # Echo the message for the users benefit
    echo "$1"
+
+   # Save this error to the log file
+   echo "${1}" >>$LOGOUT
+
    exit 1
 };

Modified: pcbsd/trunk/pc-sysinstall/conf/pc-sysinstall.conf
===================================================================
--- pcbsd/trunk/pc-sysinstall/conf/pc-sysinstall.conf	2009-07-09 19:00:35 UTC (rev 4207)
+++ pcbsd/trunk/pc-sysinstall/conf/pc-sysinstall.conf	2009-07-09 20:28:08 UTC (rev 4208)
@@ -40,10 +40,18 @@
 export LZMA_FILE UZIP_FILE TAR_FILE
 
 
+# Locations of FreeBSD only install files
+FBSD_LZMA_FILE="FBSD.tar.lzma"
+FBSD_UZIP_FILE="FBSD.uzip"
+FBSD_TAR_FILE="FBSD.tar"
 
+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 -so"
 LZMA_CMD_NET="lzma d -si -so"
+export LZMA_CMD LZMA_CMD_NET
 
 # Our internet mirror listing file location
 NETSERVER="http://updates.pcbsd.org"

Modified: pcbsd/trunk/pc-sysinstall/pcinstall.cfg
===================================================================
--- pcbsd/trunk/pc-sysinstall/pcinstall.cfg	2009-07-09 19:00:35 UTC (rev 4207)
+++ pcbsd/trunk/pc-sysinstall/pcinstall.cfg	2009-07-09 20:28:08 UTC (rev 4208)
@@ -23,7 +23,7 @@
 
 # Set if we are installing via optical, USB, or FTP
 installType=PCBSD-Desktop
-installMedium=optical
+installMedium=dvd
 
 packageType=lzma
 #packageType=uzip



More information about the Commits mailing list