]> code.delx.au - refind/commitdiff
Improvements to install.sh's new ESP-detection code.
authorsrs5694 <srs5694@users.sourceforge.net>
Fri, 3 Jan 2014 18:24:09 +0000 (13:24 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Fri, 3 Jan 2014 18:24:09 +0000 (13:24 -0500)
NEWS.txt
install.sh

index e2485d453753a7c6897fb49c70d24db09ff13874..46cbccc4491181c1eb50af562e9297a3af7d0a77 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,5 +1,5 @@
-0.7.7 (12/??/2013):
--------------------
+0.7.7 (1/??/2014):
+------------------
 
 - Can now specify complete paths, optionally including volumes, in
   dont_scan_files.
index 41d1817efdec839eb54f01d8d61c7495fb08a6ff..d1f706ca4397eb9dfe429292f47ca7e07ec7a11e 100755 (executable)
@@ -696,10 +696,20 @@ FindLinuxESP() {
    local Drive
    local PartNum
    local TableType
+   local DmStatus
+   local SkipIt
    for Drive in `ls /dev/[sh]d?` ; do
-      TableType=`parted $Drive print -m -s 2> /dev/null | head -n 2 | tail -n 1 | cut -d ":" -f 6`
-      if [[ $TableType == 'gpt' ]] ; then # read only GPT disks
-         PartNum=`parted $Drive print -m -s 2> /dev/null | grep ":boot[,;]" | cut -d ":" -f 1`
+      SkipIt=0
+      if [ -x `which dmraid` ] ; then
+         DmStatus=`dmraid -r | grep $Drive`
+         if [ -n "$DmStatus" ] ; then
+            echo "$Drive seems to be part of a RAID array; skipping!"
+            SkipIt=1
+         fi
+      fi
+      TableType=`parted $Drive print -m -s 2>/dev/null | awk -F: '$1 == "'$Drive'" { print $6 }'`
+      if [[ $TableType == 'gpt' && $SkipIt == 0 ]] ; then # read only GPT disks that aren't part of dmraid array
+         PartNum=`LANG=C parted $Drive print -m -s 2>/dev/null | awk -F: '$7 ~ "(^boot| boot)" { print $1 }' | head -n 1`
          if [ "$PartNum" -eq "$PartNum" ] 2> /dev/null ; then
             InstallDir="$RootDir/boot/efi"
             mkdir -p $InstallDir
@@ -721,6 +731,8 @@ FindLinuxESP() {
 # either location.
 # Sets InstallDir to the ESP mount point.
 FindMountedESP() {
+   mount /boot &> /dev/null
+#   mount /boot/efi &> /dev/null
    EspLine=`df "$RootDir/boot/efi" 2> /dev/null | grep boot/efi`
    if [[ ! -n "$EspLine" ]] ; then
       EspLine=`df "$RootDir"/boot | grep boot`