[PC-BSD Commits] r597 - pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts

svn at pcbsd.org svn at pcbsd.org
Tue Aug 14 08:43:04 PDT 2007


Author: kris
Date: 2007-08-14 08:43:03 -0700 (Tue, 14 Aug 2007)
New Revision: 597

Modified:
   pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindDisk.sh
Log:

Upgraded the find disk script to fix issues with laptops when the dmesg.boot
file is misformatted



Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindDisk.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindDisk.sh	2007-08-14 01:53:09 UTC (rev 596)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindDisk.sh	2007-08-14 15:43:03 UTC (rev 597)
@@ -2,6 +2,37 @@
 
 FOUND="0"
 
+# Check for IDE a badly formatted /var/run/dmesg.boot file first
+cat /var/run/dmesg.boot | grep "^md0:" | grep "ad0: " >/dev/null 2>/dev/null
+if [ "$?" = "0" ]
+then
+ # Looks like we have a messed up line, clean it up
+ VAR="`cat /var/run/dmesg.boot | grep "^md0:" | grep "ad0: " | cut -d ":" -f 3`"
+
+ # Make sure this line isn't already in the file
+ cat /var/run/dmesg.boot | grep "^ad0: " >/dev/null 2>/dev/null
+ if [ "$?" != "0" ]
+ then
+   echo "ad0:${VAR}" >>/var/run/dmesg.boot
+ fi
+fi
+
+# Check for SCSI in a badly formatted /var/run/dmesg.boot file first
+cat /var/run/dmesg.boot | grep "^md0:" | grep "da0: " >/dev/null 2>/dev/null
+if [ "$?" = "0" ]
+then
+ # Looks like we have a messed up line, clean it up
+ VAR="`cat /var/run/dmesg.boot | grep "^md0:" | grep "da0: " | cut -d ":" -f 3`"
+ 
+ # Make sure this line isn't already in the file
+ cat /var/run/dmesg.boot | grep "^da0: " >/dev/null 2>/dev/null
+ if [ "$?" != "0" ]
+ then
+   echo "da0:${VAR}" >>/var/run/dmesg.boot
+ fi
+fi
+
+
 for i in `egrep "^(ad|aacd|mlxd|mlyd|amrd|idad|twed|da|ar|ips|)[0-9]:" /var/run/dmesg.boot | cut -d':' -f1 | sort | uniq`
 do
   LN="`cat /var/run/dmesg.boot | grep ^$i | grep MB`" >/dev/null
@@ -10,7 +41,7 @@
   FOUND="1"
 done
 
-If we couldn't find anything in the dmesg file, look for devices instead
+#If we couldn't find anything in the dmesg file, look for devices instead
 if [ "${FOUND}" = "0" ]
 then
   if [ -e "/dev/ad0" ]
@@ -18,6 +49,10 @@
      echo "ad0: XXXXXXMB <Unprobed IDE Disk>"
      fdisk /dev/ad0 >/tmp/ad0  
   fi
-
+  if [ -e "/dev/da0" ]
+  then
+     echo "ad0: XXXXXXMB <Unprobed SCSI Disk>"
+     fdisk /dev/ad0 >/tmp/ad0  
+  fi
 fi
 



More information about the Commits mailing list