[PC-BSD Commits] r8126 - in pcbsd/stable/pc-sysinstall: backend backend-partmanager backend-query

svn at pcbsd.org svn at pcbsd.org
Wed Dec 1 12:38:40 PST 2010


Author: kris
Date: 2010-12-01 12:38:39 -0800 (Wed, 01 Dec 2010)
New Revision: 8126

Modified:
   pcbsd/stable/pc-sysinstall/backend-partmanager/create-part.sh
   pcbsd/stable/pc-sysinstall/backend-partmanager/delete-part.sh
   pcbsd/stable/pc-sysinstall/backend-query/detect-emulation.sh
   pcbsd/stable/pc-sysinstall/backend-query/detect-laptop.sh
   pcbsd/stable/pc-sysinstall/backend-query/detect-nics.sh
   pcbsd/stable/pc-sysinstall/backend-query/disk-info.sh
   pcbsd/stable/pc-sysinstall/backend-query/disk-list.sh
   pcbsd/stable/pc-sysinstall/backend-query/disk-part.sh
   pcbsd/stable/pc-sysinstall/backend-query/enable-net.sh
   pcbsd/stable/pc-sysinstall/backend-query/list-components.sh
   pcbsd/stable/pc-sysinstall/backend-query/list-rsync-backups.sh
   pcbsd/stable/pc-sysinstall/backend-query/list-tzones.sh
   pcbsd/stable/pc-sysinstall/backend-query/query-langs.sh
   pcbsd/stable/pc-sysinstall/backend-query/send-logs.sh
   pcbsd/stable/pc-sysinstall/backend-query/setup-ssh-keys.sh
   pcbsd/stable/pc-sysinstall/backend-query/sys-mem.sh
   pcbsd/stable/pc-sysinstall/backend-query/test-live.sh
   pcbsd/stable/pc-sysinstall/backend-query/test-netup.sh
   pcbsd/stable/pc-sysinstall/backend-query/update-part-list.sh
   pcbsd/stable/pc-sysinstall/backend-query/xkeyboard-layouts.sh
   pcbsd/stable/pc-sysinstall/backend-query/xkeyboard-models.sh
   pcbsd/stable/pc-sysinstall/backend-query/xkeyboard-variants.sh
   pcbsd/stable/pc-sysinstall/backend/functions-bsdlabel.sh
   pcbsd/stable/pc-sysinstall/backend/functions-cleanup.sh
   pcbsd/stable/pc-sysinstall/backend/functions-disk.sh
   pcbsd/stable/pc-sysinstall/backend/functions-extractimage.sh
   pcbsd/stable/pc-sysinstall/backend/functions-installcomponents.sh
   pcbsd/stable/pc-sysinstall/backend/functions-localize.sh
   pcbsd/stable/pc-sysinstall/backend/functions-mountdisk.sh
   pcbsd/stable/pc-sysinstall/backend/functions-mountoptical.sh
   pcbsd/stable/pc-sysinstall/backend/functions-networking.sh
   pcbsd/stable/pc-sysinstall/backend/functions-newfs.sh
   pcbsd/stable/pc-sysinstall/backend/functions-parse.sh
   pcbsd/stable/pc-sysinstall/backend/functions-runcommands.sh
   pcbsd/stable/pc-sysinstall/backend/functions-unmount.sh
   pcbsd/stable/pc-sysinstall/backend/functions-upgrade.sh
   pcbsd/stable/pc-sysinstall/backend/functions-users.sh
   pcbsd/stable/pc-sysinstall/backend/functions.sh
   pcbsd/stable/pc-sysinstall/backend/parseconfig.sh
   pcbsd/stable/pc-sysinstall/backend/startautoinstall.sh
Log:

MFC pc-sysinstall improvements



Modified: pcbsd/stable/pc-sysinstall/backend/functions-bsdlabel.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-bsdlabel.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-bsdlabel.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions related to disk operations using bsdlabel
 
 # Check if we are are provided a geli password on the nextline of the config
@@ -32,21 +58,14 @@
     echo $LINE | grep '^ZFS' >/dev/null 2>/dev/null
     if [ "$?" = "0" ] ; then
       ZTYPE="NONE"
-      ZFSVARS="`echo $LINE | cut -d '(' -f 2- | cut -d ')' -f 1`"
+      ZFSVARS="`echo $LINE | cut -d '(' -f 2- | cut -d ')' -f 1 | xargs`"
 
-      # Check if we are doing raidz setup
-      echo $ZFSVARS | grep "^raidz:" >/dev/null 2>/dev/null
-      if [ "$?" = "0" ] ; then
-       ZTYPE="raidz" 
-       ZFSVARS="`echo $ZFSVARS | sed 's|raidz: ||g' | sed 's|raidz:||g'`"
-      fi
+      echo $ZFSVARS | grep -E "^(disk|file|mirror|raidz(1|2)?|spare|log|cache):" >/dev/null 2>/dev/null
+	  if [ "$?" = "0" ] ; then
+       ZTYPE=`echo $ZFSVARS | cut -f1 -d:`
+       ZFSVARS=`echo $ZFSVARS | sed "s|$ZTYPE: ||g" | sed "s|$ZTYPE:||g"`
+	  fi
 
-      echo $ZFSVARS | grep "^mirror:" >/dev/null 2>/dev/null
-      if [ "$?" = "0" ] ; then
-        ZTYPE="mirror" 
-        ZFSVARS="`echo $ZFSVARS | sed 's|mirror: ||g' | sed 's|mirror:||g'`"
-      fi
-
       # Return the ZFS options
       if [ "${ZTYPE}" = "NONE" ] ; then
         VAR="${ACTIVEDEV} ${ZFSVARS}"
@@ -57,7 +76,6 @@
       return
     fi # End of ZFS block
 
-
   fi # End of xtra-options block
 
   # If we got here, set VAR to empty and export
@@ -67,30 +85,31 @@
 };
 
 # Init each zfs mirror disk with a boot sector so we can failover
-setup_zfs_mirror_parts() {
-	
-	_nZFS=""
-	# Using mirroring, setup boot partitions on each disk
-	_mirrline="`echo ${1} | sed 's|mirror ||g'`"
-	for _zvars in $_mirrline
-	do
-		echo "Looping through _zvars: $_zvars" >>${LOGOUT}
-		echo "$_zvars" | grep "${2}" >/dev/null 2>/dev/null
-		if [ "$?" = "0" ] ; then continue ; fi
-		if [ -z "$_zvars" ] ; then continue ; fi
+setup_zfs_mirror_parts()
+{
+  _nZFS=""
 
-		is_disk "$_zvars" >/dev/null 2>/dev/null
-		if [ "$?" = "0" ] ; then
-		echo "Setting up ZFS mirror disk $_zvars" >>${LOGOUT}
-		init_gpt_full_disk "$_zvars" >/dev/null 2>/dev/null
-          	rc_halt "gpart bootcode -p /boot/gptzfsboot -i 1 ${_zvars}" >/dev/null 2>/dev/null
-          	rc_halt "gpart add -t freebsd-zfs ${_zvars}" >/dev/null 2>/dev/null
-			_nZFS="$_nZFS ${_zvars}p2"	
-		else
-			_nZFS="$_nZFS ${_zvars}"	
-		fi	
-	done
-	echo "mirror $2 `echo $_nZFS | tr -s ' '`"
+  # Using mirroring, setup boot partitions on each disk
+  _mirrline="`echo ${1} | sed 's|mirror ||g'`"
+  for _zvars in $_mirrline
+  do
+    echo "Looping through _zvars: $_zvars" >>${LOGOUT}
+    echo "$_zvars" | grep "${2}" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ] ; then continue ; fi
+    if [ -z "$_zvars" ] ; then continue ; fi
+
+    is_disk "$_zvars" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ] ; then
+      echo "Setting up ZFS mirror disk $_zvars" >>${LOGOUT}
+      init_gpt_full_disk "$_zvars" >/dev/null 2>/dev/null
+      rc_halt "gpart bootcode -p /boot/gptzfsboot -i 1 ${_zvars}" >/dev/null 2>/dev/null
+      rc_halt "gpart add -t freebsd-zfs ${_zvars}" >/dev/null 2>/dev/null
+      _nZFS="$_nZFS ${_zvars}p2"	
+    else
+      _nZFS="$_nZFS ${_zvars}"	
+    fi	
+  done
+  echo "mirror $2 `echo $_nZFS | tr -s ' '`"
 } ;
 
 # Function which creates a unique label name for the specified mount
@@ -139,217 +158,32 @@
   export VAL
 };
 
-# Function to setup / stamp a legacy MBR bsdlabel
-setup_mbr_partitions()
+# Function to setup partitions using gpart
+setup_gpart_partitions()
 {
-
-  DISKTAG="$1"
-  WRKSLICE="$2"
+  local _dTag="$1"
+  local _pDisk="$2"
+  local _wSlice="$3"
+  local _sNum="$4"
+  local _pType="$5"
   FOUNDPARTS="1"
 
+  # Lets read in the config file now and setup our partitions
+  if [ "${_pType}" = "gpt" ] ; then
+    CURPART="2"
+  else
+    PARTLETTER="a"
+    CURPART="1"
+    rc_halt "gpart create -s BSD ${_wSlice}"
+  fi
 
-  # Lets setup the BSDLABEL
-  BSDLABEL="${TMPDIR}/bsdLabel-${WRKSLICE}"
-  export BSDLABEL
-  rm $BSDLABEL >/dev/null 2>/dev/null
-  echo "# /dev/${WRKSLICE}" >>$BSDLABEL
-  echo "8 partitions:" >>$BSDLABEL
-  echo "#	size	offset	fstype	bsize	bps/cpg" >>$BSDLABEL
-   
-  PARTLETTER="a"
-
-  # Lets read in the config file now and populate this
   while read line
   do
     # Check for data on this slice
-    echo $line | grep "^${DISKTAG}-part=" >/dev/null 2>/dev/null
+    echo $line | grep "^${_dTag}-part=" >/dev/null 2>/dev/null
     if [ "$?" = "0" ]
     then
-      # Found a slice- entry, lets get the slice info
-      get_value_from_string "${line}"
-      STRING="$VAL"
       FOUNDPARTS="0"
-
-      # We need to split up the string now, and pick out the variables
-      FS=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 1` 
-      SIZE=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 2` 
-      MNT=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 3` 
-
-      # Check if we have a .eli extension on this FS
-      echo ${FS} | grep ".eli" >/dev/null 2>/dev/null
-      if [ "$?" = "0" ]
-      then
-        FS="`echo ${FS} | cut -d '.' -f 1`"
-        ENC="ON"
-        check_for_enc_pass "${line}"
-        if [ "${VAL}" != "" ] ; then
-          # We have a user supplied password, save it for later
-          ENCPASS="${VAL}" 
-        fi
-      else
-        ENC="OFF"
-      fi
-
-      # Check if the user tried to setup / as an encrypted partition
-      check_for_mount "${MNT}" "/"
-      if [ "${?}" = "0" -a "${ENC}" = "ON" ]
-      then
-        USINGENCROOT="0" ; export USINGENCROOT
-      fi
-          
-      # Now check that these values are sane
-      case $FS in
-       UFS|UFS+S|UFS+J|ZFS|SWAP) ;;
-       *) exit_err "ERROR: Invalid file system specified on $line" ;;
-      esac
-
-      # Check that we have a valid size number
-      expr $SIZE + 1 >/dev/null 2>/dev/null
-      if [ "$?" != "0" ]; then
-        exit_err "ERROR: The size specified on $line is invalid"
-      fi
-
-      # Check that the mount-point starts with /
-      echo "$MNT" | grep -e "^/" -e "^none" >/dev/null 2>/dev/null
-      if [ "$?" != "0" ]; then
-        exit_err "ERROR: The mount-point specified on $line is invalid"
-      fi
-
-      if [ "$SIZE" = "0" ]
-      then
-        SOUT="*"
-      else
-        SOUT="${SIZE}M"
-      fi
-
-      # OK, we passed all tests, now lets put these values into a config
-      # If the part
-      if [ "${PARTLETTER}" = "a" ]
-      then
-        if [ "$FS" = "SWAP" ]
-        then
-          echo "a:	${SOUT}	*	swap	0	0" >>${BSDLABEL}
-        else
-          echo "a:	${SOUT}	0	4.2BSD	0	0" >>${BSDLABEL}
-        fi
-
-        # Check if we found a valid root partition
-        check_for_mount "${MNT}" "/"
-        if [ "$?" = "0" ] ; then
-            FOUNDROOT="0" ; export FOUNDROOT
-        fi
-
-        # Check if we have a "/boot" instead
-        check_for_mount "${MNT}" "/boot"
-        if [ "${?}" = "0" ] ; then
-          USINGBOOTPART="0" ; export USINGBOOTPART
-          if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" ]
-          then
-            exit_err "/boot partition must be formatted with UFS"
-          fi
-        fi
-
-      else
-        # Done with the a: partitions
-
-        # Check if we found a valid root partition not on a:
-        check_for_mount "${MNT}" "/"
-        if [ "${?}" = "0" ] ; then
-          FOUNDROOT="1" ; export FOUNDROOT
-        fi
-
-        # Check if we have a /boot partition, and fail since its not first
-        check_for_mount "${MNT}" "/boot"
-        if [ "${?}" = "0" ] ; then
-          exit_err "/boot partition must be first partition"
-        fi
-
-
-        if [ "$FS" = "SWAP" ]
-        then
-          echo "${PARTLETTER}:	${SOUT}	*	swap" >>${BSDLABEL}
-        else
-          echo "${PARTLETTER}:	${SOUT}	*	4.2BSD" >>${BSDLABEL}
-        fi
-      fi
-
-      # Generate a unique label name for this mount
-      gen_glabel_name "${MNT}" "${FS}"
-      PLABEL="${VAL}"
-      
-      # Get any extra options for this fs / line
-      get_fs_line_xvars "${WRKSLICE}${PARTLETTER}" "${STRING}"
-      XTRAOPTS="${VAR}"
-
-      # Check if using zfs mirror
-      echo ${XTRAOPTS} | grep "mirror" >/dev/null 2>/dev/null
-      if [ "$?" = "0" ] ; then
-       	XTRAOPTS=$(setup_zfs_mirror_parts "$XTRAOPTS" "${WRKSLICE}${PARTLETTER}")
-      fi
-
-      # Save this data to our partition config dir
-      echo "${FS}:${MNT}:${ENC}:${PLABEL}:MBR:${XTRAOPTS}" >${PARTDIR}/${WRKSLICE}${PARTLETTER}
-
-      # If we have a enc password, save it as well
-      if [ ! -z "${ENCPASS}" ] ; then
-        echo "${ENCPASS}" >${PARTDIR}-enc/${WRKSLICE}${PARTLETTER}-encpass
-      fi
-
-      # This partition letter is used, get the next one
-      case ${PARTLETTER} in
-          a) PARTLETTER="b" ;;
-          b) # When we hit b, add the special c: setup for bsdlabel 
-             echo "c:	*	*	unused" >>${BSDLABEL}
-             PARTLETTER="d" ;;
-          d) PARTLETTER="e" ;;
-          e) PARTLETTER="f" ;;
-          f) PARTLETTER="g" ;;
-          g) PARTLETTER="h" ;;
-          h) PARTLETTER="ERR" ;;
-          *) exit_err "ERROR: bsdlabel only supports up to letter h for partitions." ;;
-      esac
-
-    fi # End of subsection locating a slice in config
-
-    echo $line | grep "^commitDiskLabel" >/dev/null 2>/dev/null
-    if [ "$?" = "0" -a "${FOUNDPARTS}" = "0" ]
-    then
-      # Found our flag to commit this label setup, check that we found at least 1 partition and do it
-      if [ "${PARTLETTER}" != "a" ]
-      then
-        # Check if we only had 1 partition, and make sure we add "c:" section to label
-        if [ "${PARTLETTER}" = "b" ]
-        then
-             echo "c:	*	*	unused" >>${BSDLABEL}
-        fi
-
-        echo "bsdlabel -R -B /dev/${WRKSLICE} ${BSDLABEL}"
-        bsdlabel -R -B ${WRKSLICE} ${BSDLABEL}
-
-        break
-      else
-        exit_err "ERROR: commitDiskLabel was called without any partition entries for it!"
-      fi
-    fi
-  done <${CFGF}
-};
-
-# Function to setup partitions using gpt
-setup_gpt_partitions()
-{
-  DISKTAG="$1"
-  DISK="$2"
-  FOUNDPARTS="1"
-
-  # Lets read in the config file now and setup our GPT partitions
-  CURPART="2"
-  while read line
-  do
-    # Check for data on this slice
-    echo $line | grep "^${DISKTAG}-part=" >/dev/null 2>/dev/null
-    if [ "$?" = "0" ]
-    then
-      FOUNDPARTS="0"
       # Found a slice- entry, lets get the slice info
       get_value_from_string "${line}"
       STRING="$VAL"
@@ -383,7 +217,7 @@
           
       # Now check that these values are sane
       case $FS in
-       UFS|UFS+S|UFS+J|ZFS|SWAP) ;;
+        UFS|UFS+S|UFS+J|UFS+SUJ|ZFS|SWAP) ;;
        *) exit_err "ERROR: Invalid file system specified on $line" ;;
       esac
 
@@ -409,24 +243,28 @@
       # Check if we found a valid root partition
       check_for_mount "${MNT}" "/"
       if [ "${?}" = "0" ] ; then
-        if [ "${CURPART}" = "2" ] ; then
+        FOUNDROOT="1" ; export FOUNDROOT
+        if [ "${CURPART}" = "2" -a "$_pType" = "gpt" ] ; then
           FOUNDROOT="0" ; export FOUNDROOT
-        else
-          FOUNDROOT="1" ; export FOUNDROOT
         fi
+        if [ "${CURPART}" = "1" -a "$_pType" = "mbr" ] ; then
+          FOUNDROOT="0" ; export FOUNDROOT
+        fi
       fi
 
       check_for_mount "${MNT}" "/boot"
       if [ "${?}" = "0" ] ; then
-        if [ "${CURPART}" = "2" ] ; then
-          USINGBOOTPART="0" ; export USINGBOOTPART
-          if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" ]
-          then
-            exit_err "/boot partition must be formatted with UFS"
-          fi
-        else
+        USINGBOOTPART="0" ; export USINGBOOTPART
+        if [ "${CURPART}" != "2" -a "${_pType}" = "gpt" ] ; then
             exit_err "/boot partition must be first partition"
         fi
+        if [ "${CURPART}" != "1" -a "${_pType}" = "mbr" ] ; then
+            exit_err "/boot partition must be first partition"
+        fi
+
+        if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" -a "${FS}" != "UFS+SUJ" ] ; then
+          exit_err "/boot partition must be formatted with UFS"
+        fi
       fi
 
       # Generate a unique label name for this mount
@@ -434,24 +272,36 @@
       PLABEL="${VAL}"
 
       # Get any extra options for this fs / line
-      get_fs_line_xvars "${DISK}p${CURPART}" "${STRING}"
+      if [ "${_pType}" = "gpt" ] ; then
+        get_fs_line_xvars "${_pDisk}p${CURPART}" "${STRING}"
+      else
+        get_fs_line_xvars "${_wSlice}" "${STRING}"
+      fi
       XTRAOPTS="${VAR}"
 
       # Check if using zfs mirror
       echo ${XTRAOPTS} | grep "mirror" >/dev/null 2>/dev/null
       if [ "$?" = "0" ] ; then
-       	XTRAOPTS=$(setup_zfs_mirror_parts "$XTRAOPTS" "${DISK}p${CURPART}")
+        if [ "${_pType}" = "gpt" ] ; then
+       	  XTRAOPTS=$(setup_zfs_mirror_parts "$XTRAOPTS" "${_pDisk}p${CURPART}")
+        else
+       	  XTRAOPTS=$(setup_zfs_mirror_parts "$XTRAOPTS" "${_wSlice}")
+        fi
       fi
 
       # Figure out the gpart type to use
       case ${FS} in
-          ZFS) PARTYPE="freebsd-zfs" ;;
-         SWAP) PARTYPE="freebsd-swap" ;;
-            *) PARTYPE="freebsd-ufs" ;;
+        ZFS) PARTYPE="freebsd-zfs" ;;
+        SWAP) PARTYPE="freebsd-swap" ;;
+        *) PARTYPE="freebsd-ufs" ;;
       esac
 
       # Create the partition
-      rc_halt "gpart add ${SOUT} -t ${PARTYPE} ${DISK}"
+      if [ "${_pType}" = "gpt" ] ; then
+        rc_halt "gpart add ${SOUT} -t ${PARTYPE} ${_pDisk}"
+      else
+        rc_halt "gpart add ${SOUT} -t ${PARTYPE} -i ${CURPART} ${_wSlice}"
+      fi
 
       # Check if this is a root / boot partition, and stamp the right loader
       for TESTMNT in `echo ${MNT} | sed 's|,| |g'`
@@ -465,20 +315,54 @@
       done 
 
       # Save this data to our partition config dir
-      echo "${FS}:${MNT}:${ENC}:${PLABEL}:GPT:${XTRAOPTS}" >${PARTDIR}/${DISK}p${CURPART}
+      if [ "${_pType}" = "gpt" ] ; then
+        echo "${FS}:${MNT}:${ENC}:${PLABEL}:GPT:${XTRAOPTS}" >${PARTDIR}/${_pDisk}p${CURPART}
 
-      # Clear out any headers
-      sleep 2
-      dd if=/dev/zero of=${DISK}p${CURPART} count=2048 >/dev/null 2>/dev/null
+        # Clear out any headers
+        sleep 2
+        dd if=/dev/zero of=${_pDisk}p${CURPART} count=2048 >/dev/null 2>/dev/null
 
-      # If we have a enc password, save it as well
-      if [ ! -z "${ENCPASS}" ] ; then
-        echo "${ENCPASS}" >${PARTDIR}-enc/${DISK}p${CURPART}-encpass
+        # If we have a enc password, save it as well
+        if [ ! -z "${ENCPASS}" ] ; then
+          echo "${ENCPASS}" >${PARTDIR}-enc/${_pDisk}p${CURPART}-encpass
+        fi
+      else
+	# MBR Partition
+        echo "${FS}:${MNT}:${ENC}:${PLABEL}:MBR:${XTRAOPTS}:${IMAGE}" >${PARTDIR}/${_wSlice}${PARTLETTER}
+        # Clear out any headers
+        sleep 2
+        dd if=/dev/zero of=${_wSlice}${PARTLETTER} count=2048 >/dev/null 2>/dev/null
+
+        # If we have a enc password, save it as well
+        if [ ! -z "${ENCPASS}" ] ; then
+          echo "${ENCPASS}" >${PARTDIR}-enc/${_wSlice}${PARTLETTER}-encpass
+        fi
       fi
 
+
       # Increment our parts counter
-      CURPART="`expr ${CURPART} + 1`"
+      if [ "$_pType" = "gpt" ] ; then 
+        CURPART="`expr ${CURPART} + 1`"
+        # If this is a gpt partition, we can continue and skip the MBR part letter stuff
+        continue
+      else
+        CURPART="`expr ${CURPART} + 1`"
+        if [ "$CURPART" = "3" ] ; then CURPART="4" ; fi
+      fi
 
+
+      # This partition letter is used, get the next one
+      case ${PARTLETTER} in
+        a) PARTLETTER="b" ;;
+        b) PARTLETTER="d" ;;
+        d) PARTLETTER="e" ;;
+        e) PARTLETTER="f" ;;
+        f) PARTLETTER="g" ;;
+        g) PARTLETTER="h" ;;
+        h) PARTLETTER="ERR" ;;
+        *) exit_err "ERROR: bsdlabel only supports up to letter h for partitions." ;;
+      esac
+
     fi # End of subsection locating a slice in config
 
     echo $line | grep "^commitDiskLabel" >/dev/null 2>/dev/null
@@ -486,13 +370,17 @@
     then
 
       # If this is the boot disk, stamp the right gptboot
-      if [ ! -z "${BOOTTYPE}" ] ; then
+      if [ ! -z "${BOOTTYPE}" -a "$_pType" = "gpt" ] ; then
         case ${BOOTTYPE} in
-           freebsd-ufs) rc_halt "gpart bootcode -p /boot/gptboot -i 1 ${DISK}" ;;
-           freebsd-zfs) rc_halt "gpart bootcode -p /boot/gptzfsboot -i 1 ${DISK}" ;;
+          freebsd-ufs) rc_halt "gpart bootcode -p /boot/gptboot -i 1 ${_pDisk}" ;;
+          freebsd-zfs) rc_halt "gpart bootcode -p /boot/gptzfsboot -i 1 ${_pDisk}" ;;
         esac 
       fi
 
+      # Make sure to stamp the MBR loader
+      if [ "$_pType" = "mbr" ] ; then
+	rc_halt "gpart bootcode -b /boot/boot ${_wSlice}"
+      fi
 
       # Found our flag to commit this label setup, check that we found at least 1 partition
       if [ "${CURPART}" = "2" ] ; then
@@ -532,15 +420,9 @@
     exit_err "ERROR: Missing SLICETAG data. This shouldn't happen - please let the developers know"
   fi
 
-  # Using Traditional MBR for dual-booting
-  if [ "$type" = "mbr" ] ; then
-    setup_mbr_partitions "${disktag}" "${wrkslice}"
-  fi
 
-  # Using entire disk mode, use GPT for this
-  if [ "$type" = "gpt" ] ; then
-    setup_gpt_partitions "${disktag}" "${disk}"
-  fi
+  # Setup the partitions with gpart
+  setup_gpart_partitions "${disktag}" "${disk}" "${wrkslice}" "${slicenum}" "${type}"
 
 };
 
@@ -548,7 +430,6 @@
 setup_disk_label()
 {
   # We are ready to start setting up the label, lets read the config and do the actions
-
   # First confirm that we have a valid WORKINGSLICES
   if [ -z "${WORKINGSLICES}" ]; then
     exit_err "ERROR: No slices were setup! Please report this to the maintainers"
@@ -613,3 +494,176 @@
   fi
 };
 
+check_fstab_mbr()
+{
+  local SLICE
+  local FSTAB
+
+  if [ -z "$2" ]
+  then
+	return 1
+  fi
+
+  SLICE="$1"
+  FSTAB="$2/etc/fstab"
+
+  if [ -f "${FSTAB}" ]
+  then
+    PARTLETTER=`echo "$SLICE" | sed -E 's|^.+([a-h])$|\1|'`
+
+    cat "${FSTAB}" | awk '{ print $2 }' | grep -E '^/$' >/dev/null 2>&1
+    if [ "$?" = "0" ]
+    then
+      if [ "${PARTLETTER}" = "a" ]
+      then
+        FOUNDROOT="0"
+      else
+        FOUNDROOT="1"
+      fi
+
+      ROOTIMAGE="1"
+
+      export FOUNDROOT
+      export ROOTIMAGE
+    fi
+
+    cat "${FSTAB}" | awk '{ print $2 }' | grep -E '^/boot$' >/dev/null 2>&1
+    if [ "$?" = "0" ]
+    then
+      if [ "${PARTLETTER}" = "a" ]
+      then
+        USINGBOOTPART="0"
+      else 
+        exit_err "/boot partition must be first partition"
+      fi 
+      export USINGBOOTPART
+    fi
+
+    return 0
+  fi
+
+  return 1
+};
+
+check_fstab_gpt()
+{
+  local SLICE
+  local FSTAB
+
+  if [ -z "$2" ]
+  then
+	return 1
+  fi
+
+  SLICE="$1"
+  FSTAB="$2/etc/fstab"
+
+  if [ -f "${FSTAB}" ]
+  then
+    PARTNUMBER=`echo "${SLICE}" | sed -E 's|^.+p([0-9]*)$|\1|'`
+
+    cat "${FSTAB}" | awk '{ print $2 }' | grep -E '^/$' >/dev/null 2>&1
+    if [ "$?" = "0" ]
+    then
+      if [ "${PARTNUMBER}" = "2" ]
+      then
+        FOUNDROOT="0"
+      else
+        FOUNDROOT="1"
+      fi
+
+      ROOTIMAGE="1"
+
+      export FOUNDROOT
+      export ROOTIMAGE
+    fi
+
+    cat "${FSTAB}" | awk '{ print $2 }' | grep -E '^/boot$' >/dev/null 2>&1
+    if [ "$?" = "0" ]
+    then
+      if [ "${PARTNUMBER}" = "2" ]
+      then
+        USINGBOOTPART="0"
+      else 
+        exit_err "/boot partition must be first partition"
+      fi 
+      export USINGBOOTPART
+    fi
+
+    return 0
+  fi
+
+
+  return 1
+};
+
+check_disk_layout()
+{
+  local SLICES
+  local TYPE
+  local DISK
+  local RES
+  local F
+
+  DISK="$1"
+  TYPE="MBR"
+
+  if [ -z "${DISK}" ]
+  then
+	return 1
+  fi
+
+  SLICES_MBR=`ls /dev/${DISK}s[1-4]*[a-h]* 2>/dev/null`
+  SLICES_GPT=`ls /dev/${DISK}p[0-9]* 2>/dev/null`
+  SLICES_SLICE=`ls /dev/${DISK}[a-h]* 2>/dev/null`
+
+  if [ -n "${SLICES_MBR}" ]
+  then
+    SLICES="${SLICES_MBR}"
+    TYPE="MBR"
+    RES=0
+  fi
+  if [ -n "${SLICES_GPT}" ]
+  then
+    SLICES="${SLICES_GPT}"
+    TYPE="GPT"
+    RES=0
+  fi
+  if [ -n "${SLICES_SLICE}" ]
+  then
+    SLICES="${SLICES_SLICE}"
+    TYPE="MBR"
+    RES=0
+  fi
+  
+  for slice in ${SLICES}
+  do
+    F=1
+    mount ${slice} /mnt 2>/dev/null
+    if [ "$?" != "0" ]
+    then
+      continue
+    fi 
+
+    if [ "${TYPE}" = "MBR" ]
+    then
+	  check_fstab_mbr "${slice}" "/mnt"
+      F="$?"
+
+    elif [ "${TYPE}" = "GPT" ]
+    then
+	  check_fstab_gpt "${slice}" "/mnt"
+      F="$?"
+    fi 
+
+    if [ "${F}" = "0" ]
+    then
+      umount /mnt
+      break 
+    fi
+
+    umount /mnt
+  done
+
+  return ${RES}
+};

Modified: pcbsd/stable/pc-sysinstall/backend/functions-cleanup.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-cleanup.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-cleanup.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions which perform the final cleanup after an install
 
 # Finishes up with ZFS setup before unmounting
@@ -136,14 +162,15 @@
 
     # Unset EXT
     EXT=""
-    
+
     # Set mount options for file-systems
     case $PARTFS in
       UFS+J) MNTOPTS="rw,noatime,async" ;;
-       SWAP) MNTOPTS="sw" ;;
-	  *) MNTOPTS="rw,noatime" ;;
+      SWAP) MNTOPTS="sw" ;;
+      *) MNTOPTS="rw,noatime" ;;
     esac
 
+
     # Figure out if we are using a glabel, or the raw name for this entry
     if [ ! -z "${PARTLABEL}" ]
     then
@@ -269,7 +296,7 @@
 
      # If we have a passphrase, set it up now
      if [ -e "${PARTDIR}-enc/${PART}-encpass" ] ; then
-       cat ${PARTDIR}-enc/${PART}-encpass | geli setkey -S -n 0 -p -k ${KEYFILE} -K ${KEYFILE} ${PART}
+       geli setkey -J ${PARTDIR}-enc/${PART}-encpass -n 0 -p -k ${KEYFILE} -K ${KEYFILE} ${PART}
        geli configure -b ${PART}
      fi
 
@@ -364,30 +391,28 @@
 
 run_final_cleanup()
 {
+  # Check if we need to run any gmirror setup
+  ls ${MIRRORCFGDIR}/* >/dev/null 2>/dev/null
+  if [ "$?" = "0" ]
+  then
+    # Lets setup gmirror now
+    setup_gmirror
+  fi
 
- # Check if we need to run any gmirror setup
- ls ${MIRRORCFGDIR}/* >/dev/null 2>/dev/null
- if [ "$?" = "0" ]
- then
-   # Lets setup gmirror now
-   setup_gmirror
- fi
+  # Check if we need to save any geli keys
+  ls ${GELIKEYDIR}/* >/dev/null 2>/dev/null
+  if [ "$?" = "0" ]
+  then
+    # Lets setup geli loading
+    setup_geli_loading
+  fi
 
- # Check if we need to save any geli keys
- ls ${GELIKEYDIR}/* >/dev/null 2>/dev/null
- if [ "$?" = "0" ]
- then
-   # Lets setup geli loading
-   setup_geli_loading
- fi
+  # Set a hostname on the install system
+  setup_hostname
 
- # Set a hostname on the install system
- setup_hostname
+  # Set the root_pw if it is specified
+  set_root_pw
 
- # Set the root_pw if it is specified
- set_root_pw
-
- # Generate the fstab for the installed system
- setup_fstab
-
+  # Generate the fstab for the installed system
+  setup_fstab
 };

Modified: pcbsd/stable/pc-sysinstall/backend/functions-disk.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-disk.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-disk.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,14 +1,41 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions related to disk operations using gpart
 
 # See if device is a full disk or partition/slice
-is_disk() {
-	for _dsk in `sysctl -n kern.disks`
-	do
-		if [ "$_dsk" = "${1}" ] ; then return 0 ; fi
-	done
+is_disk()
+{
+  for _dsk in `sysctl -n kern.disks`
+  do
+    if [ "$_dsk" = "${1}" ] ; then return 0 ; fi
+  done
 
-	return 1
+  return 1
 }
 
 # Get a MBR partitions sysid
@@ -164,9 +191,9 @@
   for i in ${SLICES}
   do
     case $type in
-       MBR) name="${1}s${i}" ;;
-       GPT) name="${1}p${i}";;
-       *) name="${1}s${i}";;
+      MBR) name="${1}s${i}" ;;
+      GPT) name="${1}p${i}";;
+      *) name="${1}s${i}";;
     esac
     if [ -z "${RSLICES}" ]
     then
@@ -200,8 +227,16 @@
   VAL="${head}" ; export VAL
 };
 
+# Function which returns a target disks mediasize in sectors
+get_disk_mediasize()
+{
+  mediasize=`diskinfo -v ${1} | grep "# mediasize in sectors" | tr -s ' ' | cut -f 2`
+  VAL="${mediasize}" ; export VAL
+};
+
 # Function which exports all zpools, making them safe to overwrite potentially
-export_all_zpools() {
+export_all_zpools()
+{
   # Export any zpools
   for i in `zpool list -H -o name`
   do
@@ -298,144 +333,216 @@
   # We are ready to start setting up the disks, lets read the config and do the actions
   while read line
   do
-     echo $line | grep "^disk${disknum}=" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
+    echo $line | grep "^disk${disknum}=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
 
-       # Found a disk= entry, lets get the disk we are working on
-       get_value_from_string "${line}"
-       strip_white_space "$VAL"
-       DISK="$VAL"
+      # Found a disk= entry, lets get the disk we are working on
+      get_value_from_string "${line}"
+      strip_white_space "$VAL"
+      DISK="$VAL"
      
-       # Before we go further, lets confirm this disk really exists
-       if [ ! -e "/dev/${DISK}" ]
-       then
-         exit_err "ERROR: The disk ${DISK} does not exist!"
-       fi
+      # Before we go further, lets confirm this disk really exists
+      if [ ! -e "/dev/${DISK}" ]
+      then
+        exit_err "ERROR: The disk ${DISK} does not exist!"
+      fi
 
-       # Make sure we stop any gmirrors on this disk
-       stop_all_gmirror ${DISK}
+      # Make sure we stop any gmirrors on this disk
+      stop_all_gmirror ${DISK}
 
-       # Make sure we stop any geli stuff on this disk
-       stop_all_geli ${DISK}
+      # Make sure we stop any geli stuff on this disk
+      stop_all_geli ${DISK}
 
-       # Make sure we don't have any zpools loaded
-       stop_all_zfs
+      # Make sure we don't have any zpools loaded
+      stop_all_zfs
 
-     fi
+    fi
 
-     # Lets look if this device will be mirrored on another disk
-     echo $line | grep "^mirror=" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
+    # Lets look if this device will be mirrored on another disk
+    echo $line | grep "^mirror=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
 
-       # Found a disk= entry, lets get the disk we are working on
-       get_value_from_string "${line}"
-       strip_white_space "$VAL"
-       MIRRORDISK="$VAL"
+      # Found a disk= entry, lets get the disk we are working on
+      get_value_from_string "${line}"
+      strip_white_space "$VAL"
+      MIRRORDISK="$VAL"
      
-       # Before we go further, lets confirm this disk really exists
-       if [ ! -e "/dev/${MIRRORDISK}" ]
-       then
-         exit_err "ERROR: The mirror disk ${MIRRORDISK} does not exist!"
-       fi
-     fi
+      # Before we go further, lets confirm this disk really exists
+      if [ ! -e "/dev/${MIRRORDISK}" ]
+      then
+        exit_err "ERROR: The mirror disk ${MIRRORDISK} does not exist!"
+      fi
+    fi
 
-     # Lets see if we have been given a mirror balance choice
-     echo $line | grep "^mirrorbal=" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
+    # Lets see if we have been given a mirror balance choice
+    echo $line | grep "^mirrorbal=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
 
-       # Found a disk= entry, lets get the disk we are working on
-       get_value_from_string "${line}"
-       strip_white_space "$VAL"
-       MIRRORBAL="$VAL"
-     fi
+      # Found a disk= entry, lets get the disk we are working on
+      get_value_from_string "${line}"
+      strip_white_space "$VAL"
+      MIRRORBAL="$VAL"
+    fi
 
-     echo $line | grep "^partition=" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
-       # Found a partition= entry, lets read / set it 
-       get_value_from_string "${line}"
-       strip_white_space "$VAL"
-       PTYPE="$VAL"
+    echo $line | grep "^partition=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      # Found a partition= entry, lets read / set it 
+      get_value_from_string "${line}"
+      strip_white_space "$VAL"
+      PTYPE=`echo $VAL|tr A-Z a-z`
 
-       # We are using free space, figure out the slice number
-       if [ "${PTYPE}" = "free" -o "${PTYPE}" = "FREE" ]
-       then
-         # Lets figure out what number this slice will be
-         LASTSLICE="`gpart show ${DISK} | grep -v ${DISK} | grep -v ' free' |tr -s '\t' ' ' | cut -d ' ' -f 4 | sed '/^$/d' | tail -n 1`"
-         if [ -z "${LASTSLICE}" ]
-         then
-           LASTSLICE="1"
-         else
-           LASTSLICE="`expr $LASTSLICE + 1`"
-         fi
+      # We are using free space, figure out the slice number
+      if [ "${PTYPE}" = "free" ]
+      then
+        # Lets figure out what number this slice will be
+        LASTSLICE="`gpart show ${DISK} \
+          | grep -v ${DISK} \
+          | grep -v ' free' \
+          | tr -s '\t' ' ' \
+          | cut -d ' ' -f 4 \
+          | sed '/^$/d' \
+          | tail -n 1`"
 
-         if [ $LASTSLICE -gt 4 ]
-         then
-           exit_err "ERROR: BSD only supports primary partitions, and there are none availble on $DISK"
-         fi
+        if [ -z "${LASTSLICE}" ]
+        then
+          LASTSLICE="1"
+        else
+          LASTSLICE="`expr $LASTSLICE + 1`"
+        fi
 
-       fi
-     fi
+        if [ $LASTSLICE -gt 4 ]
+        then
+          exit_err "ERROR: BSD only supports primary partitions, and there are none availble on $DISK"
+        fi
 
-     echo $line | grep "^bootManager=" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
-       # Found a bootManager= entry, lets read /set it
-       get_value_from_string "${line}"
-       strip_white_space "$VAL"
-       BMANAGER="$VAL"
-     fi
+      fi
+    fi
 
-     echo $line | grep "^commitDiskPart" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
-       # Found our flag to commit this disk setup / lets do sanity check and do it
-       if [ ! -z "${DISK}" -a ! -z "${PTYPE}" ]
-       then
-         case ${PTYPE} in
-                   all|ALL) tmpSLICE="${DISK}p1"  
-                        run_gpart_full "${DISK}" "${BMANAGER}" ;;
-           s1|s2|s3|s4) tmpSLICE="${DISK}${PTYPE}" 
-                        # Get the number of the slice we are working on
-                        s="`echo ${PTYPE} | awk '{print substr($0,length,1)}'`" 
-                        run_gpart_slice "${DISK}" "${BMANAGER}" "${s}" ;;
-                 free|FREE) tmpSLICE="${DISK}s${LASTSLICE}"
-                        run_gpart_free "${DISK}" "${LASTSLICE}" "${BMANAGER}" ;;
-                     *) exit_err "ERROR: Unknown PTYPE: $PTYPE" ;;
-         esac
+    # Check if we have an image file defined
+    echo $line | grep "^image=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ] ; then
+      # Found an image= entry, lets read / set it
+      get_value_from_string "${line}"
+      strip_white_space "$VAL"
+      IMAGE="$VAL"
+      if [ ! -f "$IMAGE" ] ; then
+        exit_err "$IMAGE file does not exist"
+      fi
+    fi
 
-         # Now save which disk<num> this is, so we can parse it later during slice partition setup
-         echo "disk${disknum}" >${SLICECFGDIR}/$tmpSLICE
+    # Check if we have a partscheme specified
+    echo $line | grep "^partscheme=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ] ; then
+      # Found a partscheme= entry, lets read / set it 
+      get_value_from_string "${line}"
+      strip_white_space "$VAL"
+      PSCHEME="$VAL"
+      if [ "$PSCHEME" != "GPT" -a "$PSCHEME" != "MBR" ] ; then
+        exit_err "Unknown partition scheme: $PSCHEME" 
+      fi
+    fi
 
-         # Save any mirror config
-         if [ ! -z "$MIRRORDISK" ]
-         then
-           # Default to round-robin if the user didn't specify
-           if [ -z "$MIRRORBAL" ]
-           then
-             MIRRORBAL="round-robin"
-           fi
-           echo "$MIRRORDISK:$MIRRORBAL" >${MIRRORCFGDIR}/$DISK
-         fi
+    echo $line | grep "^bootManager=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      # Found a bootManager= entry, lets read /set it
+      get_value_from_string "${line}"
+      strip_white_space "$VAL"
+      BMANAGER="$VAL"
+    fi
 
+    echo $line | grep "^commitDiskPart" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      # Found our flag to commit this disk setup / lets do sanity check and do it
+      if [ ! -z "${DISK}" -a ! -z "${PTYPE}" ]
+      then
+        case ${PTYPE} in
+          all)
+            if [ "$PSCHEME" = "MBR" -o -z "$PSCHEME" ] ; then
+              PSCHEME="MBR"
+              tmpSLICE="${DISK}s1"  
+            else
+              tmpSLICE="${DISK}p1"  
+            fi
 
-         # Increment our disk counter to look for next disk and unset
-         unset BMANAGER PTYPE DISK MIRRORDISK MIRRORBAL
-         disknum="`expr $disknum + 1`"
-       else
-         exit_err "ERROR: commitDiskPart was called without procceding disk<num>= and partition= entries!!!" 
-       fi
-     fi
+            run_gpart_full "${DISK}" "${BMANAGER}" "${PSCHEME}"
+            ;;
 
+          s1|s2|s3|s4)
+            tmpSLICE="${DISK}${PTYPE}" 
+            # Get the number of the slice we are working on
+            s="`echo ${PTYPE} | awk '{print substr($0,length,1)}'`" 
+            run_gpart_slice "${DISK}" "${BMANAGER}" "${s}"
+            ;;
+
+          free)
+            tmpSLICE="${DISK}s${LASTSLICE}"
+            run_gpart_free "${DISK}" "${LASTSLICE}" "${BMANAGER}"
+            ;;
+
+          image)
+            if [ -z "${IMAGE}" ]
+            then
+              exit_err "ERROR: partition type image specified with no image!"
+            fi 
+            ;;
+
+          *) exit_err "ERROR: Unknown PTYPE: $PTYPE" ;;
+        esac
+        
+
+		if [ -n "${IMAGE}" ]
+		then 
+          local DEST
+          
+		  if [ -n "${tmpSLICE}" ]
+          then
+			DEST="${tmpSLICE}"
+          else 
+			DEST="${DISK}"
+          fi 
+
+          write_image "${IMAGE}" "${DEST}"
+          check_disk_layout "${DEST}"
+		fi
+
+        # Now save which disk<num> this is, so we can parse it later during slice partition setup
+        if [ -z "${IMAGE}" ]
+        then
+          echo "disk${disknum}" >${SLICECFGDIR}/$tmpSLICE
+        fi
+
+        # Save any mirror config
+        if [ ! -z "$MIRRORDISK" ]
+        then
+          # Default to round-robin if the user didn't specify
+          if [ -z "$MIRRORBAL" ]
+          then
+            MIRRORBAL="round-robin"
+          fi
+          echo "$MIRRORDISK:$MIRRORBAL" >${MIRRORCFGDIR}/$DISK
+        fi
+
+        # Increment our disk counter to look for next disk and unset
+        unset BMANAGER PTYPE DISK MIRRORDISK MIRRORBAL PSCHEME IMAGE
+        disknum="`expr $disknum + 1`"
+      else
+        exit_err "ERROR: commitDiskPart was called without procceding disk<num>= and partition= entries!!!" 
+      fi
+    fi
+
   done <${CFGF}
 
 };
 
 # Stop all gjournals on disk / slice
-stop_gjournal() {
+stop_gjournal()
+{
   _gdsk="$1"
   # Check if we need to shutdown any journals on this drive
   ls /dev/${_gdsk}*.journal >/dev/null 2>/dev/null
@@ -451,7 +558,7 @@
   fi
 } ;
 
-# Function which runs gpart and creates a single large slice
+# Function which runs gpart and creates a single large GPT partition scheme
 init_gpt_full_disk()
 {
   _intDISK=$1
@@ -473,22 +580,96 @@
 
   echo_log "Running gpart on ${_intDISK}"
   rc_halt "gpart create -s GPT ${_intDISK}"
-  rc_halt "gpart add -b 34 -s 128 -t freebsd-boot ${_intDISK}"
+  rc_halt "gpart add -b 34 -s 1982 -t freebsd-boot ${_intDISK}"
   
   echo_log "Stamping boot sector on ${_intDISK}"
   rc_halt "gpart bootcode -b /boot/pmbr ${_intDISK}"
 
 }
 
+# Function which runs gpart and creates a single large MBR partition scheme
+init_mbr_full_disk()
+{
+  _intDISK=$1
+  _intBOOT=$2
+ 
+  startblock="2016"
+
+  # Set our sysctl so we can overwrite any geom using drives
+  sysctl kern.geom.debugflags=16 >>${LOGOUT} 2>>${LOGOUT}
+
+  # Stop any journaling
+  stop_gjournal "${_intDISK}"
+
+  # Remove any existing partitions
+  delete_all_gpart "${_intDISK}"
+
+  #Erase any existing bootloader
+  echo_log "Cleaning up ${_intDISK}"
+  rc_halt "dd if=/dev/zero of=/dev/${_intDISK} count=2048"
+
+  sleep 2
+
+  echo_log "Running gpart on ${_intDISK}"
+  rc_halt "gpart create -s mbr ${_intDISK}"
+
+  # Lets figure out disk size in blocks
+  # Get the cyl of this disk
+  get_disk_cyl "${_intDISK}"
+  cyl="${VAL}"
+
+  # Get the heads of this disk
+  get_disk_heads "${_intDISK}"
+  head="${VAL}"
+
+  # Get the tracks/sectors of this disk
+  get_disk_sectors "${_intDISK}"
+  sec="${VAL}"
+
+  # Multiply them all together to get our total blocks
+  totalblocks="`expr ${cyl} \* ${head}`"
+  totalblocks="`expr ${totalblocks} \* ${sec}`"
+  if [ -z "${totalblocks}" ]
+  then
+    totalblocks=`gpart show "${_intDISK}"|tail -2|head -1|awk '{ print $2 }'`
+  fi
+
+  # Now set the ending block to the total disk block size
+  sizeblock="`expr ${totalblocks} - ${startblock}`"
+
+  # Install new partition setup
+  echo_log "Running gpart add on ${_intDISK}"
+  rc_halt "gpart add -b ${startblock} -s ${sizeblock} -t freebsd -i 1 ${_intDISK}"
+  sleep 2
+  
+  echo_log "Cleaning up ${_intDISK}s1"
+  rc_halt "dd if=/dev/zero of=/dev/${_intDISK}s1 count=1024"
+  
+  if [ "$_intBOOT" = "bsd" ] ; then
+    echo_log "Stamping boot0 on ${_intDISK}"
+    rc_halt "gpart bootcode -b /boot/boot0 ${_intDISK}"
+  else
+    echo_log "Stamping boot1 on ${_intDISK}"
+    rc_halt "gpart bootcode -b /boot/boot1 ${_intDISK}"
+  fi
+
+}
+
 # Function which runs gpart and creates a single large slice
 run_gpart_full()
 {
   DISK=$1
+  BOOT=$2
+  SCHEME=$3
 
-  init_gpt_full_disk "$DISK"
+  if [ "$SCHEME" = "MBR" ] ; then
+    init_mbr_full_disk "$DISK" "$BOOT"
+    slice="${DISK}-1-mbr"
+  else
+    init_gpt_full_disk "$DISK"
+    slice="${DISK}-1-gpt"
+  fi
 
-  slice="${DISK}-1-gpt"
-
   # Lets save our slice, so we know what to look for in the config file later on
   if [ -z "$WORKINGSLICES" ]
   then

Modified: pcbsd/stable/pc-sysinstall/backend/functions-extractimage.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-extractimage.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-extractimage.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions which perform the extraction / installation of system to disk
 
 . ${BACKEND}/functions-mountoptical.sh
@@ -28,39 +54,41 @@
   echo_log "pc-sysinstall: Starting Extraction"
 
   case ${PACKAGETYPE} in
-   uzip) # Start by mounting the uzip image
-         MDDEVICE=`mdconfig -a -t vnode -o readonly -f ${INSFILE}`
-         mkdir -p ${FSMNT}.uzip
-         mount -r /dev/${MDDEVICE}.uzip ${FSMNT}.uzip
-         if [ "$?" != "0" ]
-         then
-           exit_err "ERROR: Failed mounting the ${INSFILE}"
-         fi
-         cd ${FSMNT}.uzip
+    uzip)
+	  # Start by mounting the uzip image
+      MDDEVICE=`mdconfig -a -t vnode -o readonly -f ${INSFILE}`
+      mkdir -p ${FSMNT}.uzip
+      mount -r /dev/${MDDEVICE}.uzip ${FSMNT}.uzip
+      if [ "$?" != "0" ]
+      then
+        exit_err "ERROR: Failed mounting the ${INSFILE}"
+      fi
+      cd ${FSMNT}.uzip
 
-         # Copy over all the files now!
-         tar cvf - . 2>/dev/null | tar -xpv -C ${FSMNT} ${TAROPTS} -f - 2>&1 | tee -a ${FSMNT}/.tar-extract.log
-         if [ "$?" != "0" ]
-         then
-           cd /
-           echo "TAR failure occured:" >>${LOGOUT}
-           cat ${FSMNT}/.tar-extract.log | grep "tar:" >>${LOGOUT}
-           umount ${FSMNT}.uzip
-           mdconfig -d -u ${MDDEVICE}
-           exit_err "ERROR: Failed extracting the tar image"
-         fi
+      # Copy over all the files now!
+      tar cvf - . 2>/dev/null | tar -xpv -C ${FSMNT} ${TAROPTS} -f - 2>&1 | tee -a ${FSMNT}/.tar-extract.log
+      if [ "$?" != "0" ]
+      then
+        cd /
+        echo "TAR failure occurred:" >>${LOGOUT}
+        cat ${FSMNT}/.tar-extract.log | grep "tar:" >>${LOGOUT}
+        umount ${FSMNT}.uzip
+        mdconfig -d -u ${MDDEVICE}
+        exit_err "ERROR: Failed extracting the tar image"
+      fi
 
-         # All finished, now lets umount and cleanup
-         cd /
-         umount ${FSMNT}.uzip
-         mdconfig -d -u ${MDDEVICE}
-         ;;
-    tar) tar -xpv -C ${FSMNT} -f ${INSFILE} ${TAROPTS} >&1 2>&1
-         if [ "$?" != "0" ]
-         then
-           exit_err "ERROR: Failed extracting the tar image"
-         fi
-         ;;
+      # All finished, now lets umount and cleanup
+      cd /
+      umount ${FSMNT}.uzip
+      mdconfig -d -u ${MDDEVICE}
+       ;;
+    tar)
+	  tar -xpv -C ${FSMNT} -f ${INSFILE} ${TAROPTS} >&1 2>&1
+      if [ "$?" != "0" ]
+      then
+        exit_err "ERROR: Failed extracting the tar image"
+      fi
+      ;;
   esac
 
   # Check if this was a FTP download and clean it up now
@@ -94,10 +122,10 @@
   DIRS=`ls -d ${INSDIR}/*|grep -Ev '(uzip|kernels|src)'`
   for dir in ${DIRS}
   do
-	cd "${dir}"
-	if [ -f "install.sh" ]
-	then
-	  echo "Extracting" `basename ${dir}`
+    cd "${dir}"
+    if [ -f "install.sh" ]
+    then
+      echo_log "Extracting" `basename ${dir}`
       echo "y" | sh install.sh >/dev/null
       if [ "$?" != "0" ]
       then
@@ -113,13 +141,14 @@
   cd "${KERNELS}"
   if [ -f "install.sh" ]
   then
-	echo "Extracting" `basename ${KERNELS}`
+    echo_log "Extracting" `basename ${KERNELS}`
     echo "y" | sh install.sh generic >/dev/null
     if [ "$?" != "0" ]
     then
       exit_err "ERROR: Failed extracting ${KERNELS}"
     fi
-	echo 'kernel="GENERIC"' > "${FSMNT}/boot/loader.conf"
+    rm -rf "${FSMNT}/boot/kernel"
+    mv "${FSMNT}/boot/GENERIC" "${FSMNT}/boot/kernel"
   else
     exit_err "ERROR: ${KERNELS}/install.sh does not exist"
   fi
@@ -129,7 +158,7 @@
   cd "${SOURCE}"
   if [ -f "install.sh" ]
   then
-	echo "Extracting" `basename ${SOURCE}`
+    echo_log "Extracting" `basename ${SOURCE}`
     echo "y" | sh install.sh all >/dev/null
     if [ "$?" != "0" ]
     then
@@ -177,7 +206,76 @@
 
 };
 
-# Function which does the rsync download from the server specifed in cfg
+# Function which will download freebsd install files
+fetch_split_files()
+{
+  get_ftpHost
+  if [ -z "$VAL" ]
+  then
+    exit_err "ERROR: Install medium was set to ftp, but no ftpHost was provided!" 
+  fi
+  FTPHOST="${VAL}"
+
+  get_ftpDir
+  if [ -z "$VAL" ]
+  then
+    exit_err "ERROR: Install medium was set to ftp, but no ftpDir was provided!" 
+  fi
+  FTPDIR="${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
+
+  DIRS="base catpages dict doc games info manpages proflibs kernels src"
+  if [ "${FBSD_ARCH}" = "amd64" ]
+  then
+    DIRS="${DIRS} lib32"
+  fi
+
+  for d in ${DIRS}
+  do
+    mkdir -p "${OUTFILE}/${d}"
+  done
+
+
+  NETRC="${OUTFILE}/.netrc"
+  cat<<EOF>"${NETRC}"
+machine ${FTPHOST}
+login anonymous
+password anonymous
+macdef INSTALL
+bin
+prompt
+EOF
+
+  for d in ${DIRS}
+  do
+    cat<<EOF>>"${NETRC}"
+cd ${FTPDIR}/${d}
+lcd ${OUTFILE}/${d}
+mreget *
+EOF
+  done
+
+  cat<<EOF>>"${NETRC}"
+bye
+
+
+EOF
+
+  # Fetch the files via ftp
+  echo "$ INSTALL" | ftp -N "${NETRC}" "${FTPHOST}"
+
+  # Done fetching, now reset the INSFILE to our downloaded archived
+  INSFILE="${OUTFILE}" ; export INSFILE
+}
+
+# Function which does the rsync download from the server specified in cfg
 start_rsync_copy()
 {
   # Load our rsync config values
@@ -231,7 +329,47 @@
 
 };
 
+start_image_install()
+{
+  if [ -z "${IMAGE_FILE}" ]
+  then
+    exit_err "ERROR: installMedium set to image but no image file specified!"
+  fi
 
+  # We are ready to start mounting, lets read the config and do it
+  while read line
+  do
+    echo $line | grep "^disk0=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      # Found a disk= entry, lets get the disk we are working on
+      get_value_from_string "${line}"
+      strip_white_space "$VAL"
+      DISK="$VAL"
+    fi
+
+    echo $line | grep "^commitDiskPart" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      # Found our flag to commit this disk setup / lets do sanity check and do it
+      if [ ! -z "${DISK}" ]
+      then
+
+        # Write the image
+        write_image "${IMAGE_FILE}" "${DISK}"
+
+        # Increment our disk counter to look for next disk and unset
+        unset DISK
+        break
+
+      else
+        exit_err "ERROR: commitDiskPart was called without procceding disk<num>= and partition= entries!!!"
+      fi
+    fi
+
+  done <${CFGF}
+};
+
 # Entrance function, which starts the installation process
 init_extraction()
 {
@@ -246,19 +384,19 @@
     if [ "$INSTALLTYPE" = "FreeBSD" ]
     then
       case $PACKAGETYPE in
-         uzip) INSFILE="${FBSD_UZIP_FILE}" ;;
-          tar) INSFILE="${FBSD_TAR_FILE}" ;;
-		  split)
-			INSDIR="${FBSD_BRANCH_DIR}"
+        uzip) INSFILE="${FBSD_UZIP_FILE}" ;;
+        tar) INSFILE="${FBSD_TAR_FILE}" ;;
+        split)
+          INSDIR="${FBSD_BRANCH_DIR}"
 
-			# This is to trick opt_mount into not failing
-			INSFILE="${INSDIR}"
-			;;
+          # This is to trick opt_mount into not failing
+          INSFILE="${INSDIR}"
+          ;;
       esac
     else
       case $PACKAGETYPE in
-         uzip) INSFILE="${UZIP_FILE}" ;;
-          tar) INSFILE="${TAR_FILE}" ;;
+        uzip) INSFILE="${UZIP_FILE}" ;;
+        tar) INSFILE="${TAR_FILE}" ;;
       esac
     fi
     export INSFILE
@@ -266,24 +404,38 @@
 
   # Lets start by figuring out what medium we are using
   case ${INSTALLMEDIUM} in
- dvd|usb) # Lets start by mounting the disk 
-          opt_mount 
-		  if [ ! -z "${INSDIR}" ]
-		  then
-          	INSDIR="${CDMNT}/${INSDIR}" ; export INSDIR
-			start_extract_split
+    dvd|usb)
+      # Lets start by mounting the disk 
+      opt_mount 
+      if [ ! -z "${INSDIR}" ]
+      then
+        INSDIR="${CDMNT}/${INSDIR}" ; export INSDIR
+	    start_extract_split
 
-		  else
-          	INSFILE="${CDMNT}/${INSFILE}" ; export INSFILE
-          	start_extract_uzip_tar
-		  fi
-          ;;
-     ftp) fetch_install_file
-          start_extract_uzip_tar 
-          ;;
-     rsync) start_rsync_copy
-            ;;
-       *) exit_err "ERROR: Unknown install medium" ;;
+      else
+        INSFILE="${CDMNT}/${INSFILE}" ; export INSFILE
+        start_extract_uzip_tar
+      fi
+      ;;
+
+    ftp)
+      if [ "$PACKAGETYPE" = "split" ]
+      then
+        fetch_split_files
+
+        INSDIR="${INSFILE}" ; export INSDIR
+        start_extract_split
+      else
+        fetch_install_file
+        start_extract_uzip_tar 
+      fi
+      ;;
+
+    sftp) ;;
+
+    rsync) start_rsync_copy ;;
+    image) start_image_install ;;
+    *) exit_err "ERROR: Unknown install medium" ;;
   esac
 
 };

Modified: pcbsd/stable/pc-sysinstall/backend/functions-installcomponents.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-installcomponents.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-installcomponents.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions which check and load any optional modules specified in the config
 
 . ${BACKEND}/functions.sh
@@ -26,23 +52,27 @@
     CFILEMD5="`echo $line | cut -d ':' -f 2`"
     CFILE2MD5="`echo $line | cut -d ':' -f 3`"
 
-
     case ${INSTALLMEDIUM} in
-   dvd|usb) # On both dvd / usb, we can just copy the file
-            cp ${CDMNT}/${COMPFILEDIR}/${SUBDIR}/${CFILE} \
-		 ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT}
+      dvd|usb)
+        # On both dvd / usb, we can just copy the file
+        cp ${CDMNT}/${COMPFILEDIR}/${SUBDIR}/${CFILE} \
+		  ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT}
 	    RESULT="$?"
-            ;;
-       ftp) 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}" 
+        ;;
 
-            fetch_file "${FTPPATH}/${COMPFILEDIR}/${SUBDIR}/${CFILE}" "${FSMNT}/${COMPTMPDIR}/${CFILE}" "0"
-	    RESULT="$?"
-            ;;
+      ftp)
+        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}" 
+
+        fetch_file "${FTPPATH}/${COMPFILEDIR}/${SUBDIR}/${CFILE}" "${FSMNT}/${COMPTMPDIR}/${CFILE}" "0"
+        RESULT="$?"
+       ;;
+
+      sftp) ;;
     esac
 
     if [ "${RESULT}" != "0" ]
@@ -94,47 +124,44 @@
 sh ${COMPTMPDIR}/install.sh
 
 " >${FSMNT}/.componentwrapper.sh
-   chmod 755 ${FSMNT}/.componentwrapper.sh
+  chmod 755 ${FSMNT}/.componentwrapper.sh
    
-   # Copy over the install script for this component
-   cp ${COMPDIR}/${COMPONENT}/install.sh ${FSMNT}/${COMPTMPDIR}/
+  # Copy over the install script for this component
+  cp ${COMPDIR}/${COMPONENT}/install.sh ${FSMNT}/${COMPTMPDIR}/
 
-   echo_log "INSTALL COMPONENT: ${i}"
-   chroot ${FSMNT} /.componentwrapper.sh >>${LOGOUT} 2>>${LOGOUT}
-   rm ${FSMNT}/.componentwrapper.sh
+  echo_log "INSTALL COMPONENT: ${i}"
+  chroot ${FSMNT} /.componentwrapper.sh >>${LOGOUT} 2>>${LOGOUT}
+  rm ${FSMNT}/.componentwrapper.sh
 
-
 };
 
 # Check for any modules specified, and begin loading them
 install_components()
 {
-   # First, lets check and see if we even have any optional modules
-   get_value_from_cfg installComponents
-   if [ ! -z "${VAL}" ]
-   then
-      # Lets start by cleaning up the string and getting it ready to parse
-      strip_white_space ${VAL}
-      COMPONENTS=`echo ${VAL} | sed -e "s|,| |g"`
-      for i in $COMPONENTS
-      do
-        if [ ! -e "${COMPDIR}/${i}/install.sh" -o ! -e "${COMPDIR}/${i}/distfiles" ]
-        then
-	  echo_log "WARNING: Component ${i} doesn't seem to exist"
-        else
+  # First, lets check and see if we even have any optional modules
+  get_value_from_cfg installComponents
+  if [ ! -z "${VAL}" ]
+  then
+    # Lets start by cleaning up the string and getting it ready to parse
+    strip_white_space ${VAL}
+    COMPONENTS=`echo ${VAL} | sed -e "s|,| |g"`
+    for i in $COMPONENTS
+    do
+      if [ ! -e "${COMPDIR}/${i}/install.sh" -o ! -e "${COMPDIR}/${i}/distfiles" ]
+      then
+        echo_log "WARNING: Component ${i} doesn't seem to exist"
+      else
 
-          # Make the tmpdir on the disk
-          mkdir -p ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT}
+        # Make the tmpdir on the disk
+        mkdir -p ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT}
 
-          # Start by grabbing the component files
-          copy_component ${i}
+        # Start by grabbing the component files
+        copy_component ${i}
 
-          # Remove the tmpdir now
-          rm -rf ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT}
+        # Remove the tmpdir now
+        rm -rf ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT}
+      fi
+    done
+  fi
 
-        fi
-      done
-
-   fi
-
 };

Modified: pcbsd/stable/pc-sysinstall/backend/functions-localize.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-localize.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-localize.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions which runs commands on the system
 
 . ${BACKEND}/functions.sh
@@ -37,66 +63,66 @@
 
 localize_x_keyboard()
 {
-   KEYMOD="$1"
-   KEYLAY="$2"
-   KEYVAR="$3"
-   COUNTRY="$4"
-   OPTION="grp:alt_shift_toggle"
-   SETXKBMAP=""
+  KEYMOD="$1"
+  KEYLAY="$2"
+  KEYVAR="$3"
+  COUNTRY="$4"
+  OPTION="grp:alt_shift_toggle"
+  SETXKBMAP=""
 
-   if [ "${COUNTRY}" = "NONE" -o "${COUNTRY}" = "us" -o "${COUNTRY}" = "C" ] ; then
-     #In this case we don't need any additional language
-     COUNTRY=""
-     OPTION=""
-   else
-     COUNTRY=",${COUNTRY}"
-   fi
+  if [ "${COUNTRY}" = "NONE" -o "${COUNTRY}" = "us" -o "${COUNTRY}" = "C" ] ; then
+    #In this case we don't need any additional language
+    COUNTRY=""
+    OPTION=""
+  else
+    COUNTRY=",${COUNTRY}"
+  fi
 
-   if [ "${KEYMOD}" != "NONE" ]
-   then
-     SETXKBMAP="-model ${KEYMOD}"
-     KXMODEL="${KEYMOD}"
-   else
-     KXMODEL="pc104"
-   fi
+  if [ "${KEYMOD}" != "NONE" ]
+  then
+    SETXKBMAP="-model ${KEYMOD}"
+    KXMODEL="${KEYMOD}"
+  else
+    KXMODEL="pc104"
+  fi
 
-   if [ "${KEYLAY}" != "NONE" ]
-   then
-     localize_key_layout "$KEYLAY"
-     SETXKBMAP="${SETXKBMAP} -layout ${KEYLAY}"
-     KXLAYOUT="${KEYLAY}"
-   else
-     KXLAYOUT="us"
-   fi
+  if [ "${KEYLAY}" != "NONE" ]
+  then
+    localize_key_layout "$KEYLAY"
+    SETXKBMAP="${SETXKBMAP} -layout ${KEYLAY}"
+    KXLAYOUT="${KEYLAY}"
+  else
+    KXLAYOUT="us"
+  fi
 
-   if [ "${KEYVAR}" != "NONE" ]
-   then
-     SETXKBMAP="${SETXKBMAP} -variant ${KEYVAR}"
-     KXVAR="(${KEYVAR})"
-   else
-     KXVAR=""
-   fi
+  if [ "${KEYVAR}" != "NONE" ]
+  then
+    SETXKBMAP="${SETXKBMAP} -variant ${KEYVAR}"
+    KXVAR="(${KEYVAR})"
+  else
+    KXVAR=""
+  fi
 
-   # Setup .xprofile with our setxkbmap call now
-   if [ ! -z "${SETXKBMAP}" ]
-   then
-     if [ ! -e "${FSMNT}/usr/share/skel/.xprofile" ]
-     then
-       echo "#!/bin/sh" >${FSMNT}/usr/share/skel/.xprofile
-     fi
+  # Setup .xprofile with our setxkbmap call now
+  if [ ! -z "${SETXKBMAP}" ]
+  then
+    if [ ! -e "${FSMNT}/usr/share/skel/.xprofile" ]
+    then
+      echo "#!/bin/sh" >${FSMNT}/usr/share/skel/.xprofile
+    fi
 
-     # Save the keyboard layout for user / root X logins
-     echo "setxkbmap ${SETXKBMAP}" >>${FSMNT}/usr/share/skel/.xprofile
-     chmod 755 ${FSMNT}/usr/share/skel/.xprofile
-     cp ${FSMNT}/usr/share/skel/.xprofile ${FSMNT}/root/.xprofile
+    # Save the keyboard layout for user / root X logins
+    echo "setxkbmap ${SETXKBMAP}" >>${FSMNT}/usr/share/skel/.xprofile
+    chmod 755 ${FSMNT}/usr/share/skel/.xprofile
+    cp ${FSMNT}/usr/share/skel/.xprofile ${FSMNT}/root/.xprofile
 
-     # Save it for KDM
-     echo "setxkbmap ${SETXKBMAP}" >>${FSMNT}/usr/local/kde4/share/config/kdm/Xsetup
-   fi
+    # Save it for KDM
+    echo "setxkbmap ${SETXKBMAP}" >>${FSMNT}/usr/local/kde4/share/config/kdm/Xsetup
+  fi
  
 
    # Create the kxkbrc configuration using these options
-   echo "[Layout]
+  echo "[Layout]
 DisplayNames=${KXLAYOUT}${COUNTRY}
 IndicatorOnly=false
 LayoutList=${KXLAYOUT}${KXVAR}${COUNTRY}
@@ -185,157 +211,194 @@
   TARGETLANG="${1}"
   # Setup the presets for the specific lang
   case $TARGETLANG in
-   af) COUNTRY="C"
-       SETLANG="af"
-       LOCALE="af_ZA"
-       ;;
-   ar) COUNTRY="C"
-       SETLANG="ar"
-       LOCALE="en_US"
-       ;;
-   az) COUNTRY="C"
-       SETLANG="az"
-       LOCALE="en_US"
-       ;;
-   ca) COUNTRY="es"
-       SETLANG="es:ca"
-       LOCALE="ca_ES"
-       ;;
-   be) COUNTRY="be"
-       SETLANG="be"
-       LOCALE="be_BY"
-       ;;
-   bn) COUNTRY="bn"
-       SETLANG="bn"
-       LOCALE="en_US"
-       ;;
-   bg) COUNTRY="bg"
-       SETLANG="bg"
-       LOCALE="bg_BG"
-       ;;
-   cs) COUNTRY="cz"
-       SETLANG="cs"
-       LOCALE="cs_CZ"
-       ;;
-   da) COUNTRY="dk"
-       SETLANG="da"
-       LOCALE="da_DK"
-       ;;
-   de) COUNTRY="de"
-       SETLANG="de"
-       LOCALE="de_DE"
-       ;;
-   en_GB) COUNTRY="gb"
-       SETLANG="en_GB:cy"
-       LOCALE="en_GB"
-       ;;
-   el) COUNTRY="gr"
-       SETLANG="el:gr"
-       LOCALE="el_GR"
-       ;;
-   es) COUNTRY="es"
-       SETLANG="es"
-       LOCALE="es_ES"
-       ;;
-   es_LA) COUNTRY="us"
-          SETLANG="es:en_US"
-          LOCALE="es_ES"
-       ;;
-   et) COUNTRY="ee"
-       SETLANG="et"
-       LOCALE="et_EE"
-       ;;
-   fr) COUNTRY="fr"
-       SETLANG="fr"
-       LOCALE="fr_FR"
-       ;;
-   he) COUNTRY="il"
-       SETLANG="he:ar"
-       LOCALE="he_IL"
-       ;;
-   hr) COUNTRY="hr"
-       SETLANG="hr"
-       LOCALE="hr_HR"
-       ;;
-   hu) COUNTRY="hu"
-       SETLANG="hu"
-       LOCALE="hu_HU"
-       ;;
-   it) COUNTRY="it"
-       SETLANG="it"
-       LOCALE="it_IT"
-       ;;
-   ja) COUNTRY="jp"
-       SETLANG="ja"
-       LOCALE="ja_JP"
-       ;;
-   ko) COUNTRY="kr"
-       SETLANG="ko"
-       LOCALE="ko_KR"
-       ;;
-   nl) COUNTRY="nl"
-       SETLANG="nl"
-       LOCALE="nl_NL"
-       ;;
-   nn) COUNTRY="no"
-       SETLANG="nn"
-       LOCALE="en_US"
-       ;;
-   pa) COUNTRY="pa"
-       SETLANG="pa"
-       LOCALE="en_US"
-       ;;
-   pl) COUNTRY="pl"
-       SETLANG="pl"
-       LOCALE="pl_PL"
-       ;;
-   pt) COUNTRY="pt"
-       SETLANG="pt"
-       LOCALE="pt_PT"
-       ;;
-   pt_BR) COUNTRY="br"
-          SETLANG="pt_BR"
-          LOCALE="pt_BR"
-       ;;
-   ru) COUNTRY="ru"
-       SETLANG="ru"
-       LOCALE="ru_RU"
-       ;;
-   sl) COUNTRY="si"
-       SETLANG="sl"
-       LOCALE="sl_SI"
-       ;;
-   sk) COUNTRY="sk"
-       SETLANG="sk"
-       LOCALE="sk_SK"
-       ;;
-   sv) COUNTRY="se"
-       SETLANG="sv"
-       LOCALE="sv_SE"
-       ;;
-   uk) COUNTRY="ua"
-       SETLANG="uk"
-       LOCALE="uk_UA"
-       ;;
-   vi) COUNTRY="vn"
-       SETLANG="vi"
-       LOCALE="en_US"
-       ;;
-   zh_CN) COUNTRY="cn"
-          SETLANG="zh_CN"
-          LOCALE="zh_CN"
-       ;;
-   zh_TW) COUNTRY="tw"
-          SETLANG="zh_TW"
-          LOCALE="zh_TW"
-       ;;
-   *) COUNTRY="C"
+    af)
+      COUNTRY="C"
+      SETLANG="af"
+      LOCALE="af_ZA"
+      ;;
+    ar)
+	  COUNTRY="C"
+      SETLANG="ar"
+      LOCALE="en_US"
+      ;;
+    az)
+	  COUNTRY="C"
+      SETLANG="az"
+      LOCALE="en_US"
+      ;;
+    ca)
+	  COUNTRY="es"
+      SETLANG="es:ca"
+      LOCALE="ca_ES"
+      ;;
+    be)
+	  COUNTRY="be"
+      SETLANG="be"
+      LOCALE="be_BY"
+      ;;
+    bn)
+	  COUNTRY="bn"
+      SETLANG="bn"
+      LOCALE="en_US"
+      ;;
+    bg)
+	  COUNTRY="bg"
+      SETLANG="bg"
+      LOCALE="bg_BG"
+      ;;
+    cs)
+	  COUNTRY="cz"
+      SETLANG="cs"
+      LOCALE="cs_CZ"
+      ;;
+    da)
+	  COUNTRY="dk"
+      SETLANG="da"
+      LOCALE="da_DK"
+      ;;
+    de)
+	  COUNTRY="de"
+      SETLANG="de"
+      LOCALE="de_DE"
+      ;;
+    en_GB)
+	  COUNTRY="gb"
+      SETLANG="en_GB:cy"
+      LOCALE="en_GB"
+      ;;
+    el)
+	  COUNTRY="gr"
+      SETLANG="el:gr"
+      LOCALE="el_GR"
+      ;;
+    es)
+	  COUNTRY="es"
+      SETLANG="es"
+      LOCALE="es_ES"
+      ;;
+    es_LA)
+	  COUNTRY="us"
+      SETLANG="es:en_US"
+      LOCALE="es_ES"
+      ;;
+    et)
+	  COUNTRY="ee"
+      SETLANG="et"
+      LOCALE="et_EE"
+      ;;
+    fr)
+	  COUNTRY="fr"
+      SETLANG="fr"
+      LOCALE="fr_FR"
+      ;;
+    he)
+	  COUNTRY="il"
+      SETLANG="he:ar"
+      LOCALE="he_IL"
+      ;;
+    hr)
+	  COUNTRY="hr"
+      SETLANG="hr"
+      LOCALE="hr_HR"
+      ;;
+    hu)
+	  COUNTRY="hu"
+      SETLANG="hu"
+      LOCALE="hu_HU"
+      ;;
+    it)
+	  COUNTRY="it"
+      SETLANG="it"
+      LOCALE="it_IT"
+      ;;
+    ja)
+	  COUNTRY="jp"
+      SETLANG="ja"
+      LOCALE="ja_JP"
+      ;;
+    ko)
+	  COUNTRY="kr"
+      SETLANG="ko"
+      LOCALE="ko_KR"
+      ;;
+    nl)
+	  COUNTRY="nl"
+      SETLANG="nl"
+      LOCALE="nl_NL"
+      ;;
+    nn)
+	  COUNTRY="no"
+      SETLANG="nn"
+      LOCALE="en_US"
+      ;;
+    pa)
+	  COUNTRY="pa"
+      SETLANG="pa"
+      LOCALE="en_US"
+      ;;
+    pl)
+	  COUNTRY="pl"
+      SETLANG="pl"
+      LOCALE="pl_PL"
+      ;;
+    pt)
+	  COUNTRY="pt"
+      SETLANG="pt"
+      LOCALE="pt_PT"
+      ;;
+    pt_BR)
+	  COUNTRY="br"
+      SETLANG="pt_BR"
+      LOCALE="pt_BR"
+      ;;
+    ru)
+	  COUNTRY="ru"
+      SETLANG="ru"
+      LOCALE="ru_RU"
+      ;;
+    sl)
+	  COUNTRY="si"
+      SETLANG="sl"
+      LOCALE="sl_SI"
+      ;;
+    sk)
+	  COUNTRY="sk"
+      SETLANG="sk"
+      LOCALE="sk_SK"
+      ;;
+    sv)
+	  COUNTRY="se"
+      SETLANG="sv"
+      LOCALE="sv_SE"
+      ;;
+    uk)
+	  COUNTRY="ua"
+      SETLANG="uk"
+      LOCALE="uk_UA"
+      ;;
+    vi)
+	  COUNTRY="vn"
+      SETLANG="vi"
+      LOCALE="en_US"
+      ;;
+    zh_CN)
+	  COUNTRY="cn"
+      SETLANG="zh_CN"
+      LOCALE="zh_CN"
+      ;;
+    zh_TW)
+	  COUNTRY="tw"
+      SETLANG="zh_TW"
+      LOCALE="zh_TW"
+      ;;
+    *)
+	  COUNTRY="C"
       SETLANG="${TARGETLANG}"
       LOCALE="en_US"
       ;;
   esac
 
- export COUNTRY SETLANG LOCALE
+  export COUNTRY SETLANG LOCALE
 
 };
 

Modified: pcbsd/stable/pc-sysinstall/backend/functions-mountdisk.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-mountdisk.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-mountdisk.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions related mounting the newly formatted disk partitions
 
 # Mounts all the specified partition to the mount-point
@@ -26,32 +52,32 @@
   #We are on ZFS, lets setup this mount-point
   if [ "${PARTFS}" = "ZFS" ]
   then
-     ZPOOLNAME=$(get_zpool_name "${PART}")
+    ZPOOLNAME=$(get_zpool_name "${PART}")
 
-     # Check if we have multiple zfs mounts specified
-     for ZMNT in `echo ${MNTPOINT} | sed 's|,| |g'`
-     do
-       # First make sure we create the mount point
-       if [ ! -d "${FSMNT}${ZMNT}" ] ; then
-         mkdir -p ${FSMNT}${ZMNT} >>${LOGOUT} 2>>${LOGOUT}
-       fi
+    # Check if we have multiple zfs mounts specified
+    for ZMNT in `echo ${MNTPOINT} | sed 's|,| |g'`
+    do
+      # First make sure we create the mount point
+      if [ ! -d "${FSMNT}${ZMNT}" ] ; then
+        mkdir -p ${FSMNT}${ZMNT} >>${LOGOUT} 2>>${LOGOUT}
+      fi
 
-       if [ "${ZMNT}" = "/" ] ; then
-         ZNAME=""
-       else
-         ZNAME="${ZMNT}"
-         echo_log "zfs create -p ${ZPOOLNAME}${ZNAME}"
-         rc_halt "zfs create -p ${ZPOOLNAME}${ZNAME}"
-       fi
-       sleep 2
-       rc_halt "zfs set mountpoint=${FSMNT}${ZNAME} ${ZPOOLNAME}${ZNAME}"
+      if [ "${ZMNT}" = "/" ] ; then
+        ZNAME=""
+      else
+        ZNAME="${ZMNT}"
+        echo_log "zfs create -p ${ZPOOLNAME}${ZNAME}"
+        rc_halt "zfs create -p ${ZPOOLNAME}${ZNAME}"
+      fi
+      sleep 2
+      rc_halt "zfs set mountpoint=${FSMNT}${ZNAME} ${ZPOOLNAME}${ZNAME}"
 
-       # Disable atime for this zfs partition, speed increase
-       rc_nohalt "zfs set atime=off ${ZPOOLNAME}${ZNAME}"
-     done 
+      # Disable atime for this zfs partition, speed increase
+      rc_nohalt "zfs set atime=off ${ZPOOLNAME}${ZNAME}"
+    done 
 
   else
-  # If we are not on ZFS, lets do the mount now
+    # If we are not on ZFS, lets do the mount now
     # First make sure we create the mount point
     if [ ! -d "${FSMNT}${MNTPOINT}" ]
     then
@@ -68,17 +94,17 @@
 # Mounts all the new file systems to prepare for installation
 mount_all_filesystems()
 {
-   # Make sure our mount point exists
-   mkdir -p ${FSMNT} >/dev/null 2>/dev/null
+  # Make sure our mount point exists
+  mkdir -p ${FSMNT} >/dev/null 2>/dev/null
 
-   # First lets find and mount the / partition
-   #########################################################
-   for PART in `ls ${PARTDIR}`
-   do
-     if [ ! -e "/dev/${PART}" ]
-     then
-       exit_err "ERROR: The partition ${PART} does not exist. Failure in bsdlabel?"
-     fi 
+  # First lets find and mount the / partition
+  #########################################################
+  for PART in `ls ${PARTDIR}`
+  do
+    if [ ! -e "/dev/${PART}" ]
+    then
+      exit_err "ERROR: The partition ${PART} does not exist. Failure in bsdlabel?"
+    fi 
 
     PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
     PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
@@ -96,69 +122,70 @@
     if [ "$?" = "0" -o "$PARTMNT" = "/" ]
     then
       case ${PARTFS} in
-         UFS) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime"
-              ;;
-       UFS+S) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime"
-              ;;
-       UFS+J) mount_partition ${PART}${EXT}.journal ${PARTFS} ${PARTMNT} "async,noatime"
-              ;;
-         ZFS) mount_partition ${PART} ${PARTFS} ${PARTMNT}
-              ;;
-           *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;;
+        UFS) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;;
+        UFS+S) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;;
+        UFS+SUJ) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;;
+        UFS+J) mount_partition ${PART}${EXT}.journal ${PARTFS} ${PARTMNT} "async,noatime" ;;
+        ZFS) mount_partition ${PART} ${PARTFS} ${PARTMNT} ;;
+        IMAGE) mount_partition ${PART} ${PARTFS} ${PARTMNT} ;;
+        *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;;
       esac
-
     fi
-     
-   done
+  done
 
-   # Now that we've mounted "/" lets do any other remaining mount-points
-   ##################################################################
-   for PART in `ls ${PARTDIR}`
-   do
-     if [ ! -e "/dev/${PART}" ]
-     then
-       exit_err "ERROR: The partition ${PART} does not exist. Failure in bsdlabel?"
-     fi 
+  # Now that we've mounted "/" lets do any other remaining mount-points
+  ##################################################################
+  for PART in `ls ${PARTDIR}`
+  do
+    if [ ! -e "/dev/${PART}" ]
+    then
+      exit_err "ERROR: The partition ${PART} does not exist. Failure in bsdlabel?"
+    fi 
      
-     PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
-     PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
-     PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`"
+    PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
+    PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
+    PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`"
 
-     if [ "${PARTENC}" = "ON" ]
-     then
-       EXT=".eli"
-     else
-       EXT=""
-     fi
+    if [ "${PARTENC}" = "ON" ]
+    then
+      EXT=".eli"
+    else
+      EXT=""
+    fi
 
-     # Check if we've found "/" again, don't need to mount it twice
-     echo "$PARTMNT" | grep "/," >/dev/null
-     if [ "$?" != "0" -a "$PARTMNT" != "/" ]
-     then
+    # Check if we've found "/" again, don't need to mount it twice
+    echo "$PARTMNT" | grep "/," >/dev/null
+    if [ "$?" != "0" -a "$PARTMNT" != "/" ]
+    then
        case ${PARTFS} in
-         UFS) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime"
-              ;;
-       UFS+S) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime"
-              ;;
-       UFS+J) mount_partition ${PART}${EXT}.journal ${PARTFS} ${PARTMNT} "async,noatime"
-              ;;
-         ZFS) mount_partition ${PART} ${PARTFS} ${PARTMNT}
-              ;;
-        SWAP) # Lets enable this swap now
-              if [ "$PARTENC" = "ON" ]
-              then
-                echo_log "Enabling encrypted swap on /dev/${PART}"
-                rc_halt "geli onetime -d -e 3des ${PART}"
-                sleep 5
-                rc_halt "swapon /dev/${PART}.eli"
-              else
-                echo_log "swapon ${PART}"
-                sleep 5
-                rc_halt "swapon /dev/${PART}"
-              fi
-              ;;
-          *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;;
-       esac
-     fi
-   done
+         UFS) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;;
+         UFS+S) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;;
+         UFS+SUJ) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;;
+         UFS+J) mount_partition ${PART}${EXT}.journal ${PARTFS} ${PARTMNT} "async,noatime" ;;
+         ZFS) mount_partition ${PART} ${PARTFS} ${PARTMNT} ;;
+         SWAP)
+		   # Lets enable this swap now
+           if [ "$PARTENC" = "ON" ]
+           then
+             echo_log "Enabling encrypted swap on /dev/${PART}"
+             rc_halt "geli onetime -d -e 3des ${PART}"
+             sleep 5
+             rc_halt "swapon /dev/${PART}.eli"
+           else
+             echo_log "swapon ${PART}"
+             sleep 5
+             rc_halt "swapon /dev/${PART}"
+            fi
+            ;;
+         IMAGE)
+           if [ ! -d "${PARTMNT}" ]
+           then
+             mkdir -p "${PARTMNT}" 
+           fi 
+           mount_partition ${PART} ${PARTFS} ${PARTMNT}
+           ;;
+         *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;;
+      esac
+    fi
+  done
 };

Modified: pcbsd/stable/pc-sysinstall/backend/functions-mountoptical.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-mountoptical.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-mountoptical.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,120 +1,147 @@
 #!/bin/sh
-# Functions which perform mounting / unmounting and switching of optical / usb media
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
 
+# Functions which perform mounting / unmounting and switching of 
+# optical / usb media
+
 . ${BACKEND}/functions.sh
 . ${BACKEND}/functions-parse.sh
 
 # Displays an optical failure message
 opt_fail()
 {
-   # 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 "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/USB"
-   fi
+  # 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 "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/USB"
+  fi
 };
 
 # Performs the extraction of data to disk
 opt_mount()
 {
- FOUND="0"
+  FOUND="0"
 
- # Ensure we have a directory where its supposed to be
- if [ ! -d "${CDMNT}" ]
- then
-   mkdir -p ${CDMNT}
- fi
+  # Ensure we have a directory where its supposed to be
+  if [ ! -d "${CDMNT}" ]
+  then
+    mkdir -p ${CDMNT}
+  fi
 
 
- # Start by checking if we already have a cd mounted at CDMNT
- mount | grep "${CDMNT} " >/dev/null 2>/dev/null
- if [ "$?" = "0" ]
- then
-   if [ -e "${CDMNT}/${INSFILE}" ]
-   then
-     echo "MOUNTED" >${TMPDIR}/cdmnt
-     echo_log "FOUND DVD: MOUNTED"
-     FOUND="1"
-     return
-   fi
+  # Start by checking if we already have a cd mounted at CDMNT
+  mount | grep "${CDMNT} " >/dev/null 2>/dev/null
+  if [ "$?" = "0" ]
+  then
+    if [ -e "${CDMNT}/${INSFILE}" ]
+    then
+      echo "MOUNTED" >${TMPDIR}/cdmnt
+      echo_log "FOUND DVD: MOUNTED"
+      FOUND="1"
+      return
+    fi
 
-   # failed to find optical disk
-   opt_fail
-   return
- fi
+    # failed to find optical disk
+    opt_fail
+    return
+  fi
 
-# Setup our loop to search for installation media
- while
- z=1
- do
+  # 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* 2>/dev/null`
-   do
-     # Find the CD Device
-     /sbin/mount_cd9660 $i ${CDMNT}
+    # 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
+      # Find the CD Device
+      /sbin/mount_cd9660 $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 DVD: ${i}"
-       FOUND="1"
-       break
-     fi
-     /sbin/umount ${CDMNT} >/dev/null 2>/dev/null
-   done
+      # Check the package type to see if we have our install data
+      if [ -e "${CDMNT}/${INSFILE}" ]
+      then
+        echo "${i}" >${TMPDIR}/cdmnt
+        echo_log "FOUND DVD: ${i}"
+        FOUND="1"
+        break
+      fi
+      /sbin/umount ${CDMNT} >/dev/null 2>/dev/null
+    done
 
-   # If no DVD found, try USB
-   if [ "$FOUND" != "1" ]
-   then
-     # 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 -r $i ${CDMNT}
+    # If no DVD found, try USB
+    if [ "$FOUND" != "1" ]
+    then
+      # 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 -r $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
+        # 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 -r -t msdosfs $i ${CDMNT}
+        # Also check if it is a FAT mount
+        /sbin/mount -r -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
+        # 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
-   fi
+    if [ "$FOUND" = "1" ]
+    then
+      break
+    fi
    
-   # Failed to find a disk, take action now
-   opt_fail
+    # Failed to find a disk, take action now
+    opt_fail
 
- done
+  done
 
 };
 

Modified: pcbsd/stable/pc-sysinstall/backend/functions-networking.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-networking.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-networking.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions which perform our networking setup
 
 # Function which creates a kde4 .desktop file for the PC-BSD net tray
@@ -42,8 +68,8 @@
       check_is_wifi ${NIC}
       if [ "$?" != "0" ]
       then
-         VAL="${NIC}" ; export VAL
-         return
+        VAL="${NIC}" ; export VAL
+        return
       fi
     done < ${TMPDIR}/.niclist
   fi
@@ -215,22 +241,23 @@
 
     is_nic_active "${NIC}"
     if [ "$?" = "0" ] ; then
-    	echo_log "Trying DHCP on $NIC $DESC"
-    	dhclient ${NIC} >/dev/null 2>/dev/null
-    	if [ "$?" = "0" ] ; then
-   	   # Got a valid DHCP IP, we can return now
-	   WRKNIC="$NIC" ; export WRKNIC
-   	   return 0
-	fi
+      echo_log "Trying DHCP on $NIC $DESC"
+      dhclient ${NIC} >/dev/null 2>/dev/null
+      if [ "$?" = "0" ] ; then
+        # Got a valid DHCP IP, we can return now
+	    WRKNIC="$NIC" ; export WRKNIC
+   	    return 0
+	  fi
     fi
   done < ${TMPDIR}/.niclist 
 
 };
 
 # Get the mac address of a target NIC
-get_nic_mac() {
-	FOUNDMAC="`ifconfig ${1} | grep 'ether' | tr -d '\t' | cut -d ' ' -f 2`"
-	export FOUNDMAC
+get_nic_mac()
+{
+  FOUNDMAC="`ifconfig ${1} | grep 'ether' | tr -d '\t' | cut -d ' ' -f 2`"
+  export FOUNDMAC
 }
 
 # Function which performs the manual setup of a target nic in the cfg

Modified: pcbsd/stable/pc-sysinstall/backend/functions-newfs.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-newfs.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-newfs.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions related to disk operations using newfs
 
 
@@ -55,102 +81,137 @@
 setup_filesystems()
 {
 
-   # Create the keydir
-   rm -rf ${GELIKEYDIR} >/dev/null 2>/dev/null
-   mkdir ${GELIKEYDIR}
+  # Create the keydir
+  rm -rf ${GELIKEYDIR} >/dev/null 2>/dev/null
+  mkdir ${GELIKEYDIR}
 
-   # Lets go ahead and read through the saved partitions we created, and determine if we need to run
-   # newfs on any of them
-   for PART in `ls ${PARTDIR}`
-   do
-     if [ ! -e "/dev/${PART}" ]
-     then
-       exit_err "ERROR: The partition ${PART} does not exist. Failure in bsdlabel?"
-     fi 
+  # Lets go ahead and read through the saved partitions we created, and determine if we need to run
+  # newfs on any of them
+  for PART in `ls ${PARTDIR}`
+  do
+    if [ ! -e "/dev/${PART}" ]
+    then
+      exit_err "ERROR: The partition ${PART} does not exist. Failure in bsdlabel?"
+    fi 
      
-     PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
-     PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
-     PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`"
-     PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`"
-     PARTGEOM="`cat ${PARTDIR}/${PART} | cut -d ':' -f 5`"
-     PARTXTRAOPTS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 6`"
+    PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
+    PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
+    PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`"
+    PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`"
+    PARTGEOM="`cat ${PARTDIR}/${PART} | cut -d ':' -f 5`"
+    PARTXTRAOPTS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 6`"
+    PARTIMAGE="`cat ${PARTDIR}/${PART} | cut -d ':' -f 7`"
 
-     # Make sure journaling isn't enabled on this device
-     if [ -e "/dev/${PART}.journal" ]
-     then
-       rc_nohalt "gjournal stop -f ${PART}.journal"
-       rc_nohalt "gjournal clear ${PART}"
-     fi
+    # Make sure journaling isn't enabled on this device
+    if [ -e "/dev/${PART}.journal" ]
+    then
+      rc_nohalt "gjournal stop -f ${PART}.journal"
+      rc_nohalt "gjournal clear ${PART}"
+    fi
 
-     # Setup encryption if necessary
-     if [ "${PARTENC}" = "ON" -a "${PARTFS}" != "SWAP" ]
-     then
-       echo_log "Creating geli provider for ${PART}"
-       rc_halt "dd if=/dev/random of=${GELIKEYDIR}/${PART}.key bs=64 count=1"
-       rc_halt "geli init -b -s 4096 -P -K ${GELIKEYDIR}/${PART}.key /dev/${PART}"
-       rc_halt "geli attach -p -k ${GELIKEYDIR}/${PART}.key /dev/${PART}"
+    # Setup encryption if necessary
+    if [ "${PARTENC}" = "ON" -a "${PARTFS}" != "SWAP" ]
+    then
+      echo_log "Creating geli provider for ${PART}"
+      rc_halt "dd if=/dev/random of=${GELIKEYDIR}/${PART}.key bs=64 count=1"
+      rc_halt "geli init -b -s 4096 -P -K ${GELIKEYDIR}/${PART}.key /dev/${PART}"
+      rc_halt "geli attach -p -k ${GELIKEYDIR}/${PART}.key /dev/${PART}"
 
-       EXT=".eli"
-     else
-       # No Encryption
-       EXT=""
-     fi
+      EXT=".eli"
+    else
+      # No Encryption
+      EXT=""
+    fi
 
-     case ${PARTFS} in
-         UFS) echo_log "NEWFS: /dev/${PART} - ${PARTFS}"
-              sleep 2
-              rc_halt "newfs /dev/${PART}${EXT}"
-              sleep 2
-              rc_halt "sync"
-              rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}"
-              rc_halt "sync"
+    case ${PARTFS} in
+      UFS)
+        echo_log "NEWFS: /dev/${PART} - ${PARTFS}"
+        sleep 2
+        rc_halt "newfs /dev/${PART}${EXT}"
+        sleep 2
+        rc_halt "sync"
+        rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}"
+        rc_halt "sync"
 
-	      # Set flag that we've found a boot partition
-	      if [ "$PARTMNT" = "/boot" -o "${PARTMNT}" = "/" ] ; then
-		HAVEBOOT="YES"
-  	      fi
-              sleep 2
-              ;;
-       UFS+S) echo_log "NEWFS: /dev/${PART} - ${PARTFS}"
-              sleep 2
-              rc_halt "newfs -U /dev/${PART}${EXT}"
-              sleep 2
-              rc_halt "sync"
-              rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}"
-              rc_halt "sync"
-	      # Set flag that we've found a boot partition
-	      if [ "$PARTMNT" = "/boot" -o "${PARTMNT}" = "/" ] ; then
-		HAVEBOOT="YES"
-  	      fi
-              sleep 2
-              ;;
-       UFS+J) echo_log "NEWFS: /dev/${PART} - ${PARTFS}"
-              sleep 2
-              rc_halt "newfs /dev/${PART}${EXT}"
-              sleep 2
-              rc_halt "gjournal label -f /dev/${PART}${EXT}"
-              sleep 2
-              rc_halt "newfs -O 2 -J /dev/${PART}${EXT}.journal"
-              sleep 2
-              rc_halt "sync"
-              rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal"
-              rc_halt "sync"
-	      # Set flag that we've found a boot partition
-	      if [ "$PARTMNT" = "/boot" -o "${PARTMNT}" = "/" ] ; then
-		HAVEBOOT="YES"
-  	      fi
-              sleep 2
-              ;;
-         ZFS) echo_log "NEWFS: /dev/${PART} - ${PARTFS}" 
-              setup_zfs_filesystem "${PART}" "${PARTFS}" "${PARTMNT}" "${EXT}" "${PARTGEOM}" "${PARTXTRAOPTS}"
-              ;;
-        SWAP) rc_halt "sync"
-              rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}" 
-              rc_halt "sync"
-              sleep 2
-              ;;
-           *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;;
-     esac
+        # Set flag that we've found a boot partition
+        if [ "$PARTMNT" = "/boot" -o "${PARTMNT}" = "/" ] ; then
+		  HAVEBOOT="YES"
+        fi
+        sleep 2
+        ;;
 
-   done
+      UFS+S)
+        echo_log "NEWFS: /dev/${PART} - ${PARTFS}"
+        sleep 2
+        rc_halt "newfs -U /dev/${PART}${EXT}"
+        sleep 2
+        rc_halt "sync"
+        rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}"
+        rc_halt "sync"
+	    # Set flag that we've found a boot partition
+	    if [ "$PARTMNT" = "/boot" -o "${PARTMNT}" = "/" ] ; then
+          HAVEBOOT="YES"
+        fi
+        sleep 2
+        ;;
+
+      UFS+SUJ)
+        echo_log "NEWFS: /dev/${PART} - ${PARTFS}"
+        sleep 2
+        rc_halt "newfs -U /dev/${PART}${EXT}"
+        sleep 2
+        rc_halt "sync"
+        rc_halt "tunefs -j enable /dev/${PART}${EXT}"
+        sleep 2
+        rc_halt "sync"
+        rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}"
+        rc_halt "sync"
+	    # Set flag that we've found a boot partition
+	    if [ "$PARTMNT" = "/boot" -o "${PARTMNT}" = "/" ] ; then
+          HAVEBOOT="YES"
+        fi
+        sleep 2
+        ;;
+
+
+      UFS+J)
+        echo_log "NEWFS: /dev/${PART} - ${PARTFS}"
+        sleep 2
+        rc_halt "newfs /dev/${PART}${EXT}"
+        sleep 2
+        rc_halt "gjournal label -f /dev/${PART}${EXT}"
+        sleep 2
+        rc_halt "newfs -O 2 -J /dev/${PART}${EXT}.journal"
+        sleep 2
+        rc_halt "sync"
+        rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal"
+        rc_halt "sync"
+	    # Set flag that we've found a boot partition
+	    if [ "$PARTMNT" = "/boot" -o "${PARTMNT}" = "/" ] ; then
+          HAVEBOOT="YES"
+  	    fi
+        sleep 2
+        ;;
+
+      ZFS)
+        echo_log "NEWFS: /dev/${PART} - ${PARTFS}" 
+        setup_zfs_filesystem "${PART}" "${PARTFS}" "${PARTMNT}" "${EXT}" "${PARTGEOM}" "${PARTXTRAOPTS}"
+        ;;
+
+      SWAP)
+        rc_halt "sync"
+        rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}" 
+        rc_halt "sync"
+        sleep 2
+        ;;
+
+      IMAGE)
+        write_image "${PARTIMAGE}" "${PART}"
+        sleep 2
+        ;; 
+
+      *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;;
+    esac
+
+  done
 };

Modified: pcbsd/stable/pc-sysinstall/backend/functions-parse.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-parse.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-parse.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # functions.sh
 # Library of functions which pc-sysinstall may call upon for parsing the config
 
@@ -59,6 +85,7 @@
     VALID="1"
     for i in ${2}
     do
+      VAL=`echo "$VAL"|tr A-Z a-z`
       if [ "$VAL" = "${i}" ]
       then 
         VALID="0"
@@ -106,19 +133,19 @@
   then
     for i in $1
     do
-       grep "^${i}=" $CFGF >/dev/null 2>/dev/null
-       if [ "$?" = "0" ]
-       then
-         LN=`grep "^${i}=" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '`
-         if [ -z "${LN}" ]
-         then
-           echo "Error: Config fails sanity test! ${i}= is empty"
-           exit 1
-         fi
-       else
-         echo "Error: Config fails sanity test! Missing ${i}="
-         exit 1
-       fi
+      grep "^${i}=" $CFGF >/dev/null 2>/dev/null
+      if [ "$?" = "0" ]
+      then
+        LN=`grep "^${i}=" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '`
+        if [ -z "${LN}" ]
+        then
+          echo "Error: Config fails sanity test! ${i}= is empty"
+          exit 1
+        fi
+      else
+        echo "Error: Config fails sanity test! Missing ${i}="
+        exit 1
+      fi
     done
   else
     echo "Error: Missing config file, and / or values to sanity check for!"

Modified: pcbsd/stable/pc-sysinstall/backend/functions-runcommands.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-runcommands.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-runcommands.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions which runs commands on the system
 
 . ${BACKEND}/functions.sh
@@ -11,7 +37,10 @@
   echo "$CMD" >${FSMNT}/.runcmd.sh
   chmod 755 ${FSMNT}/.runcmd.sh
   chroot ${FSMNT} sh /.runcmd.sh
+  RES=$?
+
   rm ${FSMNT}/.runcmd.sh
+  return ${RES}
 };
 
 run_chroot_script()
@@ -24,8 +53,10 @@
 
   echo_log "Running chroot script: ${SCRIPT}"
   chroot ${FSMNT} /.${SBASE}
+  RES=$?
 
   rm ${FSMNT}/.${SBASE}
+  return ${RES}
 };
 
 
@@ -38,7 +69,10 @@
   echo "${CMD}"> ${TMPDIR}/.runcmd.sh
   chmod 755 ${TMPDIR}/.runcmd.sh
   sh ${TMPDIR}/.runcmd.sh
+  RES=$?
+
   rm ${TMPDIR}/.runcmd.sh
+  return ${RES}
 };
 
 

Modified: pcbsd/stable/pc-sysinstall/backend/functions-unmount.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-unmount.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-unmount.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,14 +1,41 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions which unmount all mounted disk filesystems
 
 # Unmount all mounted partitions under specified dir
-umount_all_dir() {
-  	_udir="$1"
-	_umntdirs=`mount | sort -r | grep "on $_udir" | cut -d ' ' -f 3`
-	for _ud in $_umntdirs
-	do
-		umount -f ${_ud} 
-	done
+umount_all_dir()
+{
+  _udir="$1"
+  _umntdirs=`mount | sort -r | grep "on $_udir" | cut -d ' ' -f 3`
+  for _ud in $_umntdirs
+  do
+    umount -f ${_ud} 
+  done
 }
 
 # Script that adds our gmirror devices for syncing
@@ -32,93 +59,95 @@
 # Unmounts all our mounted file-systems
 unmount_all_filesystems()
 {
-   # Copy the logfile to disk before we unmount
-   cp ${LOGOUT} ${FSMNT}/root/pc-sysinstall.log
-   cd /
+  # Copy the logfile to disk before we unmount
+  cp ${LOGOUT} ${FSMNT}/root/pc-sysinstall.log
+  cd /
 
-   # Start by unmounting any ZFS partitions
-   zfs_cleanup_unmount
+  # Start by unmounting any ZFS partitions
+  zfs_cleanup_unmount
 
-   # Lets read our partition list, and unmount each
-   ##################################################################
-   for PART in `ls ${PARTDIR}`
-   do
-     
-     PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
-     PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
-     PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`"
-     PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`"
+  # Lets read our partition list, and unmount each
+  ##################################################################
+  for PART in `ls ${PARTDIR}`
+  do
+         
+    PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
+    PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
+    PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`"
+    PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`"
 
-     if [ "${PARTENC}" = "ON" ]
-     then
-       EXT=".eli"
-     else
-       EXT=""
-     fi
+    if [ "${PARTENC}" = "ON" ]
+    then
+      EXT=".eli"
+    else
+      EXT=""
+    fi
 
-     #if [ "${PARTFS}" = "SWAP" ]
-     #then
-     #  rc_nohalt "swapoff /dev/${PART}${EXT}"
-     #fi
+    #if [ "${PARTFS}" = "SWAP" ]
+    #then
+    #  rc_nohalt "swapoff /dev/${PART}${EXT}"
+    #fi
 
-     # Check if we've found "/", and unmount that last
-     if [ "$PARTMNT" != "/" -a "${PARTMNT}" != "none" -a "${PARTFS}" != "ZFS" ]
-     then
-       rc_halt "umount -f /dev/${PART}${EXT}"
+    # Check if we've found "/", and unmount that last
+    if [ "$PARTMNT" != "/" -a "${PARTMNT}" != "none" -a "${PARTFS}" != "ZFS" ]
+    then
+      rc_halt "umount -f /dev/${PART}${EXT}"
 
-       # Re-check if we are missing a label for this device and create it again if so
-       if [ ! -e "/dev/label/${PARTLABEL}" ]
-       then
-         case ${PARTFS} in
-             UFS) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;;
-           UFS+S) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;;
-           UFS+J) glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal ;;
-               *) ;;
-         esac 
-       fi
-     fi
+      # Re-check if we are missing a label for this device and create it again if so
+      if [ ! -e "/dev/label/${PARTLABEL}" ]
+      then
+        case ${PARTFS} in
+          UFS) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;;
+          UFS+S) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;;
+          UFS+SUJ) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;;
+          UFS+J) glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal ;;
+          *) ;;
+        esac 
+      fi
+    fi
 
-     # Check if we've found "/" and make sure the label exists
-     if [ "$PARTMNT" = "/" -a "${PARTFS}" != "ZFS" ]
-     then
-       if [ ! -e "/dev/label/${PARTLABEL}" ]
-       then
-         case ${PARTFS} in
-             UFS) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;;
-           UFS+S) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;;
-           UFS+J) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal" ;;
-               *) ;;
-         esac 
-       fi
-     fi
-   done
+    # Check if we've found "/" and make sure the label exists
+    if [ "$PARTMNT" = "/" -a "${PARTFS}" != "ZFS" ]
+    then
+      if [ ! -e "/dev/label/${PARTLABEL}" ]
+      then
+        case ${PARTFS} in
+          UFS) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;;
+          UFS+S) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;;
+          UFS+SUJ) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;;
+          UFS+J) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal" ;;
+          *) ;;
+        esac 
+      fi
+    fi
+  done
 
-   # Last lets the /mnt partition
-   #########################################################
-   rc_nohalt "umount -f ${FSMNT}"
+  # Last lets the /mnt partition
+  #########################################################
+  rc_nohalt "umount -f ${FSMNT}"
 
-    # If are using a ZFS on "/" set it to legacy
-   if [ ! -z "${FOUNDZFSROOT}" ]
-   then
-     rc_halt "zfs set mountpoint=legacy ${FOUNDZFSROOT}"
-   fi
+   # If are using a ZFS on "/" set it to legacy
+  if [ ! -z "${FOUNDZFSROOT}" ]
+  then
+    rc_halt "zfs set mountpoint=legacy ${FOUNDZFSROOT}"
+  fi
 
-   # If we need to relabel "/" do it now
-   if [ ! -z "${ROOTRELABEL}" ]
-   then
-     ${ROOTRELABEL}
-   fi
+  # If we need to relabel "/" do it now
+  if [ ! -z "${ROOTRELABEL}" ]
+  then
+    ${ROOTRELABEL}
+  fi
 
-   # Unmount our CDMNT
-   rc_nohalt "umount -f ${CDMNT}" >/dev/null 2>/dev/null
+  # Unmount our CDMNT
+  rc_nohalt "umount -f ${CDMNT}" >/dev/null 2>/dev/null
 
-   # Check if we need to run any gmirror syncing
-   ls ${MIRRORCFGDIR}/* >/dev/null 2>/dev/null
-   if [ "$?" = "0" ]
-   then
-     # Lets start syncing now
-     start_gmirror_sync
-   fi
+  # Check if we need to run any gmirror syncing
+  ls ${MIRRORCFGDIR}/* >/dev/null 2>/dev/null
+  if [ "$?" = "0" ]
+  then
+    # Lets start syncing now
+    start_gmirror_sync
+  fi
 
 };
 
@@ -138,43 +167,43 @@
     for PART in `ls ${PARTDIR}`
     do
      
-       PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
-       PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
-       PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`"
+      PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
+      PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
+      PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`"
 
-       #if [ "${PARTFS}" = "SWAP" ]
-       #then
-       #  if [ "${PARTENC}" = "ON" ]
-       #  then
-       #    rc_nohalt "swapoff /dev/${PART}.eli"
-       #  else
-       #    rc_nohalt "swapoff /dev/${PART}"
-       #  fi
-       #fi
+      #if [ "${PARTFS}" = "SWAP" ]
+      #then
+      #  if [ "${PARTENC}" = "ON" ]
+      #  then
+      #    rc_nohalt "swapoff /dev/${PART}.eli"
+      #  else
+      #    rc_nohalt "swapoff /dev/${PART}"
+      #  fi
+      #fi
 
-       # Check if we've found "/" again, don't need to mount it twice
-       if [ "$PARTMNT" != "/" -a "${PARTMNT}" != "none" -a "${PARTFS}" != "ZFS" ]
-       then
-         rc_nohalt "umount -f /dev/${PART}"
-         rc_nohalt "umount -f ${FSMNT}${PARTMNT}"
-       fi
-     done
+      # Check if we've found "/" again, don't need to mount it twice
+      if [ "$PARTMNT" != "/" -a "${PARTMNT}" != "none" -a "${PARTFS}" != "ZFS" ]
+      then
+        rc_nohalt "umount -f /dev/${PART}"
+        rc_nohalt "umount -f ${FSMNT}${PARTMNT}"
+      fi
+    done
 
-     # Last lets the /mnt partition
-     #########################################################
-     rc_nohalt "umount -f ${FSMNT}"
+    # Last lets the /mnt partition
+    #########################################################
+    rc_nohalt "umount -f ${FSMNT}"
 
-    fi
-   else
-     # We are doing a upgrade, try unmounting any of these filesystems
-     chroot ${FSMNT} /sbin/umount -a >>${LOGOUT} >>${LOGOUT}
-     umount -f ${FSMNT}/usr >>${LOGOUT} 2>>${LOGOUT}
-     umount -f ${FSMNT}/dev >>${LOGOUT} 2>>${LOGOUT}
-     umount -f ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
-     rc_nohalt "sh ${TMPDIR}/.upgrade-unmount"
    fi
+  else
+    # We are doing a upgrade, try unmounting any of these filesystems
+    chroot ${FSMNT} /sbin/umount -a >>${LOGOUT} >>${LOGOUT}
+    umount -f ${FSMNT}/usr >>${LOGOUT} 2>>${LOGOUT}
+    umount -f ${FSMNT}/dev >>${LOGOUT} 2>>${LOGOUT}
+    umount -f ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
+    rc_nohalt "sh ${TMPDIR}/.upgrade-unmount"
+  fi
    
-   # Unmount our CDMNT
-   rc_nohalt "umount ${CDMNT}"
+  # Unmount our CDMNT
+  rc_nohalt "umount ${CDMNT}"
 
 };

Modified: pcbsd/stable/pc-sysinstall/backend/functions-upgrade.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-upgrade.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-upgrade.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions which perform the mounting / unmount for upgrades
 
 . ${PROGDIR}/backend/functions-unmount.sh
@@ -12,13 +38,13 @@
   umount_all_dir "${FSMNT}"
   
   # Set a variable of files we want to make backups of before doing upgrade
-  BKFILES="/etc/rc.conf /boot/loader.conf /boot/device.hints /usr/local/kde4/share/config/kdm/kdmrc"
+  BKFILES="/etc/rc.conf /boot/loader.conf"
 
   if [ -e "/dev/${MPART}" ] ; then
     rc_nohalt "mount /dev/${MPART} ${FSMNT}"
     if [ "$?" != "0" ] ; then
-    	# Check if we have ZFS tank name
-    	rc_halt "mount -t zfs ${MPART} ${FSMNT}"
+      # Check if we have ZFS tank name
+      rc_halt "mount -t zfs ${MPART} ${FSMNT}"
     fi
   else
     # Check if we have ZFS tank name
@@ -43,7 +69,6 @@
   # Make backup copies of some files
   for i in ${BKFILES}
   do
-    if [ ! -e "${FSMNT}${i}" ] ; then continue ; fi
     cp ${FSMNT}${i} ${FSMNT}${i}.preUpgrade >/dev/null 2>/dev/null
   done
 
@@ -79,7 +104,7 @@
     run_chroot_cmd "rm -rf /libexec" >/dev/null 2>/dev/null
   fi
 
-}
+};
 
 # Mount the target upgrade partitions
 mount_upgrade()
@@ -91,33 +116,33 @@
   # We are ready to start mounting, lets read the config and do it
   while read line
   do
-     echo $line | grep "^disk0=" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
+    echo $line | grep "^disk0=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
 
-       # Found a disk= entry, lets get the disk we are working on
-       get_value_from_string "${line}"
-       strip_white_space "$VAL"
-       DISK="$VAL"
-     fi
+      # Found a disk= entry, lets get the disk we are working on
+      get_value_from_string "${line}"
+      strip_white_space "$VAL"
+      DISK="$VAL"
+    fi
 
-     echo $line | grep "^commitDiskPart" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
-       # Found our flag to commit this disk setup / lets do sanity check and do it
-       if [ ! -z "${DISK}" ]
-       then
+    echo $line | grep "^commitDiskPart" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      # Found our flag to commit this disk setup / lets do sanity check and do it
+      if [ ! -z "${DISK}" ]
+      then
 
-         # Start mounting this slice
-         mount_target_slice "${DISK}" 
+        # Start mounting this slice
+        mount_target_slice "${DISK}" 
 
-         # Increment our disk counter to look for next disk and unset
-         unset DISK
-	 break
-       else
-         exit_err "ERROR: commitDiskPart was called without procceding disk<num>= and partition= entries!!!" 
-       fi
-     fi
+        # Increment our disk counter to look for next disk and unset
+        unset DISK
+	    break
+      else
+        exit_err "ERROR: commitDiskPart was called without procceding disk<num>= and partition= entries!!!" 
+      fi
+    fi
 
   done <${CFGF}
 
@@ -126,8 +151,8 @@
 copy_skel_files_upgrade()
 {
 
-    # Now make sure we fix any user profile scripts, which cause problems from 7.x->8.x
-    echo '#!/bin/sh
+  # Now make sure we fix any user profile scripts, which cause problems from 7.x->8.x
+  echo '#!/bin/sh
 
 cd /home
 for i in `ls`
@@ -154,17 +179,17 @@
 
 done
 ' >${FSMNT}/.fixUserProfile.sh  
-    chmod 755 ${FSMNT}/.fixUserProfile.sh
-    chroot ${FSMNT} /.fixUserProfile.sh >/dev/null 2>/dev/null
-    rm ${FSMNT}/.fixUserProfile.sh
+  chmod 755 ${FSMNT}/.fixUserProfile.sh
+  chroot ${FSMNT} /.fixUserProfile.sh >/dev/null 2>/dev/null
+  rm ${FSMNT}/.fixUserProfile.sh
 
 
 
-    # if the user wants to keep their original .kde4 profile
-    ###########################################################################
-    get_value_from_cfg "upgradeKeepDesktopProfile"
-    if [ "$VAL" = "YES" -o "$VAL" = "yes" ] ; then
-      echo '#!/bin/sh
+  # if the user wants to keep their original .kde4 profile
+  ###########################################################################
+  get_value_from_cfg "upgradeKeepDesktopProfile"
+  if [ "$VAL" = "YES" -o "$VAL" = "yes" ] ; then
+    echo '#!/bin/sh
       cd /home
 for i in `ls`
 do
@@ -177,11 +202,11 @@
   fi
 done
 ' >${FSMNT}/.fixUserProfile.sh
-      chmod 755 ${FSMNT}/.fixUserProfile.sh
-      chroot ${FSMNT} /.fixUserProfile.sh >/dev/null 2>/dev/null
-      rm ${FSMNT}/.fixUserProfile.sh
+    chmod 755 ${FSMNT}/.fixUserProfile.sh
+    chroot ${FSMNT} /.fixUserProfile.sh >/dev/null 2>/dev/null
+    rm ${FSMNT}/.fixUserProfile.sh
 
-    fi
+  fi
 
 };
 
@@ -199,36 +224,24 @@
   merge_config "${FSMNT}/etc/rc.conf.preUpgrade" "${FSMNT}/etc/rc.conf.new" "${FSMNT}/etc/rc.conf"
   rm ${FSMNT}/etc/rc.conf.new
 
-  # Merge the device.hints with old
-  cp ${FSMNT}/boot/device.hints ${FSMNT}/boot/device.hints.new
-  merge_config "${FSMNT}/boot/device.hints.preUpgrade" "${FSMNT}/boot/device.hints.new" "${FSMNT}/boot/device.hints"
-  rm ${FSMNT}/boot/device.hints.new
-
-  if [ -e "${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc" ] ; then
-    # Merge the kdmrc file with old to preserve auto-login and other settings
-    _kdmrc="/usr/local/kde4/share/config/kdm/kdmrc"
-    cp ${FSMNT}${_kdmrc} ${FSMNT}${_kdmrc}.new
-    merge_config "${FSMNT}${_kdmrc}.preUpgrade" "${FSMNT}${_kdmrc}.new" "${FSMNT}${_kdmrc}"
-    rm ${FSMNT}${_kdmrc}.new
-  fi
 };
 
 # Function which unmounts all the mounted file-systems
 unmount_upgrade()
 {
 
-   # If on PC-BSD, make sure we copy any fixed skel files
-   if [ "$INSTALLTYPE" != "FreeBSD" ] ; then
-     copy_skel_files_upgrade
-   fi
+  # If on PC-BSD, make sure we copy any fixed skel files
+  if [ "$INSTALLTYPE" != "FreeBSD" ] ; then
+    copy_skel_files_upgrade
+  fi
 
-   cd /
+  cd /
 
-   # Unmount FS
-   umount_all_dir "${FSMNT}"
+  # Unmount FS
+  umount_all_dir "${FSMNT}"
 
-   # Run our saved unmount script for these file-systems
-   rc_nohalt "umount -f ${FSMNT}"
+  # Run our saved unmount script for these file-systems
+  rc_nohalt "umount -f ${FSMNT}"
  
-   umount ${CDMNT} 
+  umount ${CDMNT} 
 };

Modified: pcbsd/stable/pc-sysinstall/backend/functions-users.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-users.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions-users.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Functions which runs commands on the system
 
 . ${BACKEND}/functions.sh
@@ -46,99 +72,99 @@
   while read line
   do
 
-     echo $line | grep "^userName=" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
-       get_value_from_string "${line}"
-       USERNAME="$VAL"
-     fi
+    echo $line | grep "^userName=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      get_value_from_string "${line}"
+      USERNAME="$VAL"
+    fi
 
-     echo $line | grep "^userComment=" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
-       get_value_from_string "${line}"
-       USERCOMMENT="$VAL"
-     fi
+    echo $line | grep "^userComment=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      get_value_from_string "${line}"
+      USERCOMMENT="$VAL"
+    fi
 
-     echo $line | grep "^userPass=" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
-       get_value_from_string "${line}"
-       USERPASS="$VAL"
-     fi
+    echo $line | grep "^userPass=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      get_value_from_string "${line}"
+      USERPASS="$VAL"
+    fi
 
-     echo $line | grep "^userShell=" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
-       get_value_from_string "${line}"
-       strip_white_space "$VAL"
-       USERSHELL="$VAL"
-     fi
+    echo $line | grep "^userShell=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      get_value_from_string "${line}"
+      strip_white_space "$VAL"
+      USERSHELL="$VAL"
+    fi
 
-     echo $line | grep "^userHome=" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
-       get_value_from_string "${line}"
-       USERHOME="$VAL"
-     fi
+    echo $line | grep "^userHome=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      get_value_from_string "${line}"
+      USERHOME="$VAL"
+    fi
 
-     echo $line | grep "^userGroups=" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
-       get_value_from_string "${line}"
-       USERGROUPS="$VAL"
-     fi
+    echo $line | grep "^userGroups=" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      get_value_from_string "${line}"
+      USERGROUPS="$VAL"
+    fi
 
 
-     echo $line | grep "^commitUser" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
-       # Found our flag to commit this user, lets check and do it
-       if [ ! -z "${USERNAME}" ]
-       then
+    echo $line | grep "^commitUser" >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      # Found our flag to commit this user, lets check and do it
+      if [ ! -z "${USERNAME}" ]
+      then
 
-         # Now add this user to the system, by building our args list
-         ARGS="-n ${USERNAME}"
+        # Now add this user to the system, by building our args list
+        ARGS="-n ${USERNAME}"
 
-         if [ ! -z "${USERCOMMENT}" ]
-         then
-           ARGS="${ARGS} -c \"${USERCOMMENT}\""
-         fi
+        if [ ! -z "${USERCOMMENT}" ]
+        then
+          ARGS="${ARGS} -c \"${USERCOMMENT}\""
+        fi
          
-         if [ ! -z "${USERPASS}" ]
-         then
-           ARGS="${ARGS} -h 0"
-           echo "${USERPASS}" >${FSMNT}/.tmpPass
-         else
-           ARGS="${ARGS} -h -"
-           rm ${FSMNT}/.tmpPass 2>/dev/null 2>/dev/null
-         fi
+        if [ ! -z "${USERPASS}" ]
+        then
+          ARGS="${ARGS} -h 0"
+          echo "${USERPASS}" >${FSMNT}/.tmpPass
+        else
+          ARGS="${ARGS} -h -"
+          rm ${FSMNT}/.tmpPass 2>/dev/null 2>/dev/null
+        fi
 
-         if [ ! -z "${USERSHELL}" ]
-         then
-           ARGS="${ARGS} -s \"${USERSHELL}\""
-         else
-           ARGS="${ARGS} -s \"/nonexistant\""
-         fi
+        if [ ! -z "${USERSHELL}" ]
+        then
+          ARGS="${ARGS} -s \"${USERSHELL}\""
+        else
+          ARGS="${ARGS} -s \"/nonexistant\""
+        fi
          
-         if [ ! -z "${USERHOME}" ]
-         then
-           ARGS="${ARGS} -m -d \"${USERHOME}\""
-         fi
+        if [ ! -z "${USERHOME}" ]
+        then
+          ARGS="${ARGS} -m -d \"${USERHOME}\""
+        fi
 
-         if [ ! -z "${USERGROUPS}" ]
-         then
-           ARGS="${ARGS} -G \"${USERGROUPS}\""
-         fi
+        if [ ! -z "${USERGROUPS}" ]
+        then
+          ARGS="${ARGS} -G \"${USERGROUPS}\""
+        fi
 
-         add_user "${ARGS}"
+        add_user "${ARGS}"
 
-         # Unset our vars before looking for any more users
-         unset USERNAME USERCOMMENT USERPASS USERSHELL USERHOME USERGROUPS
-       else
-         exit_err "ERROR: commitUser was called without any userName= entry!!!" 
-       fi
-     fi
+        # Unset our vars before looking for any more users
+        unset USERNAME USERCOMMENT USERPASS USERSHELL USERHOME USERGROUPS
+      else
+        exit_err "ERROR: commitUser was called without any userName= entry!!!" 
+      fi
+    fi
 
   done <${CFGF}
 

Modified: pcbsd/stable/pc-sysinstall/backend/functions.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/functions.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # functions.sh
 # Library of functions which pc-sysinstall may call upon
 
@@ -72,18 +98,18 @@
 # Displays an error message and exits with error 1
 exit_err()
 {
-   # Echo the message for the users benefit
-   echo "$1"
+  # Echo the message for the users benefit
+  echo "$1"
 
-   # Save this error to the log file
-   echo "${1}" >>$LOGOUT
+  # Save this error to the log file
+  echo "${1}" >>$LOGOUT
 
-   # Check if we need to unmount any file-systems after this failure
-   unmount_all_filesystems_failure
+  # Check if we need to unmount any file-systems after this failure
+  unmount_all_filesystems_failure
 
-   echo "For more details see log file: $LOGOUT"
+  echo "For more details see log file: $LOGOUT"
 
-   exit 1
+  exit 1
 };
 
 # Run-command, don't halt if command exits with non-0
@@ -112,7 +138,7 @@
   fi
 
   echo "Running: ${CMD}" >>${LOGOUT}
-  ${CMD} >>${LOGOUT} 2>>${LOGOUT}
+  eval ${CMD} >>${LOGOUT} 2>>${LOGOUT}
   STATUS="$?"
   if [ "${STATUS}" != "0" ]
   then
@@ -169,66 +195,67 @@
 };
 
 # Make sure we have a numeric
-is_num() {
-        expr $1 + 1 2>/dev/null
-        return $?
+is_num()
+{
+  expr $1 + 1 2>/dev/null
+  return $?
 }
 
 # Function which uses "fetch" to download a file, and display a progress report
 fetch_file()
 {
 
-FETCHFILE="$1"
-FETCHOUTFILE="$2"
-EXITFAILED="$3"
+  FETCHFILE="$1"
+  FETCHOUTFILE="$2"
+  EXITFAILED="$3"
 
-SIZEFILE="${TMPDIR}/.fetchSize"
-EXITFILE="${TMPDIR}/.fetchExit"
+  SIZEFILE="${TMPDIR}/.fetchSize"
+  EXITFILE="${TMPDIR}/.fetchExit"
 
-rm ${SIZEFILE} 2>/dev/null >/dev/null
-rm ${FETCHOUTFILE} 2>/dev/null >/dev/null
+  rm ${SIZEFILE} 2>/dev/null >/dev/null
+  rm ${FETCHOUTFILE} 2>/dev/null >/dev/null
 
-fetch -s "${FETCHFILE}" >${SIZEFILE}
-SIZE="`cat ${SIZEFILE}`"
-SIZE="`expr ${SIZE} / 1024`"
-echo "FETCH: ${FETCHFILE}"
-echo "FETCH: ${FETCHOUTFILE}" >>${LOGOUT}
+  fetch -s "${FETCHFILE}" >${SIZEFILE}
+  SIZE="`cat ${SIZEFILE}`"
+  SIZE="`expr ${SIZE} / 1024`"
+  echo "FETCH: ${FETCHFILE}"
+  echo "FETCH: ${FETCHOUTFILE}" >>${LOGOUT}
 
-( fetch -o ${FETCHOUTFILE} "${FETCHFILE}" >/dev/null 2>/dev/null ; echo "$?" > ${EXITFILE} ) &
-PID="$!"
-while
-z=1
-do
+  ( fetch -o ${FETCHOUTFILE} "${FETCHFILE}" >/dev/null 2>/dev/null ; echo "$?" > ${EXITFILE} ) &
+  PID="$!"
+  while
+  z=1
+  do
 
-  if [ -e "${FETCHOUTFILE}" ]
-  then
-    DSIZE=`du -k ${FETCHOUTFILE} | tr -d '\t' | cut -d '/' -f 1`
-    if [ $(is_num "$DSIZE") ] ; then
-	if [ $SIZE -lt $DSIZE ] ; then DSIZE="$SIZE"; fi 
+    if [ -e "${FETCHOUTFILE}" ]
+    then
+      DSIZE=`du -k ${FETCHOUTFILE} | tr -d '\t' | cut -d '/' -f 1`
+      if [ $(is_num "$DSIZE") ] ; then
+      if [ $SIZE -lt $DSIZE ] ; then DSIZE="$SIZE"; fi 
     	echo "SIZE: ${SIZE} DOWNLOADED: ${DSIZE}"
     	echo "SIZE: ${SIZE} DOWNLOADED: ${DSIZE}" >>${LOGOUT}
+      fi
     fi
-  fi
 
-  # Check if the download is finished
-  ps -p ${PID} >/dev/null 2>/dev/null
-  if [ "$?" != "0" ]
-  then
-   break;
-  fi
+    # Check if the download is finished
+    ps -p ${PID} >/dev/null 2>/dev/null
+    if [ "$?" != "0" ]
+    then
+      break;
+    fi
 
-  sleep 2
-done
+    sleep 2
+  done
 
-echo "FETCHDONE"
+  echo "FETCHDONE"
 
-EXIT="`cat ${EXITFILE}`"
-if [ "${EXIT}" != "0" -a "$EXITFAILED" = "1" ]
-then
-  exit_err "Error: Failed to download ${FETCHFILE}"
-fi
+  EXIT="`cat ${EXITFILE}`"
+  if [ "${EXIT}" != "0" -a "$EXITFAILED" = "1" ]
+  then
+    exit_err "Error: Failed to download ${FETCHFILE}"
+  fi
 
-return $EXIT
+  return $EXIT
 
 };
 
@@ -256,3 +283,215 @@
     return
   fi
 };
+
+iscompressed()
+{
+  local FILE
+  local RES
+
+  FILE="$1"
+  RES=1
+
+  if echo "${FILE}" | \
+    grep -iE '\.(Z|lzo|lzw|lzma|gz|bz2|xz|zip)$' >/dev/null 2>&1
+  then
+    RES=0
+  fi
+
+  return ${RES}
+}
+
+get_compression_type()
+{
+  local FILE
+  local SUFFIX
+
+  FILE="$1"
+  SUFFIX=`echo "${FILE}" | sed -E 's|^(.+)\.(.+)$|\2|'`
+
+  VAL=""
+  SUFFIX=`echo "${SUFFIX}" | tr A-Z a-z`
+  case "${SUFFIX}" in
+    z) VAL="lzw" ;;
+    lzo) VAL="lzo" ;;
+    lzw) VAL="lzw" ;;
+    lzma) VAL="lzma" ;;
+    gz) VAL="gzip" ;;
+    bz2) VAL="bzip2" ;;
+    xz) VAL="xz" ;;
+    zip) VAL="zip" ;;
+  esac
+
+  export VAL
+}
+
+write_image()
+{
+  local DEVICE_FILE
+
+  IMAGE_FILE="$1"
+  DEVICE_FILE="$2"
+
+  if [ -z "${IMAGE_FILE}" ]
+  then
+    exit_err "ERROR: Image file not specified!"
+  fi
+ 
+  if [ -z "${DEVICE_FILE}" ]
+  then
+    exit_err "ERROR: Device file not specified!"
+  fi
+ 
+  if [ ! -f "${IMAGE_FILE}" ]
+  then
+    exit_err "ERROR: '${IMAGE_FILE}' does not exist!"
+  fi
+
+  DEVICE_FILE="${DEVICE_FILE#/dev/}"
+  DEVICE_FILE="/dev/${DEVICE_FILE}"
+ 
+  if [ ! -c "${DEVICE_FILE}" ]
+  then
+    exit_err "ERROR: '${DEVICE_FILE}' is not a character device!"
+  fi
+
+  if iscompressed "${IMAGE_FILE}"
+  then
+	local COMPRESSION
+
+    get_compression_type "${IMAGE_FILE}"
+	COMPRESSION="${VAL}"
+
+    case "${COMPRESSION}" in
+      lzw)
+        rc_halt "uncompress ${IMAGE_FILE} -c | dd of=${DEVICE_FILE}"
+        IMAGE_FILE="${IMAGE_FILE%.Z}"
+        ;;
+
+      lzo)
+        rc_halt "lzop -d $IMAGE_{FILE} -c | dd of=${DEVICE_FILE}"
+        IMAGE_FILE="${IMAGE_FILE%.lzo}"
+        ;;
+
+      lzma)
+        rc_halt "lzma -d ${IMAGE_FILE} -c | dd of=${DEVICE_FILE}"
+        IMAGE_FILE="${IMAGE_FILE%.lzma}"
+        ;;
+
+      gzip)
+        rc_halt "gunzip ${IMAGE_FILE} -c | dd of=${DEVICE_FILE}"
+        IMAGE_FILE="${IMAGE_FILE%.gz}"
+        ;;
+
+      bzip2)
+        rc_halt "bunzip2 ${IMAGE_FILE} -c | dd of=${DEVICE_FILE}"
+        IMAGE_FILE="${IMAGE_FILE%.bz2}"
+        ;;
+
+      xz)
+        rc_halt "xz -d ${IMAGE_FILE} -c | dd of=${DEVICE_FILE}"
+        IMAGE_FILE="${IMAGE_FILE%.xz}"
+        ;;
+
+      zip)
+        rc_halt "unzip ${IMAGE_FILE} -c | dd of=${DEVICE_FILE}"
+        IMAGE_FILE="${IMAGE_FILE%.zip}"
+        ;;
+
+      *) 
+        exit_err "ERROR: ${COMPRESSION} compression is not supported"
+        ;;
+    esac
+
+  else
+    rc_halt "dd if=${IMAGE_FILE} of=${DEVICE_FILE}"
+
+  fi
+};
+
+install_fresh()
+{
+  # Lets start setting up the disk slices now
+  setup_disk_slice
+  
+  if [ -z "${ROOTIMAGE}" ]
+  then
+
+    # Disk setup complete, now lets parse WORKINGSLICES and setup the bsdlabels
+    setup_disk_label
+  
+    # Now we've setup the bsdlabels, lets go ahead and run newfs / zfs 
+    # to setup the filesystems
+    setup_filesystems
+
+    # Lets mount the partitions now
+    mount_all_filesystems
+
+    # We are ready to begin extraction, lets start now
+    init_extraction 
+
+    # Check if we have any optional modules to load 
+    install_components
+
+    # Check if we have any packages to install
+    install_packages
+
+    # Do any localization in configuration
+    run_localize
+  
+    # Save any networking config on the installed system
+    save_networking_install
+
+    # Now add any users
+    setup_users
+
+    # Now run any commands specified
+    run_commands
+  
+    # Do any last cleanup / setup before unmounting
+    run_final_cleanup
+
+    # Unmount and finish up
+    unmount_all_filesystems
+  fi
+
+  echo_log "Installation finished!"
+};
+
+install_image()
+{
+  # We are ready to begin extraction, lets start now
+  init_extraction 
+
+  echo_log "Installation finished!"
+};
+
+install_upgrade()
+{
+  # We're going to do an upgrade, skip all the disk setup 
+  # and start by mounting the target drive/slices
+  mount_upgrade
+  
+  # Start the extraction process
+  init_extraction
+
+  # Do any localization in configuration
+  run_localize
+
+  # ow run any commands specified
+  run_commands
+  
+  # Merge any old configuration files
+  merge_old_configs
+
+  # Check if we have any optional modules to load 
+  install_components
+
+  # Check if we have any packages to install
+  install_packages
+
+  # All finished, unmount the file-systems
+  unmount_upgrade
+
+  echo_log "Upgrade finished!"
+};

Modified: pcbsd/stable/pc-sysinstall/backend/parseconfig.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/parseconfig.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/parseconfig.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Main install configuration parsing script
 #
 
@@ -9,12 +35,15 @@
 . ${BACKEND}/functions-disk.sh
 . ${BACKEND}/functions-extractimage.sh
 . ${BACKEND}/functions-installcomponents.sh
+. ${BACKEND}/functions-installpackages.sh
 . ${BACKEND}/functions-localize.sh
 . ${BACKEND}/functions-mountdisk.sh
 . ${BACKEND}/functions-networking.sh
 . ${BACKEND}/functions-newfs.sh
+. ${BACKEND}/functions-packages.sh
 . ${BACKEND}/functions-parse.sh
 . ${BACKEND}/functions-runcommands.sh
+. ${BACKEND}/functions-ftp.sh
 . ${BACKEND}/functions-unmount.sh
 . ${BACKEND}/functions-upgrade.sh
 . ${BACKEND}/functions-users.sh
@@ -44,9 +73,9 @@
 check_value installMode "fresh upgrade"
 check_value bootManager "bsd none"
 check_value installType "PCBSD FreeBSD"
-check_value installMedium "dvd usb ftp rsync"
+check_value installMedium "dvd usb ftp rsync image"
 check_value packageType "uzip tar rsync split"
-if_check_value_exists partition "all ALL s1 s2 s3 s4 free FREE"
+if_check_value_exists partition "all s1 s2 s3 s4 free image"
 if_check_value_exists mirrorbal "load prefer round-robin split"
 
 # We passed all sanity checks! Yay, lets start the install
@@ -69,73 +98,23 @@
 start_networking
 
 # If we are not doing an upgrade, lets go ahead and setup the disk
-if [ "${INSTALLMODE}" = "fresh" ]
-then
+case "${INSTALLMODE}" in
+  fresh)
+    if [ "${INSTALLMEDIUM}" = "image" ]
+    then
+      install_image
+    else
+      install_fresh
+    fi
+    ;;
 
-  # Lets start setting up the disk slices now
-  setup_disk_slice
-  
-  # Disk setup complete, now lets parse WORKINGSLICES and setup the bsdlabels
-  setup_disk_label
-  
-  # Now we've setup the bsdlabels, lets go ahead and run newfs / zfs 
-  # to setup the filesystems
-  setup_filesystems
+  upgrade)
+    install_upgrade
+    ;;
 
-  # Lets mount the partitions now
-  mount_all_filesystems
+  *)
+    exit 1
+    ;;
+esac
 
-  # We are ready to begin extraction, lets start now
-  init_extraction
-
-  # Check if we have any optional modules to load 
-  install_components
-
-  # Do any localization in configuration
-  run_localize
-  
-  # Save any networking config on the installed system
-  save_networking_install
-
-  # Now add any users
-  setup_users
-
-  # Now run any commands specified
-  run_commands
-  
-  # Do any last cleanup / setup before unmounting
-  run_final_cleanup
-
-  # Unmount and finish up
-  unmount_all_filesystems
-
-  echo_log "Installation finished!"
-  exit 0
-
-else
-  # We're going to do an upgrade, skip all the disk setup 
-  # and start by mounting the target drive/slices
-  mount_upgrade
-  
-  # Start the extraction process
-  init_extraction
-
-  # Do any localization in configuration
-  run_localize
-
-  # Now run any commands specified
-  run_commands
-  
-  # Merge any old configuration files
-  merge_old_configs
-
-  # Check if we have any optional modules to load 
-  install_components
-
-  # All finished, unmount the file-systems
-  unmount_upgrade
-
-  echo_log "Upgrade finished!"
-  exit 0
-fi
-
+exit 0

Modified: pcbsd/stable/pc-sysinstall/backend/startautoinstall.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/startautoinstall.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend/startautoinstall.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,6 +1,31 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
 # Script which reads the pc-autoinstall.conf directive, and begins the install
 #
+# $FreeBSD$
 
 # Source our functions scripts
 . ${BACKEND}/functions.sh

Modified: pcbsd/stable/pc-sysinstall/backend-partmanager/create-part.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-partmanager/create-part.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-partmanager/create-part.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Query a disk for partitions and display them
 #############################
 
@@ -43,7 +69,7 @@
 
 # Lets get the starting block
 if [ "${SLICENUM}" = "1" ] ; then
-  STARTBLOCK="63"
+  STARTBLOCK="64"
 else
   # Lets figure out where the prior slice ends
   checkslice="`expr ${SLICENUM} - 1`"

Modified: pcbsd/stable/pc-sysinstall/backend-partmanager/delete-part.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-partmanager/delete-part.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-partmanager/delete-part.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Delete a specified partition, takes effect immediately
 ########################################################
 

Modified: pcbsd/stable/pc-sysinstall/backend-query/detect-emulation.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/detect-emulation.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/detect-emulation.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -23,7 +23,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: src/usr.sbin/pc-sysinstall/backend-query/detect-vmware.sh,v 1.2 2010/06/27 16:46:11 imp Exp $
+# $FreeBSD$
 
 case "$(kenv smbios.system.product)" in
 VirtualBox)

Modified: pcbsd/stable/pc-sysinstall/backend-query/detect-laptop.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/detect-laptop.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/detect-laptop.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,7 +1,32 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
 
-if devinfo | grep 'acpi_acad0' >/dev/null 2>/dev/null; then
+if devinfo | grep -q acpi_acad0; then
   echo "laptop: YES"
 else
   echo "laptop: NO"
-fi 
+fi

Modified: pcbsd/stable/pc-sysinstall/backend-query/detect-nics.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/detect-nics.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/detect-nics.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -23,7 +23,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: src/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh,v 1.2 2010/06/27 16:46:11 imp Exp $
+# $FreeBSD$
 
 for i in $(ifconfig -l); do
   case "${i%%[0-9]*}" in

Modified: pcbsd/stable/pc-sysinstall/backend-query/disk-info.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/disk-info.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/disk-info.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,24 +1,42 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Query a disk for partitions and display them
-#############################
+#############################################################################
 
 . ${PROGDIR}/backend/functions.sh
 . ${PROGDIR}/backend/functions-disk.sh
 
-if [ -z "${1}" ]
-then
-  echo "Error: No disk specified!"
-  exit 1
-fi
+DISK="${1}"
 
-if [ ! -e "/dev/${1}" ]
-then
-  echo "Error: Disk /dev/${1} does not exist!"
-  exit 1
-fi
+[ -z "${DISK}" ] && { echo 'Error: No disk specified!'; exit 1; }
+[ ! -e "/dev/${DISK}" ] && \
+	{ echo "Error: Disk /dev/${DISK} does not exist!"; exit 1; }
 
-DISK="${1}"
-
 get_disk_cyl "${DISK}"
 CYLS="${VAL}"
 
@@ -28,15 +46,15 @@
 get_disk_sectors "${DISK}"
 SECS="${VAL}"
 
-echo "cylinders=${CYLS}"
-echo "heads=${HEADS}"
-echo "sectors=${SECS}"
-
 # Now get the disks size in MB
 KB="`diskinfo -v ${1} | grep 'bytes' | cut -d '#' -f 1 | tr -s '\t' ' ' | tr -d ' '`"
 MB=$(convert_byte_to_megabyte ${KB})
-echo "size=$MB"
 
 # Now get the Controller Type
 CTYPE="`dmesg | grep "^${1}:" | grep "B <" | cut -d '>' -f 2 | cut -d ' ' -f 3-10`"
-echo "type=$CTYPE"
+
+echo "cylinders=${CYLS}"
+echo "heads=${HEADS}"
+echo "sectors=${SECS}"
+echo "size=${MB}"
+echo "type=${CTYPE}"

Modified: pcbsd/stable/pc-sysinstall/backend-query/disk-list.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/disk-list.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/disk-list.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,7 +1,62 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
 
+ARGS=$1
+FLAGS_MD=""
+FLAGS_CD=""
+FLAGS_VERBOSE=""
+
+shift
+while [ -n "$1" ]
+do
+  case "$1" in
+    -m)
+      FLAGS_MD=1
+      ;;
+    -v)
+      FLAGS_VERBOSE=1
+      ;;
+    -c)
+      FLAGS_CD=1
+      ;;
+  esac
+  shift
+done
+
 # Create our device listing
 SYSDISK=$(sysctl -n kern.disks)
+if [ -n "${FLAGS_MD}" ]
+then
+  MDS=`mdconfig -l`
+  if [ -n "${MDS}" ]
+  then
+    SYSDISK="${SYSDISK} ${MDS}"
+  fi
+fi
 
 # Now loop through these devices, and list the disk drives
 for i in ${SYSDISK}
@@ -11,9 +66,12 @@
   DEV="${i}"
 
   # Make sure we don't find any cd devices
-  case "${DEV}" in
-     acd[0-9]*|cd[0-9]*|scd[0-9]*) continue ;;
-  esac
+  if [ -z "${FLAGS_CD}" ]
+  then
+    case "${DEV}" in
+      acd[0-9]*|cd[0-9]*|scd[0-9]*) continue ;;
+    esac
+  fi
 
   # Check the dmesg output for some more info about this device
   NEWLINE=$(dmesg | sed -n "s/^$DEV: .*<\(.*\)>.*$/ <\1>/p" | head -n 1)
@@ -21,6 +79,16 @@
     NEWLINE=" <Unknown Device>"
   fi
 
+  if [ -n "${FLAGS_MD}" ] && echo "${DEV}" | grep -E '^md[0-9]+' >/dev/null 2>/dev/null
+  then
+	NEWLINE=" <Memory Disk>"
+  fi
+
+  if [ -n "${FLAGS_VERBOSE}" ]
+  then
+	:
+  fi
+
   # Save the disk list
   if [ ! -z "$DLIST" ]
   then

Modified: pcbsd/stable/pc-sysinstall/backend-query/disk-part.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/disk-part.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/disk-part.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Query a disk for partitions and display them
 #############################
 
@@ -25,8 +51,6 @@
 TOTALSIZE="$MB"
 TOTALB="`diskinfo -v ${1} | grep 'in sectors' | tr -s '\t' ' ' | cut -d ' ' -f 2`"
 
-
-
 gpart show ${1} >/dev/null 2>/dev/null
 if [ "$?" != "0" ] ; then
   # No partitions on this disk, display entire disk size and exit
@@ -59,14 +83,14 @@
 
   # First get the sysid / label for this partition
   if [ "$TYPE" = "MBR" ] ; then
-     get_partition_sysid_mbr "${DISK}" "${curpart}"
-     echo "${curpart}-sysid: ${VAL}"
-     get_partition_label_mbr "${DISK}" "${curpart}"
-     echo "${curpart}-label: ${VAL}"
+    get_partition_sysid_mbr "${DISK}" "${curpart}"
+    echo "${curpart}-sysid: ${VAL}"
+    get_partition_label_mbr "${DISK}" "${curpart}"
+    echo "${curpart}-label: ${VAL}"
   else
-     get_partition_label_gpt "${DISK}" "${curpart}"
-     echo "${curpart}-sysid: ${VAL}"
-     echo "${curpart}-label: ${VAL}"
+    get_partition_label_gpt "${DISK}" "${curpart}"
+    echo "${curpart}-sysid: ${VAL}"
+    echo "${curpart}-label: ${VAL}"
   fi
 
   # Now get the startblock, blocksize and MB size of this partition

Modified: pcbsd/stable/pc-sysinstall/backend-query/enable-net.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/enable-net.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/enable-net.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Script which enables networking with specified options
 ###########################################################################
 
@@ -34,6 +60,6 @@
 fi
 
 case ${MIRRORFETCH} in
-   ON|on|yes|YES) fetch -o /tmp/mirrors-list.txt ${MIRRORLIST} >/dev/null 2>/dev/null;;
-   *) ;;
+  ON|on|yes|YES) fetch -o /tmp/mirrors-list.txt ${MIRRORLIST} >/dev/null 2>/dev/null;;
+  *) ;;
 esac

Modified: pcbsd/stable/pc-sysinstall/backend-query/list-components.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/list-components.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/list-components.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Script which lists the available components for this release
 ###########################################################################
 
@@ -6,23 +32,24 @@
 
 echo "Available Components:"
 
-cd ${COMPDIR}
-for i in `ls -d *`
-do
-  if [ -e "${i}/component.cfg" -a -e "${i}/install.sh" -a -e "${i}/distfiles" ]
-  then
-    NAME="`grep 'name:' ${i}/component.cfg | cut -d ':' -f 2`"
-    DESC="`grep 'description:' ${i}/component.cfg | cut -d ':' -f 2`"
-    TYPE="`grep 'type:' ${i}/component.cfg | cut -d ':' -f 2`"
-    echo " "
-    echo "name: ${i}"
-    echo "desc:${DESC}"
-    echo "type:${TYPE}"
-    if [ -e "${i}/component.png" ]
+if [ -d "${COMPDIR}" ]
+then
+  cd ${COMPDIR}
+  for i in `ls -d *`
+  do
+    if [ -e "${i}/component.cfg" -a -e "${i}/install.sh" -a -e "${i}/distfiles" ]
     then
-      echo "icon: ${COMPDIR}/${i}/component.png"
+      NAME="`grep 'name:' ${i}/component.cfg | cut -d ':' -f 2`"
+      DESC="`grep 'description:' ${i}/component.cfg | cut -d ':' -f 2`"
+      TYPE="`grep 'type:' ${i}/component.cfg | cut -d ':' -f 2`"
+      echo " "
+      echo "name: ${i}"
+      echo "desc:${DESC}"
+      echo "type:${TYPE}"
+      if [ -e "${i}/component.png" ]
+      then
+        echo "icon: ${COMPDIR}/${i}/component.png"
+      fi
     fi
-  fi
-
-done
-
+  done
+fi

Modified: pcbsd/stable/pc-sysinstall/backend-query/list-rsync-backups.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/list-rsync-backups.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/list-rsync-backups.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Script which lists the backups present on a server
 ###########################################################################
 

Modified: pcbsd/stable/pc-sysinstall/backend-query/list-tzones.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/list-tzones.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/list-tzones.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,18 +1,34 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
 
-rm ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null
-
 # Backend script which lists all the available timezones for front-ends to display
-while read line
-do
-  echo "$line" | grep "^#" >/dev/null 2>/dev/null
-  if [ "$?" != "0" ]
-  then
-    echo "$line" |  tr -s "\t" ":" | cut -d ":" -f 3-4 >>${TMPDIR}/.tzonetmp
-  fi
-done < /usr/share/zoneinfo/zone.tab
+egrep -v '^#' /usr/share/zoneinfo/zone.tab |\
+  tr -s "\t" ":" |\
+  cut -d ":" -f 3-4 |\
+  sort
 
-sort ${TMPDIR}/.tzonetmp
-rm -f ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null
-
 exit 0

Modified: pcbsd/stable/pc-sysinstall/backend-query/query-langs.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/query-langs.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/query-langs.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,7 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
 
-FOUND="0"
-
 cat ${PROGDIR}/conf/avail-langs
 
 exit 0

Modified: pcbsd/stable/pc-sysinstall/backend-query/send-logs.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/send-logs.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/send-logs.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Script which creates a gzipped log and optionally mails it to the specified address
 ############################################################################
 
@@ -24,7 +50,7 @@
 then
   echo "" >>${TMPLOG}
   echo "# PC-SYSINSTALL CFG " >>${TMPLOG}
-  cat /tmp/sys-install.cfg >> ${TMPLOG}
+  cat /tmp/sys-install.cfg | grep -v 'rootPass' | grep -v 'userPass' >> ${TMPLOG}
 fi
 
 # Save dmesg output
@@ -33,7 +59,7 @@
 dmesg >> ${TMPLOG}
 
 # Get gpart info on all disks
-for i in `${PROGDIR}/pc-sysinstall disk-list | cut -d ':' -f 1`
+for i in `pc-sysinstall disk-list | cut -d ':' -f 1`
 do
   echo "" >>${TMPLOG}
   echo "# DISK INFO $i " >>${TMPLOG}

Modified: pcbsd/stable/pc-sysinstall/backend-query/setup-ssh-keys.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/setup-ssh-keys.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/setup-ssh-keys.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,30 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Script which sets up password-less logins for ssh host
 ###########################################################################
 

Modified: pcbsd/stable/pc-sysinstall/backend-query/sys-mem.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/sys-mem.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/sys-mem.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,6 +1,28 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
 
-MEM=`sysctl hw.realmem | sed "s|hw.realmem: ||g"`
-MEM=`expr $MEM / 1024`
-MEM=`expr $MEM / 1024`
-echo $MEM
+expr $(sysctl -n hw.realmem) / 1048576

Modified: pcbsd/stable/pc-sysinstall/backend-query/test-live.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/test-live.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/test-live.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,14 +1,33 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
 # Script which checks if we are running from install media, or real system
 #############################################################################
 
-dmesg | grep "md0: Preloaded image" >/dev/null 2>/dev/null
-if [ "$?" = "0" ]
-then
-  echo "INSTALL-MEDIA"
-  exit 0
-else
-  echo "REAL-DISK"
-  exit 1
-fi
+dmesg | grep -q 'md0: Preloaded image' || { echo 'REAL-DISK'; exit 1; }
 
+echo 'INSTALL-MEDIA'

Modified: pcbsd/stable/pc-sysinstall/backend-query/test-netup.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/test-netup.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/test-netup.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,31 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+
+
 # Script which tests "fetch" when using a network connection, and saves
 # if we are using direct connect, or need FTP passive mode
 #############################################################################
@@ -8,15 +35,15 @@
 ping -c 2 www.pcbsd.org >/dev/null 2>/dev/null
 if [ "$?" = "0" ]
 then
-   echo "ftp: Up"
-   exit 0
+  echo "ftp: Up"
+  exit 0
 fi
 
 ping -c 2 www.freebsd.org >/dev/null 2>/dev/null
 if [ "$?" = "0" ]
 then
-   echo "ftp: Up"
-   exit 0
+  echo "ftp: Up"
+  exit 0
 fi
    
 echo "ftp: Down"

Modified: pcbsd/stable/pc-sysinstall/backend-query/update-part-list.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/update-part-list.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/update-part-list.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,29 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
 
 # Need access to a some unmount functions
 . ${PROGDIR}/backend/functions-unmount.sh
@@ -10,16 +35,17 @@
 FSMNT="/mnt"
 
 # Get the freebsd version on this partition
-get_fbsd_ver() {
+get_fbsd_ver()
+{
 
   VER="`file ${FSMNT}/bin/sh | grep 'for FreeBSD' | sed 's|for FreeBSD |;|g' | cut -d ';' -f 2 | cut -d ',' -f 1`"
   if [ "$?" = "0" ] ; then
-      file ${FSMNT}/bin/sh | grep '32-bit' >/dev/null 2>/dev/null
-      if [ "${?}" = "0" ] ; then
-        echo "${1}: FreeBSD ${VER} (32bit)"
-      else
-        echo "${1}: FreeBSD ${VER} (64bit)"
-      fi
+    file ${FSMNT}/bin/sh | grep '32-bit' >/dev/null 2>/dev/null
+    if [ "${?}" = "0" ] ; then
+      echo "${1}: FreeBSD ${VER} (32bit)"
+    else
+      echo "${1}: FreeBSD ${VER} (64bit)"
+    fi
   fi
 
 }
@@ -37,7 +63,7 @@
   # Make sure we don't find any cd devices
   echo "${DEV}" | grep -e "^acd[0-9]" -e "^cd[0-9]" -e "^scd[0-9]" >/dev/null 2>/dev/null
   if [ "$?" != "0" ] ; then
-   DEVS="${DEVS} `ls /dev/${i}*`" 
+    DEVS="${DEVS} `ls /dev/${i}*`" 
   fi
 
 done
@@ -45,25 +71,25 @@
 # Search for regular UFS / Geom Partitions to upgrade
 for i in $DEVS
 do
-    if [ ! -e "${i}a.journal" -a ! -e "${i}a" -a ! -e "${i}p2" -a ! -e "${i}p2.journal" ] ; then
-	continue
-    fi
+  if [ ! -e "${i}a.journal" -a ! -e "${i}a" -a ! -e "${i}p2" -a ! -e "${i}p2.journal" ] ; then
+    continue
+  fi
 
-    if [ -e "${i}a.journal" ] ; then
-	_dsk="${i}a.journal" 
-    elif [ -e "${i}a" ] ; then
-	_dsk="${i}a" 
-    elif [ -e "${i}p2" ] ; then
-	_dsk="${i}p2" 
-    elif [ -e "${i}p2.journal" ] ; then
-	_dsk="${i}p2.journal" 
-    fi
+  if [ -e "${i}a.journal" ] ; then
+    _dsk="${i}a.journal" 
+  elif [ -e "${i}a" ] ; then
+    _dsk="${i}a" 
+  elif [ -e "${i}p2" ] ; then
+    _dsk="${i}p2" 
+  elif [ -e "${i}p2.journal" ] ; then
+    _dsk="${i}p2.journal" 
+  fi
 
-   mount -o ro ${_dsk} ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
-   if [ "${?}" = "0" -a -e "${FSMNT}/bin/sh" ] ; then
-    	get_fbsd_ver "`echo ${_dsk} | sed 's|/dev/||g'`"
-        umount -f ${FSMNT} >/dev/null 2>/dev/null
-   fi
+  mount -o ro ${_dsk} ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
+  if [ "${?}" = "0" -a -e "${FSMNT}/bin/sh" ] ; then
+    get_fbsd_ver "`echo ${_dsk} | sed 's|/dev/||g'`"
+    umount -f ${FSMNT} >/dev/null 2>/dev/null
+  fi
 done
 
 # Now search for any ZFS root partitions
@@ -76,9 +102,9 @@
 _zps="`zpool list | grep -v 'NAME' | cut -d ' ' -f 1`"
 for _zpools in ${_zps}
 do
-   mount -o ro -t zfs ${_zpools} ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
-   if [ "${?}" = "0" -a -e "${FSMNT}/bin/sh" ] ; then
-    	get_fbsd_ver "${_zpools}"
-        umount -f ${FSMNT} >/dev/null 2>/dev/null
-   fi
+  mount -o ro -t zfs ${_zpools} ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
+  if [ "${?}" = "0" -a -e "${FSMNT}/bin/sh" ] ; then
+    get_fbsd_ver "${_zpools}"
+    umount -f ${FSMNT} >/dev/null 2>/dev/null
+  fi
 done

Modified: pcbsd/stable/pc-sysinstall/backend-query/xkeyboard-layouts.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/xkeyboard-layouts.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/xkeyboard-layouts.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,29 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
 
 FOUND="0"
 
@@ -11,7 +36,7 @@
     echo $line | grep '! ' >/dev/null 2>/dev/null
     if [ "$?" = "0" ]
     then
-     exit 0
+      exit 0
     else 
       echo "$line"
     fi 

Modified: pcbsd/stable/pc-sysinstall/backend-query/xkeyboard-models.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/xkeyboard-models.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/xkeyboard-models.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,29 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
 
 FOUND="0"
 
@@ -11,7 +36,7 @@
     echo $line | grep '! ' >/dev/null 2>/dev/null
     if [ "$?" = "0" ]
     then
-     exit 0
+      exit 0
     else 
       model="`echo $line | sed 's|(|[|g'`"
       model="`echo $model | sed 's|)|]|g'`"

Modified: pcbsd/stable/pc-sysinstall/backend-query/xkeyboard-variants.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend-query/xkeyboard-variants.sh	2010-12-01 20:18:51 UTC (rev 8125)
+++ pcbsd/stable/pc-sysinstall/backend-query/xkeyboard-variants.sh	2010-12-01 20:38:39 UTC (rev 8126)
@@ -1,4 +1,29 @@
 #!/bin/sh
+#-
+# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
 
 FOUND="0"
 
@@ -11,7 +36,7 @@
     echo $line | grep '! ' >/dev/null 2>/dev/null
     if [ "$?" = "0" ]
     then
-     exit 0
+      exit 0
     else 
       echo "$line"
     fi 



More information about the Commits mailing list