[PC-BSD Commits] r2809 - in pcbsd: branches/7.0/installcd-overlay/usr/local/pcbsd/scripts trunk/installcd-overlay/usr/local/pcbsd/scripts

svn at pcbsd.org svn at pcbsd.org
Tue Sep 23 07:57:22 PDT 2008


Author: kris
Date: 2008-09-23 07:57:22 -0700 (Tue, 23 Sep 2008)
New Revision: 2809

Modified:
   pcbsd/branches/7.0/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh
   pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh
Log:

Updated our code which does the fdisk of a particular partition, this should fix a reported
error of partition alignment getting thrown off during install. Now values will not be
caculated, rather they will be pulled directly from fdisk, and allow fdisk to set the start / end blocks properly



Modified: pcbsd/branches/7.0/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh
===================================================================
--- pcbsd/branches/7.0/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh	2008-09-22 19:57:11 UTC (rev 2808)
+++ pcbsd/branches/7.0/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh	2008-09-23 14:57:22 UTC (rev 2809)
@@ -15,6 +15,10 @@
 # Get the device name without the /dev on it
 rawslice="`echo ${2} | cut -d '/' -f 3`"
 
+# Get the number of the slice we are working on
+slicenum="`echo ${2} | awk '{print substr($0,length,1)}'`"
+
+
 # Check if we need to shutdown any journals on this partition
 ls ${slice}*.journal* >/dev/null 2>/dev/null
 if [ "$?" = "0" ]
@@ -30,8 +34,19 @@
 fi
 
 # Make sure we have disabled swap on this drive
-swapoff ${slice}b
+if [ -e "${slice}b" ]
+then
+  swapoff ${slice}b
+fi
 
+# Get the fdisk -s output of this device
+fdisk -s /dev/${device} | grep -v "${device}:" | grep "${slicenum}:" | tr -s " " > /tmp/fdiskblk
+startblock="`cat /tmp/fdiskblk | cut -d ' ' -f 3`"
+endblock="`cat /tmp/fdiskblk | cut -d ' ' -f 4`"
+
+# Create the new fdiskconfig file now to set this partition to type 165
+echo "p	${slicenum}	165	${startblock}	${endblock}" > /tmp/fdiskconfig
+
 sleep 4
 
 # Install new partition setup

Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh	2008-09-22 19:57:11 UTC (rev 2808)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh	2008-09-23 14:57:22 UTC (rev 2809)
@@ -15,6 +15,10 @@
 # Get the device name without the /dev on it
 rawslice="`echo ${2} | cut -d '/' -f 3`"
 
+# Get the number of the slice we are working on
+slicenum="`echo ${2} | awk '{print substr($0,length,1)}'`"
+
+
 # Check if we need to shutdown any journals on this partition
 ls ${slice}*.journal* >/dev/null 2>/dev/null
 if [ "$?" = "0" ]
@@ -30,8 +34,19 @@
 fi
 
 # Make sure we have disabled swap on this drive
-swapoff ${slice}b
+if [ -e "${slice}b" ]
+then
+  swapoff ${slice}b
+fi
 
+# Get the fdisk -s output of this device
+fdisk -s /dev/${device} | grep -v "${device}:" | grep "${slicenum}:" | tr -s " " > /tmp/fdiskblk
+startblock="`cat /tmp/fdiskblk | cut -d ' ' -f 3`"
+endblock="`cat /tmp/fdiskblk | cut -d ' ' -f 4`"
+
+# Create the new fdiskconfig file now to set this partition to type 165
+echo "p	${slicenum}	165	${startblock}	${endblock}" > /tmp/fdiskconfig
+
 sleep 4
 
 # Install new partition setup



More information about the Commits mailing list