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

svn at pcbsd.org svn at pcbsd.org
Wed Apr 7 09:05:19 PDT 2010


Author: kris
Date: 2010-04-07 09:05:18 -0700 (Wed, 07 Apr 2010)
New Revision: 6521

Modified:
   pcbsd/trunk/pc-sysinstall/backend-query/send-logs.sh
   pcbsd/trunk/pc-sysinstall/backend/functions-bsdlabel.sh
   pcbsd/trunk/pc-sysinstall/backend/functions-disk.sh
   pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh
   pcbsd/trunk/pc-sysinstall/backend/parseconfig.sh
Log:

Update to pc-sysinstall

* Fix syntax bug in upgrade functions
* Removed more fdisk and replaced with gpart functionality
* Added option to use packageType=rsync which will be used for restores



Modified: pcbsd/trunk/pc-sysinstall/backend/functions-bsdlabel.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-bsdlabel.sh	2010-04-07 15:09:16 UTC (rev 6520)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-bsdlabel.sh	2010-04-07 16:05:18 UTC (rev 6521)
@@ -511,7 +511,7 @@
     exit_err "ERROR: No slices were setup! Please report this to the maintainers"
   fi
 
-  # Check that the slices we have did indeed get setup and fdisk worked
+  # Check that the slices we have did indeed get setup and gpart worked
   for i in $WORKINGSLICES
   do
     disk="`echo $i | cut -d '-' -f 1`" 

Modified: pcbsd/trunk/pc-sysinstall/backend/functions-disk.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-disk.sh	2010-04-07 15:09:16 UTC (rev 6520)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-disk.sh	2010-04-07 16:05:18 UTC (rev 6521)
@@ -154,7 +154,7 @@
        if [ "${PTYPE}" = "free" -o "${PTYPE}" = "FREE" ]
        then
          # Lets figure out what number this slice will be
-         LASTSLICE="`fdisk -s /dev/${DISK} | grep -v ${DISK} | grep ':' | tail -n 1 | cut -d ':' -f 1 | tr -s '\t' ' ' | tr -d ' '`"
+         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"
@@ -364,6 +364,13 @@
   slice="${DISK}s${SLICENUM}"
   slicenum="${SLICENUM}" 
 
+  # Working on the first slice, make sure we have MBR setup
+  gpart show ${DISK} >/dev/null 2>/dev/null
+  if [ "$?" != "0" -a "$SLICENUM" = "1" ] ; then
+    echo_log "Initializing disk, no existing MBR setup"
+    rc_halt "gpart create -s mbr ${DISK}"
+  fi
+
   # Lets get the starting block first
   if [ "${slicenum}" = "1" ]
   then
@@ -373,21 +380,20 @@
      checkslice="`expr ${slicenum} - 1`"
 
      # Get starting block of this slice
-     fdisk -s /dev/${DISK} | grep -v "${DISK}:" | grep "${checkslice}:" | tr -s " " >${TMPDIR}/pfdisk
-     pstartblock="`cat ${TMPDIR}/pfdisk | cut -d ' ' -f 3`"
-     psize="`cat ${TMPDIR}/pfdisk | cut -d ' ' -f 4`"
-     startblock="`expr ${pstartblock} + ${psize}`"
+     sblk=`gpart show ${DISK} | grep -v ${DISK} | tr -s '\t' ' ' | sed '/^$/d' | grep " ${checkslice} " | cut -d ' ' -f 2`
+     blksize=`gpart show ${DISK} | grep -v ${DISK} | tr -s '\t' ' ' | sed '/^$/d' | grep " ${checkslice} " | cut -d ' ' -f 3`
+     startblock="`expr ${sblk} + ${blksize}`"
   fi
 
   # No slice after the new slice, lets figure out the free space remaining and use it
   # Get the cyl of this disk
-  cyl=`fdisk -s /dev/${DISK} | grep "${DISK}:" | tr -s ' ' | cut -d ' ' -f 2`
+  cyl=`diskinfo -v ${DISK} | grep "# Cylinders" | tr -s ' ' | cut -f 2`
 
   # Get the heads of this disk
-  head=`fdisk -s /dev/${DISK} | grep "${DISK}:" | tr -s ' ' | cut -d ' ' -f 4`
+  head=`diskinfo -v ${DISK} | grep "# Heads" | tr -s ' ' | cut -f 2`
 
   # Get the tracks/sectors of this disk
-  sec=`fdisk -s /dev/${DISK} | grep "${DISK}:" | tr -s ' ' | cut -d ' ' -f 6`
+  sec=`diskinfo -v ${DISK} | grep "# Sectors" | tr -s ' ' | cut -f 2`
 
   # Multiply them all together to get our total blocks
   totalblocks="`expr ${cyl} \* ${head}`"

Modified: pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh	2010-04-07 15:09:16 UTC (rev 6520)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh	2010-04-07 16:05:18 UTC (rev 6521)
@@ -194,9 +194,9 @@
 
 
     # if the user wants to keep their original .kde4 profile
-    ############################################################################3
+    ###########################################################################
     get_value_from_cfg "upgradeKeepDesktopProfile"
-    if [ "$VAL" = "YES -o "$VAL" = "yes" ] ; then
+    if [ "$VAL" = "YES" -o "$VAL" = "yes" ] ; then
       echo '#!/bin/sh
       cd /home
 for i in `ls`

Modified: pcbsd/trunk/pc-sysinstall/backend/parseconfig.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/parseconfig.sh	2010-04-07 15:09:16 UTC (rev 6520)
+++ pcbsd/trunk/pc-sysinstall/backend/parseconfig.sh	2010-04-07 16:05:18 UTC (rev 6521)
@@ -45,7 +45,7 @@
 check_value bootManager "bsd none"
 check_value installType "PCBSD FreeBSD"
 check_value installMedium "dvd usb ftp rsync"
-check_value packageType "uzip tar"
+check_value packageType "uzip tar rsync"
 check_value partition "all ALL s1 s2 s3 s4 free FREE"
 if_check_value_exists mirrorbal "load prefer round-robin split"
 

Modified: pcbsd/trunk/pc-sysinstall/backend-query/send-logs.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend-query/send-logs.sh	2010-04-07 15:09:16 UTC (rev 6520)
+++ pcbsd/trunk/pc-sysinstall/backend-query/send-logs.sh	2010-04-07 16:05:18 UTC (rev 6521)
@@ -32,13 +32,13 @@
 echo "# DMESG OUTPUT " >>${TMPLOG}
 dmesg >> ${TMPLOG}
 
-# Get fdisk info on all disks
+# Get gpart info on all disks
 for i in `${PROGDIR}/pc-sysinstall disk-list | cut -d ':' -f 1`
 do
   echo "" >>${TMPLOG}
   echo "# DISK INFO $i " >>${TMPLOG}
   ls /dev/${i}* >>${TMPLOG}
-  fdisk ${i} >> ${TMPLOG}
+  gpart show ${i} >> ${TMPLOG}
 done
 
 # Show Mounted volumes



More information about the Commits mailing list