From 92d7af9a8d40b1821a05174a9bf6836fdd99f38c Mon Sep 17 00:00:00 2001 From: srs5694 Date: Fri, 3 Jan 2014 13:24:09 -0500 Subject: [PATCH] Improvements to install.sh's new ESP-detection code. --- NEWS.txt | 4 ++-- install.sh | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index e2485d4..46cbccc 100644 --- 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. diff --git a/install.sh b/install.sh index 41d1817..d1f706c 100755 --- a/install.sh +++ b/install.sh @@ -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` -- 2.39.2